ipfs/kubo · error

%s (currently offline, perhaps retry without the offline fla

Error message

%s (currently offline, perhaps retry without the offline flag)

What it means

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.

Source

Thrown at core/commands/dag/export.go:147

			return
		}

	}()

	res.SetEncodingType(cmds.OctetStream)
	res.SetContentType("application/vnd.ipld.car")
	if err := res.Emit(pipeR); err != nil {
		pipeR.Close() // ignore the error if any
		return err
	}

	err = <-errCh

	// minimal user friendliness
	if errors.Is(err, ipld.ErrNotFound{}) {
		explicitOffline, _ := req.Options["offline"].(bool)
		if explicitOffline {
			err = fmt.Errorf("%s (currently offline, perhaps retry without the offline flag)", err)
		} else {
			node, envErr := cmdenv.GetNode(env)
			if envErr == nil && !node.IsOnline {
				err = fmt.Errorf("%s (currently offline, perhaps retry after attaching to the network)", err)
			}
		}
	}

	return err
}

// exportPartialCAR is the best-effort engine behind `dag export --local-only`.
// It walks the DAG rooted at root and writes the visited blocks to w as a
// CARv1 stream.
//
// The walker reads from the raw blockstore directly (not via the kubo
// CoreAPI or DAGService), so it is structurally incapable of triggering a
// network fetch. Any block missing or unreadable locally, plus its entire

View on GitHub (pinned to 329838acdf)

Solutions

  1. Retry without `--offline` so the node can fetch missing blocks from the network.
  2. Bring the missing blocks into the blockstore first (`ipfs get`/`ipfs pin add` while online), then export offline.
  3. Check which blocks are missing with `ipfs dag stat --offline` or verify the pin is complete.

Example fix

// before
ipfs dag export --offline bafy... > out.car

// after
ipfs dag export bafy... > out.car
Defensive patterns

Strategy: retry

Try / catch

err := exportCmd()
var nf ipld.ErrNotFound
if errors.As(err, &nf) && offlineRequested {
    // retry online: run again without --offline
}

Prevention

When it happens

Trigger: 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{}`.

Common situations: 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.

Related errors


AI-assisted analysis of ipfs/kubo@329838acdf (2026-09-03). Data as JSON: /api/errors/bca34b93f2e3e519. Report an issue: GitHub.