{"record":{"id":"b1566be9f0704ad2","repo":"dgraph-io/dgraph","slug":"cannot-create-tablet-for-restored-predicate-s","errorCode":null,"errorMessage":"cannot create tablet for restored predicate %s","messagePattern":"cannot create tablet for restored predicate (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"worker/online_restore.go","lineNumber":332,"sourceCode":"\t\t// predicate's group. Registering them here would create an inconsistent\n\t\t// state that causes backup manifest duplication and may trigger futile\n\t\t// rebalancing attempts.\n\t\t//\n\t\t// Skipping ForceTablet is safe because the restore mapper decides which\n\t\t// data keys to restore based on the manifest's predicate set (predSet),\n\t\t// not on Zero's tablet assignments. The supporting predicate data will\n\t\t// still be restored to the correct Alpha's Badger store.\n\t\tif strings.HasSuffix(pred, hnsw.VecEntry) ||\n\t\t\tstrings.HasSuffix(pred, hnsw.VecKeyword) ||\n\t\t\tstrings.HasSuffix(pred, hnsw.VecDead) {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Force the tablet to be moved to this group, even\n\t\t// if it's currently being served by another group.\n\t\ttablet, err := groups().ForceTablet(pred)\n\t\tif err != nil {\n\t\t\treturn errors.Wrapf(err, \"cannot create tablet for restored predicate %s\", pred)\n\t\t}\n\t\tif tablet.GetGroupId() != req.GroupId {\n\t\t\treturn errors.Errorf(\"cannot assign tablet for pred %s to group %d\", pred, req.GroupId)\n\t\t}\n\t}\n\n\tmapDir, err := os.MkdirTemp(x.WorkerConfig.TmpDir, \"restore-map\")\n\tx.Check(err)\n\tdefer func() {\n\t\tif err := os.RemoveAll(mapDir); err != nil {\n\t\t\tglog.Warningf(\"Error removing temp restore-map dir: %v\", err)\n\t\t}\n\t}()\n\tglog.Infof(\"Created temporary map directory: %s\\n\", mapDir)\n\n\t// Map the backup.\n\tmapRes, err := RunMapper(req, mapDir)\n\tif err != nil {","sourceCodeStart":314,"sourceCodeEnd":350,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/worker/online_restore.go#L314-L350","documentation":"Wrapped by handleRestoreProposal (worker/online_restore.go:332). For each predicate in the backup's group entry, restore calls groups().ForceTablet(pred) to force the tablet for that predicate onto this group in Zero; failure means Zero refused or failed to create/move the tablet (wrapped error carries the Zero-side cause).","triggerScenarios":"Zero unreachable or not the leader when the restore proposal applies; predicate already being moved by another rebalancer/moveTablet operation; Zero returns an error for a tablet that conflicts with current membership state.","commonSituations":"Restore executed while Zero is electing a leader; concurrent moveTablet operations or a tablet-snapshot conflict; membership churn (Alpha joining/leaving) during restore; stale Zero state after a crash.","solutions":["Check Zero leader health (all Zero replicas up, a leader elected) and retry the restore.","Ensure no concurrent moveTablet operations or scaling events run during restore; quiesce the cluster before restoring.","Inspect the wrapped Zero error in Alpha logs for the exact ForceTablet failure and address it (e.g. membership conflict).","Retry restore after the cluster membership is stable."],"exampleFix":"# before: restore during tablet move / zero election fails\n# after: verify stable zero leader, then restore\ncurl localhost:6080/state | jq '.zeros[].leader'\ncurl -X POST localhost:8080/restore -d '{\"location\": \"s3://bucket/backup\", \"groupId\": 1}'","handlingStrategy":"retry","validationCode":"// Pre-check Zero leader stability before restore\nresp, _ := http.Get(\"http://zero:6080/state\")\n// confirm a leader exists and no moveTablet operations pending","typeGuard":null,"tryCatchPattern":"err := restore(ctx, req)\nif err != nil && strings.Contains(err.Error(), \"cannot create tablet for restored predicate\") {\n    // wait for Zero leader + membership stability, then retry\n    time.Sleep(time.Minute)\n    err = restore(ctx, req)\n}","preventionTips":["Keep a healthy Zero leader throughout the restore.","Suspend tablet moves / cluster scaling during restore.","Restore on a quiescent cluster; avoid membership churn (Alpha joins/leaves).","Read the wrapped Zero error in Alpha logs to address the exact cause."],"tags":["dgraph","restore","tablet","zero"],"backgroundTag":"tablet-assignment-failed","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}