{"record":{"id":"953082fa1f4291bd","repo":"dgraph-io/dgraph","slug":"failed-to-read-master-manifest","errorCode":null,"errorMessage":"failed to read master manifest: ","messagePattern":"failed to read master manifest: ","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"worker/backup_manifest.go","lineNumber":124,"sourceCode":"\t}\n\n\tif req.BackupNum > 0 {\n\t\tif len(manifests) < int(req.BackupNum) {\n\t\t\treturn nil, errors.Errorf(\"not enough backups to restore manifest with backupNum %d\",\n\t\t\t\treq.BackupNum)\n\t\t}\n\t\tmanifests = manifests[len(manifests)-int(req.BackupNum):]\n\t}\n\treturn manifests, nil\n}\n\n// getConsolidatedManifest walks over all the backup directories and generates a master manifest.\nfunc getConsolidatedManifest(h UriHandler, uri *url.URL) (*MasterManifest, error) {\n\t// If there is a master manifest already, we just return it.\n\tif h.FileExists(backupManifest) {\n\t\tmanifest, err := readMasterManifest(h, backupManifest)\n\t\tif err != nil {\n\t\t\treturn &MasterManifest{}, errors.Wrap(err, \"failed to read master manifest: \")\n\t\t}\n\t\treturn manifest, nil\n\t}\n\n\t// Otherwise, we create a master manifest by going through all the backup directories.\n\tpaths := h.ListPaths(\"\")\n\n\tvar manifestPaths []string\n\tsuffix := filepath.Join(string(filepath.Separator), backupManifest)\n\tfor _, p := range paths {\n\t\tif strings.HasSuffix(p, suffix) {\n\t\t\tmanifestPaths = append(manifestPaths, p)\n\t\t}\n\t}\n\n\tsort.Strings(manifestPaths)\n\tvar mlist []*Manifest\n","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/worker/backup_manifest.go#L106-L142","documentation":"getConsolidatedManifest first tries to read the existing master manifest (manifest.yaml) at the backup root via readMasterManifest. This error wraps any failure of that read (I/O error, permissions, malformed content) so GetManifestNoUpgrade callers see that the master manifest could not be loaded.","triggerScenarios":"GetManifestNoUpgrade is called when a master manifest file exists at the backup URI root but h.FileExists(backupManifest) is true and readMasterManifest fails — unreadable/corrupt manifest file, wrong credentials, or transient storage errors.","commonSituations":"Expired cloud-storage credentials; corrupted manifest file after interrupted upload; partially uploaded master manifest; object-store permission changes.","solutions":["Verify storage credentials/permissions for the backup URI and retry.","Inspect the master manifest file for corruption; re-upload or repair it.","Delete the corrupt master manifest so it is regenerated from per-backup manifests (getConsolidatedManifest rebuilds it).","Check network/proxy connectivity to the storage backend."],"exampleFix":"// before: corrupt master manifest blocks reads\naws s3 rm s3://bucket/backup/manifest.yaml\n// after: it is regenerated from individual backup manifests on next read","handlingStrategy":"try-catch","validationCode":"ok, err := storageAccessible(uri, \"manifest.yaml\")\nif err != nil || !ok {\n    return fmt.Errorf(\"master manifest unreadable at %s: %v\", uri, err)\n}","typeGuard":null,"tryCatchPattern":"manifest, err := GetManifestNoUpgrade(h, uri)\nif err != nil && strings.Contains(err.Error(), \"failed to read master manifest\") {\n    // validate credentials/connectivity, optionally remove corrupt master manifest and retry\n    if err2 := checkStorageAccess(h); err2 == nil {\n        manifest, err = GetManifestNoUpgrade(h, uri)\n    }\n}","preventionTips":["Rotate storage credentials before expiry","Monitor upload completion to avoid truncated master manifests","Test backup URI readability before scheduled restores"],"tags":["backup","manifest","storage","io"],"backgroundTag":"manifest-read-failed","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}