{"record":{"id":"7c60f090b098d4c4","repo":"ipfs/kubo","slug":"path-s-is-not-pinned","errorCode":null,"errorMessage":"path '%s' is not pinned","messagePattern":"path '(.+?)' is not pinned","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/pin/pin.go","lineNumber":620,"sourceCode":"\n\t\trp, _, err := api.ResolvePath(req.Context, p)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tcids = append(cids, rp.RootCid())\n\t}\n\n\t// Check pins using the new type-specific method\n\tpinned, err := pinner.CheckIfPinnedWithType(req.Context, mode, displayNames, cids...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Process results\n\tfor i, p := range pinned {\n\t\tif !p.Pinned() {\n\t\t\treturn fmt.Errorf(\"path '%s' is not pinned\", req.Arguments[i])\n\t\t}\n\n\t\tpinType, _ := pin.ModeToString(p.Mode)\n\t\tif p.Mode == pin.Indirect && p.Via.Defined() {\n\t\t\tpinType = \"indirect through \" + enc.Encode(p.Via)\n\t\t}\n\n\t\terr = emit(PinLsOutputWrapper{\n\t\t\tPinLsObject: PinLsObject{\n\t\t\t\tType: pinType,\n\t\t\t\tCid:  enc.Encode(cids[i]),\n\t\t\t\tName: p.Name,\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}","sourceCodeStart":602,"sourceCodeEnd":638,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/pin/pin.go#L602-L638","documentation":"When `ipfs pin ls` is called with explicit path/CID arguments, the command resolves each argument's pin status via `pinLsKeys`. If any returned result reports the item as not pinned (`!p.Pinned()`), the command fails with this error naming the offending path — pin ls on an explicit argument is strict rather than silently omitting it.","triggerScenarios":"`ipfs pin ls <cid>` (or `--type=<t> <cid>`) where the CID exists on the node but is not pinned, or is pinned only in a way filtered out by the requested type filter; also direct RPC `pin/ls` calls with such arguments.","commonSituations":"Checking whether a CID is pinned by running `ipfs pin ls <cid>` and treating exit failure as 'not pinned'; stale scripts referencing unpinned CIDs after a GC; querying with a type filter that excludes the actual pin mode (e.g. `--type=direct` on a recursively pinned CID).","solutions":["Use `ipfs pin ls --type=all <cid>` to check any pin kind, or drop the type filter.","Use `ipfs pin ls` without arguments and grep for the CID to avoid the hard failure.","Treat the command's error exit as 'not pinned' in scripts, or use `ipfs pin ls <cid> || echo not-pinned`.","If the pin was expected, re-add it with `ipfs pin add <cid>`."],"exampleFix":"// before\nout, err := exec.Command(\"ipfs\", \"pin\", \"ls\", cid).Output()\n// after\nout, err := exec.Command(\"ipfs\", \"pin\", \"ls\", \"--type=all\", cid).Output()\nif err != nil { isPinned = false }","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"out, err := exec.Command(\"ipfs\", \"pin\", \"ls\", \"--type=all\", cid).Output()\nif err != nil {\n    if strings.Contains(err.Error(), \"is not pinned\") {\n        isPinned = false // treat as a status, not a crash\n    } else { return err }\n}","preventionTips":["Query with --type=all to avoid filter-caused false negatives","Use argument-less `ipfs pin ls` + grep for soft existence checks","Re-add pins with `ipfs pin add` before scripts that assume presence"],"tags":["ipfs","cli","pinning","not-found"],"backgroundTag":"path-not-pinned","analyzedSha":"329838acdfafae224582930457efe80aa217afc0","analyzedAt":"2026-09-03T18:30:52.135Z","contentChangedAt":"2026-09-03T18:30:52.135Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}