{"record":{"id":"889b00bc13a10461","repo":"kopia/kopia","slug":"not-found","errorCode":null,"errorMessage":"not found","messagePattern":"not found","errorType":"exception","errorClass":"ErrNotFound","httpStatus":null,"severity":"warning","filePath":"repo/manifest/manifest_manager.go","lineNumber":32,"sourceCode":"\t\"github.com/pkg/errors\"\n\n\t\"github.com/kopia/kopia/internal/clock\"\n\t\"github.com/kopia/kopia/internal/gather\"\n\t\"github.com/kopia/kopia/internal/metrics\"\n\t\"github.com/kopia/kopia/repo/compression\"\n\t\"github.com/kopia/kopia/repo/content\"\n\t\"github.com/kopia/kopia/repo/logging\"\n)\n\nconst (\n\tmanifestLoadParallelism = 8\n\tmanifestIDLength        = 16\n)\n\nvar log = logging.Module(\"kopia/manifest\") // +checklocksignore\n\n// ErrNotFound is returned when the metadata item is not found.\nvar ErrNotFound = errors.New(\"not found\")\n\n// ContentPrefix is the prefix of the content id for manifests.\nconst (\n\tContentPrefix                     = \"m\"\n\tautoCompactionContentCountDefault = 16\n)\n\n// TypeLabelKey is the label key for manifest type.\nconst TypeLabelKey = \"type\"\n\ntype contentManager interface {\n\tRevision() int64\n\tGetContent(ctx context.Context, contentID content.ID) ([]byte, error)\n\tWriteContent(ctx context.Context, data gather.Bytes, prefix content.IDPrefix, comp compression.HeaderID) (content.ID, error)\n\tDeleteContent(ctx context.Context, contentID content.ID) error\n\tIterateContents(ctx context.Context, options content.IterateOptions, callback content.IterateCallback) error\n\tDisableIndexFlush(ctx context.Context)\n\tEnableIndexFlush(ctx context.Context)","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/kopia/kopia/blob/82495e54b584c1ef6073c9e1be048f57f8aef078/repo/manifest/manifest_manager.go#L14-L50","documentation":"manifest.ErrNotFound is the sentinel error returned by the manifest manager when the requested metadata item (manifest, profile, or password) does not exist. Callers are expected to detect it with errors.Is so missing items can be handled as a normal, expected condition rather than a failure.","triggerScenarios":"Calling GetProfile or GetPassword for an identifier that has no stored manifest; DeletePassword on a non-existent entry; server handlers (errorResponse, mustManifestNotFound) translating it for missing lookups.","commonSituations":"Requesting a notification profile by name that was never configured (see cli/command_notification_configure_common.go:49 which tolerates it); reading a persisted password before the first save; OS keyring returning keyring.ErrNotFound which maps to ErrPasswordNotFound; stale references after a manifest was deleted or a repository was re-created.","solutions":["Check for the condition with errors.Is(err, manifest.ErrNotFound) and treat it as 'not configured yet' — create the item instead of failing.","Verify the identifier/name passed to the Get call matches an existing manifest.","If connecting to a different repository than expected, re-check the config file before assuming data loss."],"exampleFix":"// before\noldProfile, err := notifyprofile.GetProfile(ctx, rep, c.profileName)\nif err != nil {\n    return errors.Wrap(err, \"unable to get notification profile\")\n}\n// after\noldProfile, err := notifyprofile.GetProfile(ctx, rep, c.profileName)\nif err != nil && !errors.Is(err, notifyprofile.ErrNotFound) {\n    return errors.Wrap(err, \"unable to get notification profile\")\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"prof, err := notifyprofile.GetProfile(ctx, rep, name)\nif errors.Is(err, manifest.ErrNotFound) {\n    // treat as absent, create default\n} else if err != nil {\n    return err\n}","preventionTips":["Always use errors.Is against the manifest.ErrNotFound sentinel, never string comparison.","Design flows where 'missing profile/password' is a normal first-run case.","Log identifiers when lookup fails to distinguish wrong-name from wrong-repository."],"tags":["go","manifest","not-found"],"backgroundTag":"record-not-found","analyzedSha":"82495e54b584c1ef6073c9e1be048f57f8aef078","analyzedAt":"2026-09-07T20:35:21.689Z","contentChangedAt":"2026-09-07T20:35:21.689Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}