ipfs/kubo · error

command disabled: %v

Error message

command disabled: %v

What it means

Kubo CLI resolves each command's executor before running it. If a command is declared with both NoLocal and NoRemote set, it can neither run in-process nor be forwarded to the daemon, so makeExecutor refuses it outright with 'command disabled: <path>'. This is a command-definition/configuration guard, not a runtime failure of the command itself.

Source

Thrown at cmd/ipfs/kubo/start.go:260

func apiAddrOption(req *cmds.Request) (ma.Multiaddr, error) {
	apiAddrStr, apiSpecified := req.Options[corecmds.ApiOption].(string)
	if !apiSpecified {
		return nil, nil
	}
	return ma.NewMultiaddr(apiAddrStr)
}

// encodedAbsolutePathVersion is the version from which the absolute path header in
// multipart requests is %-encoded. Before this version, its sent raw.
var encodedAbsolutePathVersion = semver.MustParse("0.23.0-dev")

func makeExecutor(req *cmds.Request, env any) (cmds.Executor, error) {
	exe := tracingWrappedExecutor{cmds.NewExecutor(req.Root)}
	cctx := env.(*oldcmds.Context)

	// Check if the command is disabled.
	if req.Command.NoLocal && req.Command.NoRemote {
		return nil, fmt.Errorf("command disabled: %v", req.Path)
	}

	// Can we just run this locally?
	if !req.Command.NoLocal {
		if doesNotUseRepo, ok := corecmds.GetDoesNotUseRepo(req.Command.Extra); doesNotUseRepo && ok {
			return exe, nil
		}
	}

	// Get the API option from the commandline.
	apiAddr, err := apiAddrOption(req)
	if err != nil {
		return nil, err
	}

	// Require that the command be run on the daemon when the API flag is
	// passed (unless we're trying to _run_ the daemon).
	daemonRequested := apiAddr != nil && req.Command != daemonCmd

View on GitHub (pinned to 329838acdf)

Solutions

  1. Run a different command: the invoked command is deliberately not runnable from the CLI in either mode; check `ipfs <cmd> --help` and the command definitions in core/commands/ for alternatives.
  2. If you maintain a fork or plugin, remove either the NoLocal or NoRemote flag on the command definition so at least one execution path is allowed.
  3. Upgrade/downgrade kubo: if the command worked before, its NoLocal/NoRemote flags likely changed between versions; compare the command definition across releases.

Example fix

// before (command definition)
Command: &cmds.Command{ NoLocal: true, NoRemote: true, ... }
// after
Command: &cmds.Command{ NoLocal: true, NoRemote: false, Run: daemonRun, ... }
Defensive patterns

Strategy: validation

Validate before calling

cmd := root.Find(req.Path)
if cmd != nil && cmd.NoLocal && cmd.NoRemote {
    return fmt.Errorf("%s is not runnable in this kubo build", strings.Join(req.Path, " "))
}

Type guard

func isCommandRunnable(cmd *cmds.Command) bool {
    return !(cmd.NoLocal && cmd.NoRemote)
}

Prevention

When it happens

Trigger: Invoking any ipfs subcommand whose Command struct has both NoLocal=true and NoRemote=true in core/commands; this fires unconditionally before any repo, API-file, or network work, regardless of flags like --api.

Common situations: Running a command that was intentionally marked client-and-daemon-incompatible (e.g. certain low-level or internal commands); hitting it via scripts or plugins after a version change re-classified a command; embedding kubo's command tree in a custom binary and invoking such a command programmatically.

Related errors


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