{"record":{"id":"1b6f0a4a37779a0c","repo":"juicedata/juicefs","slug":"unexpected-v","errorCode":null,"errorMessage":"unexpected %v","messagePattern":"unexpected (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/meta/dump.go","lineNumber":620,"sourceCode":"\t\t\t\t\tusedInodes++\n\t\t\t\t}\n\t\t\t\tif err == nil {\n\t\t\t\t\ti := e.Attr.Inode\n\t\t\t\t\tfor {\n\t\t\t\t\t\tif q := quotas[i]; q != nil {\n\t\t\t\t\t\t\tq.UsedSpace += usedSpace\n\t\t\t\t\t\t\tq.UsedInodes += usedInodes\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif i <= 1 || len(parents[i]) == 0 {\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\ti = parents[i][0]\n\t\t\t\t\t}\n\n\t\t\t\t\tvar t json.Token\n\t\t\t\t\tt, err = dec.Token()\n\t\t\t\t\tif err == nil && t != json.Delim('}') {\n\t\t\t\t\t\terr = fmt.Errorf(\"unexpected %v\", t)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tcase \"symlink\":\n\t\t\terr = dec.Decode(&e.Symlink)\n\t\tcase \"xattrs\":\n\t\t\terr = dec.Decode(&e.Xattrs)\n\t\tcase \"posix_acl_access\":\n\t\t\terr = dec.Decode(&e.AccessACL)\n\t\tcase \"posix_acl_default\":\n\t\t\terr = dec.Decode(&e.DefaultACL)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"decode %v: %s\", name, err)\n\t\t}\n\t}\n\tif len(e.Parents) == 1 {\n\t\tload(&e)","sourceCodeStart":602,"sourceCodeEnd":638,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/meta/dump.go#L602-L638","documentation":"During JSON load of a metadata dump, the decoder encountered a token where the closing '}' of an entry object was expected but found something else (e.g. a value or another delimiter). This is thrown by writeFiles/readFiles while parsing the `files` section of a dump. It means the dump file is structurally malformed at that point.","triggerScenarios":"juicefs load/restore reads a dump file whose entry object is not terminated by '}' — e.g. the file was truncated, hand-edited, or produced by a broken writer so the JSON stream contains a non-'}' token after the entry's fields.","commonSituations":"Restoring a backup that was cut short mid-write; concatenating or editing dump files manually; loading a dump written by a buggy/older tool that emitted malformed JSON for an entry.","solutions":["Validate the dump file with a JSON checker (jsonlint or `python -m json.tool`) to locate the malformed entry.","Re-create the dump with `juicefs dump` from a healthy metadata engine and retry the load.","Check that the dump file was not truncated in transfer; compare size/checksum with the source.","If hand-editing was done, restore the original entry object structure including its closing brace."],"exampleFix":"// before: loading a truncated/hand-edited dump\n$ juicefs load sqlite3://meta.db bad.dump\n// after: regenerate and verify\n$ juicefs dump redis://origin/myfs good.dump\n$ python3 -m json.tool good.dump > /dev/null && juicefs load sqlite3://meta.db good.dump","handlingStrategy":"validation","validationCode":"python3 -m json.tool dump.json > /dev/null  # validate dump before juicefs load","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never hand-edit dump files; always regenerate with juicefs dump.","Verify checksum/size of dump files after transfer.","Validate dump JSON before loading into a production engine."],"tags":["json","metadata-dump","parsing"],"backgroundTag":"json-unmarshal-failed","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}