ipfs/kubo · error

committing orphaned keystore cleanup batch: %w

Error message

committing orphaned keystore cleanup batch: %w

What it means

Fired by purgeOrphanedKeystoreData when batch.Commit fails after the purge batch size threshold is reached. The accumulated deletes for orphaned keystore entries could not be persisted, so the pass aborts with the wrapped datastore error.

Source

Thrown at core/node/provider.go:578

			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
		}
	}
	if pending > 0 {
		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)
		}
	}
	if count > 0 {
		providerLog.Infow("purged orphaned provider keystore data from shared datastore", "keys", count)

View on GitHub (pinned to 329838acdf)

Solutions

  1. Restart the daemon; the cleanup re-runs and skips already-deleted keys
  2. Verify disk space and datastore integrity if it repeats
  3. Consult docs/datastores.md for repair guidance
Defensive patterns

Strategy: retry

When it happens

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