ipfs/kubo · error

syncing orphaned keystore cleanup: %w

Error message

syncing orphaned keystore cleanup: %w

What it means

Fired by purgeOrphanedKeystoreData when the post-commit datastore Sync (durability flush of the synced prefix) fails during orphaned keystore cleanup. It wraps the sync error; without a successful sync the deleted entries cannot be guaranteed persisted.

Source

Thrown at core/node/provider.go:581

			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)
	}
	return nil
}

View on GitHub (pinned to 329838acdf)

Solutions

  1. Restart the daemon to retry the sync and remaining cleanup
  2. Check disk health and free space
  3. If persistent, the datastore may need repair (docs/datastores.md)
Defensive patterns

Strategy: retry

When it happens

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