{"record":{"id":"c809946b7b248713","repo":"juicedata/juicefs","slug":"create-table-acl-s","errorCode":null,"errorMessage":"create table acl: %s","messagePattern":"create table acl: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/meta/sql.go","lineNumber":604,"sourceCode":"\t\treturn fmt.Errorf(\"create table node, symlink, xattr: %s\", err)\n\t}\n\tif err := m.syncTable(new(chunk), new(sliceRef), new(delslices)); err != nil {\n\t\treturn fmt.Errorf(\"create table chunk, chunk_ref, delslices: %s\", err)\n\t}\n\tif err := m.syncTable(new(session2), new(sustained), new(delfile)); err != nil {\n\t\treturn fmt.Errorf(\"create table session2, sustaind, delfile: %s\", err)\n\t}\n\tif err := m.syncTable(new(flock), new(plock), new(dirQuota), new(userGroupQuota)); err != nil {\n\t\treturn fmt.Errorf(\"create table flock, plock, dirQuota, userGroupQuota: %s\", err)\n\t}\n\tif err := m.syncTable(new(dirStats)); err != nil {\n\t\treturn fmt.Errorf(\"create table dirStats: %s\", err)\n\t}\n\tif err := m.syncTable(new(detachedNode)); err != nil {\n\t\treturn fmt.Errorf(\"create table detachedNode: %s\", err)\n\t}\n\tif err := m.syncTable(new(acl)); err != nil {\n\t\treturn fmt.Errorf(\"create table acl: %s\", err)\n\t}\n\tif err := m.syncTable(new(delegationToken)); err != nil {\n\t\treturn fmt.Errorf(\"create table delegationToken: %s\", err)\n\t}\n\tif err := m.syncTable(new(changeLog)); err != nil {\n\t\treturn fmt.Errorf(\"create table changeLog: %s\", err)\n\t}\n\treturn nil\n}\n\nfunc (m *dbMeta) doInit(format *Format, force bool) error {\n\tif err := m.syncAllTables(); err != nil {\n\t\treturn err\n\t}\n\tvar s = setting{Name: \"format\"}\n\tvar ok bool\n\terr := m.simpleTxn(Background(), func(ses *xorm.Session) (err error) {\n\t\tok, err = ses.Get(&s)","sourceCodeStart":586,"sourceCodeEnd":622,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/meta/sql.go#L586-L622","documentation":"syncAllTables (pkg/meta/sql.go:603) creates/auto-migrates the `acl` table via xorm Sync2; failure is wrapped as \"create table acl: %s\". The acl table stores POSIX ACL entries for files/directories. Failure aborts metadata engine initialization; since it is late in the sequence, earlier tables already exist and only the acl DDL failed.","triggerScenarios":"Metadata engine initialization when Sync2 on the acl bean fails: privileges, storage exhaustion reached late in init, connection drop, or an existing acl table with incompatible columns (e.g. created by a different tool).","commonSituations":"ACL support enabled in newer JuiceFS versions requires creating this table on legacy volumes whose DB user has since been downgraded; schema table-count limits; collation/charset conflicts on existing acl tables.","solutions":["Inspect the wrapped driver error for the exact DB-side reason and address it.","Grant the DB user CREATE/ALTER rights so the new acl table can be added to existing volumes.","Free DB storage or raise quota if the schema hit limits during init.","After backup, drop an incompatible pre-existing acl table and re-run init.","Re-run the command; Sync2 is idempotent and will only create the missing acl table."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Preflight before enabling ACL on existing volumes:\n//   SHOW GRANTS FOR CURRENT_USER();  -- CREATE needed to add the acl table\n// MySQL: SHOW TABLES LIKE 'jfs_acl';  -- if present from another tool, compare schema first","typeGuard":null,"tryCatchPattern":"if err := initMeta(); err != nil {\n    if strings.Contains(err.Error(), \"create table acl\") {\n        return fmt.Errorf(\"acl table DDL failed; grant CREATE/ALTER or resolve conflicting table: %w\", err)\n    }\n    return err\n}","preventionTips":["Grant CREATE/ALTER before the first mount after enabling ACL-related features.","Never let unrelated tools create tables with the same (prefixed) names in the JuiceFS schema.","Dump metadata (juicefs dump) before upgrades so a failed acl migration can be recovered from.","Ensure late-init resource exhaustion is unlikely: keep DB disk usage below capacity."],"tags":["database","schema-migration","ddl","acl"],"backgroundTag":"database-write-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"}