{"record":{"id":"8d1bc0b1eb9ce291","repo":"ipfs/kubo","slug":"syncing-orphaned-keystore-cleanup-w","errorCode":null,"errorMessage":"syncing orphaned keystore cleanup: %w","messagePattern":"syncing orphaned keystore cleanup: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/node/provider.go","lineNumber":581,"sourceCode":"\t\t\treturn fmt.Errorf(\"iterating orphaned keystore data: %w\", result.Error)\n\t\t}\n\t\tif batch == nil {\n\t\t\tbatch, err = ds.Batch(ctx)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"creating batch for orphaned keystore cleanup: %w\", err)\n\t\t\t}\n\t\t}\n\t\tif err := batch.Delete(ctx, datastore.NewKey(result.Key)); err != nil {\n\t\t\treturn fmt.Errorf(\"batch deleting orphaned key %s: %w\", result.Key, err)\n\t\t}\n\t\tcount++\n\t\tpending++\n\t\tif pending >= purgeBatchSize {\n\t\t\tif err := batch.Commit(ctx); err != nil {\n\t\t\t\treturn fmt.Errorf(\"committing orphaned keystore cleanup batch: %w\", err)\n\t\t\t}\n\t\t\tif err := ds.Sync(ctx, syncKey); err != nil {\n\t\t\t\treturn fmt.Errorf(\"syncing orphaned keystore cleanup: %w\", err)\n\t\t\t}\n\t\t\tbatch = nil\n\t\t\tpending = 0\n\t\t}\n\t}\n\tif pending > 0 {\n\t\tif err := batch.Commit(ctx); err != nil {\n\t\t\treturn fmt.Errorf(\"committing orphaned keystore cleanup batch: %w\", err)\n\t\t}\n\t\tif err := ds.Sync(ctx, syncKey); err != nil {\n\t\t\treturn fmt.Errorf(\"syncing orphaned keystore cleanup: %w\", err)\n\t\t}\n\t}\n\tif count > 0 {\n\t\tproviderLog.Infow(\"purged orphaned provider keystore data from shared datastore\", \"keys\", count)\n\t}\n\treturn nil\n}","sourceCodeStart":563,"sourceCodeEnd":599,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/node/provider.go#L563-L599","documentation":"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.","triggerScenarios":"Thrown at core/node/provider.go:581 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Restart the daemon to retry the sync and remaining cleanup","Check disk health and free space","If persistent, the datastore may need repair (docs/datastores.md)"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"329838acdfafae224582930457efe80aa217afc0","analyzedAt":"2026-09-03T18:30:52.135Z","contentChangedAt":"2026-09-03T18:30:52.135Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}