{"record":{"id":"8977e1554038a7f7","repo":"dgraph-io/dgraph","slug":"complete-backup-failed","errorCode":null,"errorMessage":"complete backup failed","messagePattern":"complete backup failed","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"worker/backup.go","lineNumber":729,"sourceCode":"\t\treturn err\n\t}\n\turi, err := url.Parse(pr.Request.Destination)\n\tif err != nil {\n\t\treturn err\n\t}\n\thandler, err := NewUriHandler(uri, GetCredentialsFromRequest(pr.Request))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmanifest, err := GetManifestNoUpgrade(handler, uri)\n\tif err != nil {\n\t\treturn err\n\t}\n\tmanifest.Manifests = append(manifest.Manifests, m)\n\n\tif err := CreateManifest(handler, uri, manifest); err != nil {\n\t\treturn errors.Wrap(err, \"complete backup failed\")\n\t}\n\t// Best-effort: write summary manifest. Failure does not abort the backup.\n\tif err := CreateManifestSummary(handler, manifest); err != nil {\n\t\tglog.Warningf(\"Failed to write backup summary manifest (non-fatal): %v\", err)\n\t}\n\tglog.Infof(\"Backup completed OK.\")\n\treturn nil\n}\n\n// GoString implements the GoStringer interface for Manifest.\nfunc (m *Manifest) GoString() string {\n\treturn fmt.Sprintf(`Manifest{Since: %d, ReadTs: %d, Groups: %v, Encrypted: %v}`,\n\t\tm.SinceTsDeprecated, m.ReadTs, m.Groups, m.Encrypted)\n}\n\nfunc (tl *threadLocal) toBackupList(key []byte, itr *badger.Iterator) (\n\t*bpb.KVList, *pb.DropOperation, error) {\n\tlist := &bpb.KVList{}","sourceCodeStart":711,"sourceCodeEnd":747,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/worker/backup.go#L711-L747","documentation":"CompleteBackup is the final stage of a backup: after all data is written, it appends the final manifest entry and calls CreateManifest to persist the manifest that marks the backup complete. If writing that manifest fails (storage error, permissions, network), the backup cannot be considered complete and the error is wrapped with this message.","triggerScenarios":"Running a full backup where CreateManifest(handler, uri, manifest) fails after the data upload — storage backend became unreachable, credentials expired mid-backup, bucket write failed, or network blip at the final manifest upload.","commonSituations":"Long backups whose session token expires before completion; S3/MinIO outage at the end of the backup; disk full at destination; flaky network to object storage.","solutions":["Check the wrapped inner error and re-run the backup (or resume with forceFull if state is inconsistent)","Verify credentials won't expire mid-backup (use long-lived creds or refresh tokens)","Ensure the destination has sufficient space and is reachable for the whole backup duration","Retry the backup after confirming object storage health"],"exampleFix":"// before\nif err := CreateManifest(handler, uri, manifest); err != nil {\n    return errors.Wrap(err, \"complete backup failed\")\n}\n// after\nif err := CreateManifest(handler, uri, manifest); err != nil {\n    glog.Errorf(\"manifest upload failed for %s: %v\", uri, err) // log root cause\n    return errors.Wrap(err, \"complete backup failed\")\n}","handlingStrategy":"retry","validationCode":"// ensure the destination remains writable for the full backup duration\nif err := handler.WriteProbe(\"./\"); err != nil {\n    return fmt.Errorf(\"destination not writable, aborting backup: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"err := CompleteBackup(ctx, req)\nif err != nil && strings.Contains(err.Error(), \"complete backup failed\") {\n    // check storage availability/credentials, then re-run the backup\n    time.Sleep(backoff)\n    err = CompleteBackup(ctx, req)\n}","preventionTips":["Use credentials that won't expire during long backups","Alert on object-store outages during backup windows","Verify sufficient destination capacity before starting large backups","After failure, check whether a partial manifest exists and clean/restart with forceFull"],"tags":["backup","manifest","storage","finalization"],"backgroundTag":"backup-manifest-write-failed","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}