juicedata/juicefs · error
update table edge, chunk, xattr, sustained: %s
Error message
update table edge, chunk, xattr, sustained: %s
What it means
Same doNewSession upgrade path: syncing edge, chunk, xattr, and sustained tables (to ensure primary keys) is wrapped as 'update table edge, chunk, xattr, sustained: %s' on failure, aborting the mount.
Source
Thrown at pkg/meta/sql.go:776
}
return err
})
return
}
func (m *dbMeta) doNewSession(sinfo []byte, update bool) error {
// add new table
err := m.syncTable(new(session2), new(delslices), new(dirStats), new(detachedNode), new(dirQuota), new(userGroupQuota), new(acl), new(delegationToken), new(changeLog))
if err != nil {
return fmt.Errorf("update table session2, delslices, dirstats, detachedNode, dirQuota, userGroupQuota, acl, changeLog: %s", err)
}
// add node table
if err = m.syncTable(new(node)); err != nil {
return fmt.Errorf("update table node: %s", err)
}
// add primary key
if err = m.syncTable(new(edge), new(chunk), new(xattr), new(sustained)); err != nil {
return fmt.Errorf("update table edge, chunk, xattr, sustained: %s", err)
}
// update the owner from uint64 to int64
if err = m.syncTable(new(flock), new(plock)); err != nil {
return fmt.Errorf("update table flock, plock: %s", err)
}
for {
beans := session2{Sid: m.sid, Expire: m.expireTime(), Info: sinfo}
if update {
return m.txn(func(s *xorm.Session) error {
_, err = s.Cols("expire", "info").Update(&beans, &session2{Sid: beans.Sid})
if err == nil {
m.genLog(Background(), s, time.Now().UnixNano(), "NEWSESSION(%d,%d,%s)", m.sid, beans.Expire, logEncode(sinfo))
}
return err
})
} else {
if err = m.txn(func(s *xorm.Session) error {View on GitHub (pinned to c9a67b23e8)
Solutions
- Grant ALTER/CREATE privileges to the metadata user and retry
- Detect and remove duplicate keys in edge/chunk/xattr/sustained tables blocking primary key creation
- Increase lock wait timeout (innodb_lock_wait_timeout) for the upgrade on large tables
- Restore from metadata backup if a previous upgrade was interrupted and left partial schema
Defensive patterns
Strategy: validation
Validate before calling
-- Check duplicates in upgrade-target tables before mounting SELECT inode, COUNT(*) c FROM edge GROUP BY inode, name HAVING c > 1;
Try / catch
if err := mount(sqlURL); err != nil {
log.Fatalf("schema upgrade failed; restore backup or fix duplicates: %v", err)
} Prevention
- Backup metadata before upgrades
- Raise innodb_lock_wait_timeout for large-table ALTERs
- Upgrade one client at a time
When it happens
Trigger: Legacy-volume mount when xorm Sync2 fails on any of edge/chunk/xattr/sustained — duplicate rows blocking primary-key addition, missing ALTER privilege, lock timeout, or dropped DB connection.
Common situations: Upgrading an old MySQL volume with large chunk/edge tables under lock-wait timeouts; restricted managed-DB accounts; interrupted previous upgrade leaving inconsistent schema.
Related errors
- update table node: %s
- update table session2, delslices, dirstats, detachedNode, di
- update table flock, plock: %s
- create table delegationToken: %s
- create table changeLog: %s
AI-assisted analysis of juicedata/juicefs@c9a67b23e8 (2026-09-06).
Data as JSON: /api/errors/2711c081ef710320.
Report an issue: GitHub.