{"record":{"id":"19fdfce8c33ab4fe","repo":"juicedata/juicefs","slug":"corrupted-session-info-json-error-s-19fdfc","errorCode":null,"errorMessage":"corrupted session info; json error: %s","messagePattern":"corrupted session info; json error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/meta/tkv.go","lineNumber":808,"sourceCode":"\t\treturn sids, nil\n\t}\n\tfor k := range vals {\n\t\tsids = append(sids, m.parseSid(k))\n\t}\n\treturn sids, nil\n}\n\nfunc (m *kvMeta) getSession(sid uint64, detail bool) (*Session, error) {\n\tinfo, err := m.get(m.sessionInfoKey(sid))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif info == nil {\n\t\tinfo = []byte(\"{}\")\n\t}\n\tvar s Session\n\tif err = json.Unmarshal(info, &s); err != nil {\n\t\treturn nil, fmt.Errorf(\"corrupted session info; json error: %s\", err)\n\t}\n\ts.Sid = sid\n\tif detail {\n\t\tctx := Background()\n\t\tinodes, err := m.scanKeys(ctx, m.fmtKey(\"SS\", sid))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ts.Sustained = make([]Ino, 0, len(inodes))\n\t\tfor _, sinode := range inodes {\n\t\t\tinode := m.decodeInode(sinode[10:]) // \"SS\" + sid\n\t\t\ts.Sustained = append(s.Sustained, inode)\n\t\t}\n\t\tflocks, err := m.scanValues(ctx, m.fmtKey(\"F\"), -1, nil)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfor k, v := range flocks {","sourceCodeStart":790,"sourceCodeEnd":826,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/meta/tkv.go#L790-L826","documentation":"The JSON unmarshal of the stored session info value failed in getSession. The bytes persisted under the session's info key are not valid JSON (or not a Session object), indicating metadata corruption; an absent key defaults to '{}' but malformed content raises this.","triggerScenarios":"Thrown at pkg/meta/tkv.go:808 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ignore the stale session and let it expire, or delete its keys manually after verifying no live client owns it"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}