{"record":{"id":"cf5aed9577fcb745","repo":"ipfs/kubo","slug":"s-currently-offline-perhaps-retry-after-attachi","errorCode":null,"errorMessage":"%s (currently offline, perhaps retry after attaching to the network)","messagePattern":"(.+?) \\(currently offline, perhaps retry after attaching to the network\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/dag/export.go","lineNumber":151,"sourceCode":"\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\n// subtree, is silently skipped: the resulting CAR is partial by design.\n//\n// Errors writing the CAR itself (emit failures) are surfaced: those are\n// output problems, not local-availability problems.","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/dag/export.go#L133-L169","documentation":"Same `ipld.ErrNotFound` handling as the explicit-offline case, but this branch fires when the user did NOT pass `--offline` yet the node is currently offline (`node.IsOnline == false`). Because there is no explicit offline flag, the hint tells the user to attach to the network so missing blocks can be retrieved.","triggerScenarios":"Running `ipfs dag export <cid>` on a node started without a network connection (e.g. `ipfs dag export` against an offline daemon or `--offline`-initialized node context) where a DAG block is absent from the blockstore.","commonSituations":"Daemon started without connectivity (no internet, firewall, swarm disconnected); running the command before the daemon finished bootstrapping; laptop offline while traveling.","solutions":["Check node connectivity with `ipfs swarm peers`; reconnect the daemon to the network.","Wait for bootstrapping/swarm to re-attach, then retry the export.","If the node must stay offline, fetch the missing blocks elsewhere or supply them via a CAR import first.","Inspect the daemon log for connectivity errors (NAT, DHT, bootstrap failures)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"peers, err := run(\"ipfs\", \"swarm\", \"peers\")\nif err != nil || len(strings.Fields(peers)) == 0 {\n    return errors.New(\"node offline: cannot fetch missing DAG blocks\")\n}","typeGuard":null,"tryCatchPattern":"if strings.Contains(err.Error(), \"retry after attaching to the network\") {\n    // wait for swarm connectivity, then retry the export\n}","preventionTips":["Check `ipfs swarm peers` returns connections before exporting.","Ensure the daemon finished bootstrapping after startup.","Monitor connectivity (AutoNAT status) on machines with flaky networks."],"tags":["offline","network","block-not-found","dag-export"],"backgroundTag":"node-offline-block-not-found","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"}