{"record":{"id":"d4b4dacc85dd01df","repo":"kopia/kopia","slug":"entry-snapshotted-detail","errorCode":null,"errorMessage":"entry snapshotted detail","messagePattern":"entry snapshotted detail","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command_policy_set_logging.go","lineNumber":41,"sourceCode":"\tcmd.Flag(\"log-dir-snapshotted\", \"Log detail when a directory is snapshotted (or 'inherit')\").PlaceHolder(\"N\").StringVar(&c.dirSnapshottedDetail)\n\tcmd.Flag(\"log-dir-ignored\", \"Log detail when a directory is ignored (or 'inherit')\").PlaceHolder(\"N\").StringVar(&c.dirIgnoredDetail)\n\tcmd.Flag(\"log-entry-snapshotted\", \"Log detail when an entry is snapshotted (or 'inherit')\").PlaceHolder(\"N\").StringVar(&c.entrySnapshottedDetail)\n\tcmd.Flag(\"log-entry-ignored\", \"Log detail when an entry is ignored (or 'inherit')\").PlaceHolder(\"N\").StringVar(&c.entryIgnoredDetail)\n\tcmd.Flag(\"log-entry-cache-hit\", \"Log detail on entry cache hit (or 'inherit')\").PlaceHolder(\"N\").StringVar(&c.entryCacheHitDetail)\n\tcmd.Flag(\"log-entry-cache-miss\", \"Log detail on entry cache miss (or 'inherit')\").PlaceHolder(\"N\").StringVar(&c.entryCacheMissDetail)\n}\n\nfunc (c *policyLoggingFlags) setLoggingPolicyFromFlags(ctx context.Context, p *policy.LoggingPolicy, changeCount *int) error {\n\tif err := applyPolicyLogDetailPtr(ctx, \"directory snapshotted detail\", &p.Directories.Snapshotted, c.dirSnapshottedDetail, changeCount); err != nil {\n\t\treturn errors.Wrap(err, \"directory snapshotted detail\")\n\t}\n\n\tif err := applyPolicyLogDetailPtr(ctx, \"directory ignored detail\", &p.Directories.Ignored, c.dirIgnoredDetail, changeCount); err != nil {\n\t\treturn errors.Wrap(err, \"directory ignored detail\")\n\t}\n\n\tif err := applyPolicyLogDetailPtr(ctx, \"entry snapshotted detail\", &p.Entries.Snapshotted, c.entrySnapshottedDetail, changeCount); err != nil {\n\t\treturn errors.Wrap(err, \"entry snapshotted detail\")\n\t}\n\n\tif err := applyPolicyLogDetailPtr(ctx, \"entry ignored detail\", &p.Entries.Ignored, c.entryIgnoredDetail, changeCount); err != nil {\n\t\treturn errors.Wrap(err, \"entry ignored detail\")\n\t}\n\n\tif err := applyPolicyLogDetailPtr(ctx, \"entry cache hit detail\", &p.Entries.CacheHit, c.entryCacheHitDetail, changeCount); err != nil {\n\t\treturn errors.Wrap(err, \"entry cache hit detail\")\n\t}\n\n\tif err := applyPolicyLogDetailPtr(ctx, \"entry cache miss detail\", &p.Entries.CacheMiss, c.entryCacheMissDetail, changeCount); err != nil {\n\t\treturn errors.Wrap(err, \"entry cache miss detail\")\n\t}\n\n\treturn nil\n}\n\nfunc applyPolicyLogDetailPtr(ctx context.Context, desc string, val **policy.LogDetail, str string, changeCount *int) error {","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/kopia/kopia/blob/82495e54b584c1ef6073c9e1be048f57f8aef078/cli/command_policy_set_logging.go#L23-L59","documentation":"Wrapper error from kopia's `policy set` for the `--log-entry-snapshotted` flag. It wraps a parse failure inside applyPolicyLogDetailPtr: the given value could not be converted to a valid policy.LogDetail integer or the 'inherit' keyword.","triggerScenarios":"`kopia policy set ... --log-entry-snapshotted <value>` with a non-integer or out-of-range value (must be >= LogDetailNone and <= LogDetailMax, or 'inherit').","commonSituations":"Hand-editing shell scripts with a mistyped level; passing floats like '1.5'; passing boolean-style 'on'; using a level valid for a different kopia version after an upgrade changed the enum bounds.","solutions":["Supply a plain integer within the documented LogDetail range, e.g. `--log-entry-snapshotted 1`.","Use 'inherit' (no quotes needed beyond shell quoting) to reset to the inherited default.","Trim whitespace/quotes from the value in scripts before invoking kopia."],"exampleFix":"// before\nkopia policy set /path --log-entry-snapshotted 99\n// after\nkopia policy set /path --log-entry-snapshotted 2","handlingStrategy":"validation","validationCode":"func validateLogDetailFlag(name, value string) error {\n    if value == \"\" || value == \"inherit\" {\n        return nil\n    }\n    v, err := strconv.Atoi(value)\n    if err != nil || v < int(policy.LogDetailNone) || v > int(policy.LogDetailMax) {\n        return fmt.Errorf(\"%s must be an integer in [%d,%d] or 'inherit', got %q\", name, policy.LogDetailNone, policy.LogDetailMax, value)\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"err := c.setLoggingPolicyFromFlags(ctx, p, &n)\nif err != nil {\n    var synErr *strconv.NumError\n    if errors.As(err, &synErr) {\n        return fmt.Errorf(\"log detail flags require an integer or 'inherit'\")\n    }\n    return err\n}","preventionTips":["Zero-pad nothing — plain decimal integers only; no floats or enum names.","Use 'inherit' verbatim to reset.","Validate all six log-detail values in one pre-flight pass before invoking kopia."],"tags":["cli","policy","validation"],"backgroundTag":"invalid-flag-value","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"}