{"record":{"id":"0dc37df2e28e0e59","repo":"ipfs/kubo","slug":"command-disabled-v","errorCode":null,"errorMessage":"command disabled: %v","messagePattern":"command disabled: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/ipfs/kubo/start.go","lineNumber":260,"sourceCode":"func apiAddrOption(req *cmds.Request) (ma.Multiaddr, error) {\n\tapiAddrStr, apiSpecified := req.Options[corecmds.ApiOption].(string)\n\tif !apiSpecified {\n\t\treturn nil, nil\n\t}\n\treturn ma.NewMultiaddr(apiAddrStr)\n}\n\n// encodedAbsolutePathVersion is the version from which the absolute path header in\n// multipart requests is %-encoded. Before this version, its sent raw.\nvar encodedAbsolutePathVersion = semver.MustParse(\"0.23.0-dev\")\n\nfunc makeExecutor(req *cmds.Request, env any) (cmds.Executor, error) {\n\texe := tracingWrappedExecutor{cmds.NewExecutor(req.Root)}\n\tcctx := env.(*oldcmds.Context)\n\n\t// Check if the command is disabled.\n\tif req.Command.NoLocal && req.Command.NoRemote {\n\t\treturn nil, fmt.Errorf(\"command disabled: %v\", req.Path)\n\t}\n\n\t// Can we just run this locally?\n\tif !req.Command.NoLocal {\n\t\tif doesNotUseRepo, ok := corecmds.GetDoesNotUseRepo(req.Command.Extra); doesNotUseRepo && ok {\n\t\t\treturn exe, nil\n\t\t}\n\t}\n\n\t// Get the API option from the commandline.\n\tapiAddr, err := apiAddrOption(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Require that the command be run on the daemon when the API flag is\n\t// passed (unless we're trying to _run_ the daemon).\n\tdaemonRequested := apiAddr != nil && req.Command != daemonCmd","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/cmd/ipfs/kubo/start.go#L242-L278","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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.","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.","Upgrade/downgrade kubo: if the command worked before, its NoLocal/NoRemote flags likely changed between versions; compare the command definition across releases."],"exampleFix":"// before (command definition)\nCommand: &cmds.Command{ NoLocal: true, NoRemote: true, ... }\n// after\nCommand: &cmds.Command{ NoLocal: true, NoRemote: false, Run: daemonRun, ... }","handlingStrategy":"validation","validationCode":"cmd := root.Find(req.Path)\nif cmd != nil && cmd.NoLocal && cmd.NoRemote {\n    return fmt.Errorf(\"%s is not runnable in this kubo build\", strings.Join(req.Path, \" \"))\n}","typeGuard":"func isCommandRunnable(cmd *cmds.Command) bool {\n    return !(cmd.NoLocal && cmd.NoRemote)\n}","tryCatchPattern":null,"preventionTips":["Check `ipfs <cmd> --help` availability before scripting around a command.","When embedding kubo's command tree, grep core/commands/ for NoLocal/NoRemote flags of the commands you expose.","Pin kubo versions in deployment scripts; review command-definition changes between versions.","Wrap CLI calls in a helper that maps 'command disabled' to a clear ops message."],"tags":["cli","kubo","command-configuration"],"backgroundTag":"command-disabled","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"}