kopia/kopia · warning · ErrNotFound
not found
Error message
not found
What it means
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.
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.
Example fix
// before
oldProfile, err := notifyprofile.GetProfile(ctx, rep, c.profileName)
if err != nil {
return errors.Wrap(err, "unable to get notification profile")
}
// after
oldProfile, err := notifyprofile.GetProfile(ctx, rep, c.profileName)
if err != nil && !errors.Is(err, notifyprofile.ErrNotFound) {
return errors.Wrap(err, "unable to get notification profile")
} Defensive patterns
Strategy: try-catch
Try / catch
prof, err := notifyprofile.GetProfile(ctx, rep, name)
if errors.Is(err, manifest.ErrNotFound) {
// treat as absent, create default
} else if err != nil {
return err
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
AI-assisted analysis of kopia/kopia@82495e54b5 (2026-09-07).
Data as JSON: /api/errors/889b00bc13a10461.
Report an issue: GitHub.
Appendix: source
Thrown at repo/manifest/manifest_manager.go:32
"github.com/pkg/errors"
"github.com/kopia/kopia/internal/clock"
"github.com/kopia/kopia/internal/gather"
"github.com/kopia/kopia/internal/metrics"
"github.com/kopia/kopia/repo/compression"
"github.com/kopia/kopia/repo/content"
"github.com/kopia/kopia/repo/logging"
)
const (
manifestLoadParallelism = 8
manifestIDLength = 16
)
var log = logging.Module("kopia/manifest") // +checklocksignore
// ErrNotFound is returned when the metadata item is not found.
var ErrNotFound = errors.New("not found")
// ContentPrefix is the prefix of the content id for manifests.
const (
ContentPrefix = "m"
autoCompactionContentCountDefault = 16
)
// TypeLabelKey is the label key for manifest type.
const TypeLabelKey = "type"
type contentManager interface {
Revision() int64
GetContent(ctx context.Context, contentID content.ID) ([]byte, error)
WriteContent(ctx context.Context, data gather.Bytes, prefix content.IDPrefix, comp compression.HeaderID) (content.ID, error)
DeleteContent(ctx context.Context, contentID content.ID) error
IterateContents(ctx context.Context, options content.IterateOptions, callback content.IterateCallback) error
DisableIndexFlush(ctx context.Context)
EnableIndexFlush(ctx context.Context)View on GitHub (pinned to 82495e54b5)