ipfs/kubo · error

creating batch for orphaned keystore cleanup: %w

Error message

creating batch for orphaned keystore cleanup: %w

What it means

Fired by purgeOrphanedKeystoreData when requesting a datastore batch (ds.Batch) fails while preparing to delete orphaned keystore entries left behind after keystore datastore migration/reconfiguration. It wraps the datastore error and aborts the cleanup pass before any deletions.

Source

Thrown at core/node/provider.go:568

	})
	if err != nil {
		return fmt.Errorf("querying orphaned keystore data: %w", err)
	}
	defer results.Close()

	var batch datastore.Batch
	var count, pending int
	for result := range results.Next() {
		if ctx.Err() != nil {
			return ctx.Err()
		}
		if result.Error != nil {
			return fmt.Errorf("iterating orphaned keystore data: %w", result.Error)
		}
		if batch == nil {
			batch, err = ds.Batch(ctx)
			if err != nil {
				return fmt.Errorf("creating batch for orphaned keystore cleanup: %w", err)
			}
		}
		if err := batch.Delete(ctx, datastore.NewKey(result.Key)); err != nil {
			return fmt.Errorf("batch deleting orphaned key %s: %w", result.Key, err)
		}
		count++
		pending++
		if pending >= purgeBatchSize {
			if err := batch.Commit(ctx); err != nil {
				return fmt.Errorf("committing orphaned keystore cleanup batch: %w", err)
			}
			if err := ds.Sync(ctx, syncKey); err != nil {
				return fmt.Errorf("syncing orphaned keystore cleanup: %w", err)
			}
			batch = nil
			pending = 0
		}
	}

View on GitHub (pinned to 329838acdf)

Solutions

  1. Restart the daemon; transient datastore errors (lock contention, I/O hiccup) usually clear
  2. Check datastore health and disk space if it recurs
  3. If the datastore is corrupted, back up the repo and follow recovery steps in docs/datastores.md
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at core/node/provider.go:568 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/ff7e34c072765eb2. Report an issue: GitHub.