{"record":{"id":"bfcea7a65c113872","repo":"ipfs/kubo","slug":"aborted-s","errorCode":null,"errorMessage":"aborted: %s","messagePattern":"aborted: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/block.go","lineNumber":348,"sourceCode":"\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn nil\n\t},\n\tPostRun: cmds.PostRunMap{\n\t\tcmds.CLI: func(res cmds.Response, re cmds.ResponseEmitter) error {\n\t\t\tsomeFailed := false\n\t\t\tfor {\n\t\t\t\tres, err := res.Next()\n\t\t\t\tif err == io.EOF {\n\t\t\t\t\tbreak\n\t\t\t\t} else if err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tr := res.(*removedBlock)\n\t\t\t\tif r.Hash == \"\" && r.Error != \"\" {\n\t\t\t\t\treturn fmt.Errorf(\"aborted: %s\", r.Error)\n\t\t\t\t} else if r.Error != \"\" {\n\t\t\t\t\tsomeFailed = true\n\t\t\t\t\tfmt.Fprintf(os.Stderr, \"cannot remove %s: %s\\n\", r.Hash, r.Error)\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Fprintf(os.Stdout, \"removed %s\\n\", r.Hash)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif someFailed {\n\t\t\t\treturn fmt.Errorf(\"some blocks not removed\")\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t},\n\tType: removedBlock{},\n}\n","sourceCodeStart":330,"sourceCodeEnd":364,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/block.go#L330-L364","documentation":"This error is returned by `ipfs block rm` when the removal of a specific block was aborted server-side. The command iterates over removedBlock results; if a result carries both an empty Hash and a non-empty Error string, the whole operation is treated as aborted and the underlying error message is surfaced via `fmt.Errorf(\"aborted: %s\", r.Error)`. It signals that the block removal run stopped rather than partially failing.","triggerScenarios":"Running `ipfs block rm <cid>` where the underlying blockstore removal returns a fatal/abort-class error for a block, producing a removedBlock with Hash==\"\" and Error!=\"\".","commonSituations":"Blockstore backend failures (datastore I/O errors, permission problems), removing blocks locked by another process, or corrupted repo state during `block rm`.","solutions":["Read the %s suffix in the message to identify the underlying cause and fix that datastore/repo issue first","Run `ipfs repo fsck` and verify repo permissions and disk space","Retry `ipfs block rm` after fixing the underlying cause, using --force as appropriate","Avoid concurrent daemon access; run block rm against the daemon API instead of offline"],"exampleFix":"// before (offline rm against locked repo fails)\nipfs block rm QmHash\n// after\nipfs block rm --force QmHash  # or run against a running daemon's API","handlingStrategy":"try-catch","validationCode":"null","typeGuard":"null","tryCatchPattern":"if err := runBlockRm(args); err != nil {\n    if strings.HasPrefix(err.Error(), \"aborted: \") {\n        cause := strings.TrimPrefix(err.Error(), \"aborted: \")\n        // inspect cause: datastore/repo issue; retry after remediation\n    }\n    return err\n}","preventionTips":["Keep the repo datastore healthy: monitor disk space and permissions","Avoid running offline block operations concurrently with a daemon","Run `ipfs repo fsck` periodically","Check `ipfs repo stat` before bulk removals"],"tags":["cli","blockstore","block-rm"],"backgroundTag":"blockstore-remove-aborted","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"}