ipfs/kubo · error

aborted: %s

Error message

aborted: %s

What it means

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.

Source

Thrown at core/commands/block.go:348

				}
			}
		}

		return nil
	},
	PostRun: cmds.PostRunMap{
		cmds.CLI: func(res cmds.Response, re cmds.ResponseEmitter) error {
			someFailed := false
			for {
				res, err := res.Next()
				if err == io.EOF {
					break
				} else if err != nil {
					return err
				}
				r := res.(*removedBlock)
				if r.Hash == "" && r.Error != "" {
					return fmt.Errorf("aborted: %s", r.Error)
				} else if r.Error != "" {
					someFailed = true
					fmt.Fprintf(os.Stderr, "cannot remove %s: %s\n", r.Hash, r.Error)
				} else {
					fmt.Fprintf(os.Stdout, "removed %s\n", r.Hash)
				}
			}
			if someFailed {
				return fmt.Errorf("some blocks not removed")
			}
			return nil
		},
	},
	Type: removedBlock{},
}

View on GitHub (pinned to 329838acdf)

Solutions

  1. Read the %s suffix in the message to identify the underlying cause and fix that datastore/repo issue first
  2. Run `ipfs repo fsck` and verify repo permissions and disk space
  3. Retry `ipfs block rm` after fixing the underlying cause, using --force as appropriate
  4. Avoid concurrent daemon access; run block rm against the daemon API instead of offline

Example fix

// before (offline rm against locked repo fails)
ipfs block rm QmHash
// after
ipfs block rm --force QmHash  # or run against a running daemon's API
Defensive patterns

Strategy: try-catch

Validate before calling

null

Type guard

null

Try / catch

if err := runBlockRm(args); err != nil {
    if strings.HasPrefix(err.Error(), "aborted: ") {
        cause := strings.TrimPrefix(err.Error(), "aborted: ")
        // inspect cause: datastore/repo issue; retry after remediation
    }
    return err
}

Prevention

When it happens

Trigger: 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!="".

Common situations: Blockstore backend failures (datastore I/O errors, permission problems), removing blocks locked by another process, or corrupted repo state during `block rm`.

Related errors


AI-assisted analysis of ipfs/kubo@329838acdf (2026-09-03). Data as JSON: /api/errors/bfcea7a65c113872. Report an issue: GitHub.