{"record":{"id":"a40cb268a6d55d67","repo":"dgraph-io/dgraph","slug":"while-getting-latest-manifest","errorCode":null,"errorMessage":"while Getting latest manifest: ","messagePattern":"while Getting latest manifest: ","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"worker/backup_manifest.go","lineNumber":148,"sourceCode":"\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\n\tfor _, path := range manifestPaths {\n\t\tpath = filepath.Dir(path)\n\t\t_, path = filepath.Split(path)\n\t\tm, err := readManifest(h, filepath.Join(path, backupManifest))\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"while Getting latest manifest: \")\n\t\t}\n\t\tm.Path = path\n\t\tmlist = append(mlist, m)\n\t}\n\treturn &MasterManifest{Manifests: mlist}, nil\n}\n\n// upgradeManifest updates the in-memory manifest from various versions to the latest version.\n// If the manifest version is 0 (dgraph version < v21.03), attach namespace to the predicates and\n// the drop data/attr operation.\n// If the manifest version is 2103, convert the format of predicate from <ns bytes>|<attr> to\n// <ns string>-<attr>. This is because of a bug for namespace greater than 127.\n// See https://github.com/dgraph-io/dgraph/pull/7810\n// NOTE: Do not use the upgraded manifest to overwrite the non-upgraded manifest.\nfunc upgradeManifest(m *Manifest) error {\n\tswitch m.Version {\n\tcase 0:\n\t\tfor gid, preds := range m.Groups {","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/worker/backup_manifest.go#L130-L166","documentation":"When no master manifest exists, getConsolidatedManifest reads each per-backup manifest file to build one. This error wraps a failure of readManifest for any individual backup directory, meaning one of the per-backup manifest files could not be read or the list of paths is stale.","triggerScenarios":"GetManifestNoUpgrade triggers consolidation; during iteration over manifestPaths, readManifest(h, path/manifest.yaml) fails for some backup directory — deleted file between listing and read, permission error, or corrupt file.","commonSituations":"Concurrent deletion/lifecycle expiration of a backup directory; object listing cache returning paths that no longer exist; per-directory permission differences.","solutions":["Re-list the backup location and retry once stale entries are gone.","Fix read permissions on the affected backup directory.","Restore the missing/corrupt per-backup manifest file.","Prevent lifecycle rules from deleting manifests while consolidation runs."],"exampleFix":"// before: s3 lifecycle expires manifest during listing\n{\"Rules\":[{\"Prefix\":\"backup/\",\"Expiration\":{\"Days\":1}}]}\n// after: keep manifests until backup retention window passes\n{\"Rules\":[{\"Prefix\":\"backup/\",\"Expiration\":{\"Days\":30}}]}","handlingStrategy":"retry","validationCode":"paths := h.ListPaths(\"\")\nfor _, p := range paths {\n    if !h.FileExists(filepath.Join(filepath.Base(filepath.Dir(p)), backupManifest)) {\n        return fmt.Errorf(\"manifest listed but missing: %s\", p)\n    }\n}","typeGuard":null,"tryCatchPattern":"m, err := GetManifestNoUpgrade(h, uri)\nif err != nil && strings.Contains(err.Error(), \"while Getting latest manifest\") {\n    time.Sleep(2 * time.Second)\n    m, err = GetManifestNoUpgrade(h, uri) // stale listing entries usually clear\n}","preventionTips":["Avoid deleting backup directories during consolidation","Set lifecycle expirations well beyond backup retention","Re-list before retrying after concurrent deletions"],"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"}