{"record":{"id":"bca34b93f2e3e519","repo":"ipfs/kubo","slug":"s-currently-offline-perhaps-retry-without-the-o","errorCode":null,"errorMessage":"%s (currently offline, perhaps retry without the offline flag)","messagePattern":"(.+?) \\(currently offline, perhaps retry without the offline flag\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/dag/export.go","lineNumber":147,"sourceCode":"\t\t\treturn\n\t\t}\n\n\t}()\n\n\tres.SetEncodingType(cmds.OctetStream)\n\tres.SetContentType(\"application/vnd.ipld.car\")\n\tif err := res.Emit(pipeR); err != nil {\n\t\tpipeR.Close() // ignore the error if any\n\t\treturn err\n\t}\n\n\terr = <-errCh\n\n\t// minimal user friendliness\n\tif errors.Is(err, ipld.ErrNotFound{}) {\n\t\texplicitOffline, _ := req.Options[\"offline\"].(bool)\n\t\tif explicitOffline {\n\t\t\terr = fmt.Errorf(\"%s (currently offline, perhaps retry without the offline flag)\", err)\n\t\t} else {\n\t\t\tnode, envErr := cmdenv.GetNode(env)\n\t\t\tif envErr == nil && !node.IsOnline {\n\t\t\t\terr = fmt.Errorf(\"%s (currently offline, perhaps retry after attaching to the network)\", err)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn err\n}\n\n// exportPartialCAR is the best-effort engine behind `dag export --local-only`.\n// It walks the DAG rooted at root and writes the visited blocks to w as a\n// CARv1 stream.\n//\n// The walker reads from the raw blockstore directly (not via the kubo\n// CoreAPI or DAGService), so it is structurally incapable of triggering a\n// network fetch. Any block missing or unreadable locally, plus its entire","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/dag/export.go#L129-L165","documentation":"When the CAR export fails with `ipld.ErrNotFound` (a block in the DAG could not be found) and the user explicitly passed `--offline`, kubo appends this hint explaining that offline mode forbids network lookups, so missing blocks cannot be fetched. It is purely cosmetic wrapping of the underlying ErrNotFound to make the remedy obvious.","triggerScenarios":"Running `ipfs dag export --offline <cid>` (or `--local-only`, which implies offline) where part of the DAG is not in the local blockstore, so traversal hits `ipld.ErrNotFound{}`.","commonSituations":"Exporting a partial DAG after a partial pin/gc; exporting a CID whose deeper blocks were never fetched; running a node that is deliberately offline but was expected to hold all blocks.","solutions":["Retry without `--offline` so the node can fetch missing blocks from the network.","Bring the missing blocks into the blockstore first (`ipfs get`/`ipfs pin add` while online), then export offline.","Check which blocks are missing with `ipfs dag stat --offline` or verify the pin is complete."],"exampleFix":"// before\nipfs dag export --offline bafy... > out.car\n\n// after\nipfs dag export bafy... > out.car","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := exportCmd()\nvar nf ipld.ErrNotFound\nif errors.As(err, &nf) && offlineRequested {\n    // retry online: run again without --offline\n}","preventionTips":["Verify the full DAG is present locally (pin is complete) before exporting offline.","Use `ipfs dag stat --offline` to confirm block availability.","Avoid gc runs that could remove blocks of DAGs you plan to export offline."],"tags":["offline","block-not-found","dag-export"],"backgroundTag":"block-not-found-offline","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"}