ipfs/kubo · error

getting repo config: %w

Error message

getting repo config: %w

What it means

Fired during fx wiring of the sweeping DHT provider when reading the repo configuration (in.Repo.Config()) fails. The config is needed to determine the reprovide interval and datastore spec for the resettable keystore; a failure here aborts node construction with the wrapped error.

Source

Thrown at core/node/provider.go:621

	// noScheduleMode is true when the user disabled the periodic reprovide
	// schedule (Provide.DHT.Interval=0). In this mode the keystore is
	// inert: kad-dht's burst-only path (ProvideOnce, StartProviding) does
	// not Put or Delete keys, and no reprovide loop runs to read them.
	noScheduleMode := reprovideInterval == 0
	type providerInput struct {
		fx.In
		DHT  routing.Routing `name:"dhtc"`
		Repo repo.Repo
		Lc   fx.Lifecycle
	}
	sweepingReprovider := fx.Provide(func(in providerInput) (DHTProvider, *keystore.ResettableKeystore, error) {
		ds := namespace.Wrap(in.Repo.Datastore(), providerDatastoreKey)

		// Get repo path and config to determine datastore type
		repoPath := in.Repo.Path()
		repoCfg, err := in.Repo.Config()
		if err != nil {
			return nil, nil, fmt.Errorf("getting repo config: %w", err)
		}

		// Find the root datastore type (levelds, pebbleds, etc.)
		rootSpec := findRootDatastoreSpec(repoCfg.Datastore.Spec)

		// Keystore datastores live at <repo>/{KeystoreDatastorePath}/<suffix>
		keystoreBasePath := filepath.Join(repoPath, KeystoreDatastorePath)

		createDs := func(suffix string) (datastore.Batching, error) {
			if err := validateKeystoreSuffix(suffix); err != nil {
				return nil, err
			}
			// In-memory datastore in no-schedule mode (keystore is inert)
			// or when no datastore spec is configured (test/mock repos).
			if noScheduleMode || rootSpec == nil {
				return datastore.NewMapDatastore(), nil
			}
			if err := os.MkdirAll(keystoreBasePath, 0o755); err != nil {

View on GitHub (pinned to 329838acdf)

Solutions

  1. Check the error chain for the underlying cause
  2. Verify $IPFS_PATH/config exists and is valid JSON
  3. Fix permissions on the repo directory or re-init the repo if it is beyond repair
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at core/node/provider.go:621 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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