{"record":{"id":"2f014ed6a2c28078","repo":"juicedata/juicefs","slug":"only-d-acls-inserted-expected-d","errorCode":null,"errorMessage":"only %d acls inserted, expected %d","messagePattern":"only (.+?) acls inserted, expected (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/meta/sql.go","lineNumber":6017,"sourceCode":"\n\tacls := make([]*acl, 0, len(id2Rule))\n\tmaxID := uint32(0)\n\tfor id, rule := range id2Rule {\n\t\taclV := newSQLAcl(rule)\n\t\taclV.Id = id\n\t\tacls = append(acls, aclV)\n\t\tif id > maxID {\n\t\t\tmaxID = id\n\t\t}\n\t}\n\n\treturn m.txn(func(s *xorm.Session) error {\n\t\tn, err := s.Insert(acls)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif int(n) != len(acls) {\n\t\t\treturn fmt.Errorf(\"only %d acls inserted, expected %d\", n, len(acls))\n\t\t}\n\t\tm.genLog(ctx, s, time.Now().UnixNano(), \"LOADDUMPEDACLS(%d)\", maxID)\n\t\treturn nil\n\t})\n}\n\nfunc (m *dbMeta) doStoreToken(ctx Context, token []byte) (id uint32, st syscall.Errno) {\n\terr := m.txn(func(s *xorm.Session) error {\n\t\tt := &delegationToken{Token: token}\n\t\t_, err := s.Insert(t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tid = t.Id\n\t\tm.genLog(ctx, s, time.Now().UnixNano(), \"STORETOKEN(%d,%s)\", id, logEncode(token))\n\t\treturn nil\n\t})\n\treturn id, errno(err)","sourceCodeStart":5999,"sourceCodeEnd":6035,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/meta/sql.go#L5999-L6035","documentation":"The batch INSERT of ACLs during metadata load reported fewer affected rows than the number of acl records submitted. Indicates a partial insert (database quirk or row-level failure) that would leave the ACL table incomplete, so the transaction is failed rather than committed.","triggerScenarios":"Thrown at pkg/meta/sql.go:6017 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the metadata load on a clean database","Inspect the dump file for duplicate ACL ids that could collapse inserts"],"exampleFix":null,"handlingStrategy":"retry","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"}