{"record":{"id":"5f24d87fc4b533af","repo":"kopia/kopia","slug":"unable-to-parse-q-5f24d8","errorCode":null,"errorMessage":"unable to parse %q","messagePattern":"unable to parse %q","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command_snapshot_verify.go","lineNumber":164,"sourceCode":"\t\t\t//nolint:errcheck\n\t\t\ttw.Process(ctx, twEntry.root, twEntry.rootPath)\n\t\t}\n\n\t\tfor _, oidStr := range c.verifyCommandDirObjectIDs {\n\t\t\toid, err := snapshotfs.ParseObjectIDWithPath(ctx, rep, oidStr)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrapf(err, \"unable to parse: %q\", oidStr)\n\t\t\t}\n\n\t\t\t// ignore error now, return aggregate error at a higher level.\n\t\t\t//nolint:errcheck\n\t\t\ttw.Process(ctx, snapshotfs.DirectoryEntry(rep, oid, nil), oidStr)\n\t\t}\n\n\t\tfor _, oidStr := range c.verifyCommandFileObjectIDs {\n\t\t\toid, err := snapshotfs.ParseObjectIDWithPath(ctx, rep, oidStr)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrapf(err, \"unable to parse %q\", oidStr)\n\t\t\t}\n\n\t\t\t// ignore error now, return aggregate error at a higher level.\n\t\t\t//nolint:errcheck\n\t\t\ttw.Process(ctx, snapshotfs.AutoDetectEntryFromObjectID(ctx, rep, oid, oidStr), oidStr)\n\t\t}\n\n\t\treturn nil\n\t}\n}\n\n// addExpectedWorkFromDirSummaryToVerifier initializes the snapshot verifier with an\n// expected amount of work that will take place during the tree walk for this Entry.\n// If the entry is not a DirectoryWithSummary, or the Summary returns nil, no stats\n// will be added to the totals.\nfunc addExpectedWorkFromDirSummaryToVerifier(ctx context.Context, v *snapshotfs.Verifier, ent fs.Entry) error {\n\tdws, ok := ent.(fs.DirectoryWithSummary)\n\tif !ok {","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/kopia/kopia/blob/82495e54b584c1ef6073c9e1be048f57f8aef078/cli/command_snapshot_verify.go#L146-L182","documentation":"Wraps a failure from snapshotfs.ParseObjectIDWithPath when a user-supplied object ID/path argument (verifyCommandFileObjectIDs) cannot be resolved against the repository root. The parse fails because the string is not a valid object ID, an existing path in the snapshot tree, or a resolvable shorthand. The wrapper preserves the underlying parse error and adds the offending argument in %q for diagnosis.","triggerScenarios":"Running `kopia snapshot verify` with --file-object-ids (or similar) containing a malformed OID (wrong length/characters), a path that does not exist under the repo root, or an ID pointing at a deleted/never-existing object.","commonSituations":"Typoed or truncated object ID pasted from logs; referencing an object from a different repository; path casing mismatch; object GC'd or repository pruned since the ID was recorded.","solutions":["Check the exact object ID/path string for typos, truncation, or extra whitespace and re-run.","Verify the ID exists in this repository via `kopia show <oid>` or `kopia blob list` before passing it.","List valid objects with `kopia snapshot verify --file-...` on IDs taken from `kopia snapshot list --all` output.","If the object was pruned, re-create or restore it from a snapshot before verifying."],"exampleFix":"// before\nkopia snapshot verify --file-object-ids=kABcd123   // truncated OID\n// after\nkopia snapshot verify --file-object-ids=kABcd1234567890abcdef...  // full valid OID from kopia show","handlingStrategy":"validation","validationCode":"oid := strings.TrimSpace(arg)\nif len(oid) == 0 || strings.ContainsAny(oid, \" \\t\") {\n    return fmt.Errorf(\"invalid object ID argument: %q\", oid)\n}\n// pre-check resolvability if you have a repo handle\nif _, err := snapshotfs.ParseObjectIDWithPath(ctx, rep, oid); err != nil {\n    return fmt.Errorf(\"object ID %q not resolvable in this repo: %w\", oid, err)\n}","typeGuard":null,"tryCatchPattern":"if _, err := snapshotfs.ParseObjectIDWithPath(ctx, rep, oidStr); err != nil {\n    var parseErr *snapshotfs.ParseError\n    if errors.As(err, &parseErr) { /* handle unresolvable ID */ }\n    return errors.Wrapf(err, \"unable to parse %q\", oidStr)\n}","preventionTips":["Always copy object IDs in full from `kopia show`/`kopia snapshot list` output.","Trim whitespace before passing IDs in scripts.","Confirm IDs against the same repository you are verifying."],"tags":["cli","object-id","parsing","snapshot-verify"],"backgroundTag":"invalid-identifier-format","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"}