{"record":{"id":"bca202fcfe5bb9d0","repo":"juicedata/juicefs","slug":"create-table-changelog-s","errorCode":null,"errorMessage":"create table changeLog: %s","messagePattern":"create table changeLog: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/meta/sql.go","lineNumber":610,"sourceCode":"\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)\n\t\treturn err\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n","sourceCodeStart":592,"sourceCodeEnd":628,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/meta/sql.go#L592-L628","documentation":"Same table-sync failure as the delegationToken case, but for the changeLog table: syncAllTables iterates all metadata tables and wraps any xorm Sync2 failure in a 'create table changeLog: %s' error, aborting initialization.","triggerScenarios":"juicefs format or mount on a SQL metadata engine when the changeLog table cannot be created or altered — missing DDL privileges, schema lock, or transient DB error during syncTable(new(changeLog)).","commonSituations":"Restricted DB account on managed MySQL/RDS without DDL rights; concurrent format runs racing on schema; disk-full database server preventing DDL.","solutions":["Grant CREATE/ALTER privileges on the database to the JuiceFS metadata user","Check for concurrent juicefs format/mount processes and serialized schema setup","Read the wrapped error to identify the exact DDL problem (e.g. disk full, lock wait timeout)","Verify DB connectivity and free disk space on the metadata server"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Ensure the changeLog table can be created: run one mount/format with a DDL-capable account first\nGRANT CREATE, ALTER ON jfs.* TO 'jfs'@'%';","typeGuard":null,"tryCatchPattern":"if err := meta.Open(sqlURL); err != nil {\n    // inspect wrapped 'create table changeLog' cause before retrying\n    log.Fatalf(\"schema sync failed: %v\", err)\n}","preventionTips":["Avoid concurrent format/mount during first initialization","Monitor DB disk space","Use an account with full DDL rights for the first mount"],"tags":["database","sql","schema-migration","changelog"],"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-14T05:17:10.506Z"}