juicedata/juicefs · error

corrupted session info; json error: %s

Error message

corrupted session info; json error: %s

What it means

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.

Source

Thrown at pkg/meta/tkv.go:808

		return sids, nil
	}
	for k := range vals {
		sids = append(sids, m.parseSid(k))
	}
	return sids, nil
}

func (m *kvMeta) getSession(sid uint64, detail bool) (*Session, error) {
	info, err := m.get(m.sessionInfoKey(sid))
	if err != nil {
		return nil, err
	}
	if info == nil {
		info = []byte("{}")
	}
	var s Session
	if err = json.Unmarshal(info, &s); err != nil {
		return nil, fmt.Errorf("corrupted session info; json error: %s", err)
	}
	s.Sid = sid
	if detail {
		ctx := Background()
		inodes, err := m.scanKeys(ctx, m.fmtKey("SS", sid))
		if err != nil {
			return nil, err
		}
		s.Sustained = make([]Ino, 0, len(inodes))
		for _, sinode := range inodes {
			inode := m.decodeInode(sinode[10:]) // "SS" + sid
			s.Sustained = append(s.Sustained, inode)
		}
		flocks, err := m.scanValues(ctx, m.fmtKey("F"), -1, nil)
		if err != nil {
			return nil, err
		}
		for k, v := range flocks {

View on GitHub (pinned to c9a67b23e8)

Solutions

  1. Ignore the stale session and let it expire, or delete its keys manually after verifying no live client owns it
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/meta/tkv.go:808 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of juicedata/juicefs@c9a67b23e8 (2026-09-06). Data as JSON: /api/errors/19fdfce8c33ab4fe. Report an issue: GitHub.