{"record":{"id":"719e5be815f9e0b8","repo":"alibaba/arthas","slug":"command-not-found","errorCode":null,"errorMessage":"{}: command not found","messagePattern":"(.+?): command not found","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/com/taobao/arthas/core/shell/system/impl/JobControllerImpl.java","lineNumber":158,"sourceCode":"     * @param commandManager command manager\n     * @param jobId job id\n     * @param term term\n     * @param resultDistributor\n     * @return the created process\n     */\n    private Process createProcess(Session session, List<CliToken> line, InternalCommandManager commandManager, int jobId, Term term, ResultDistributor resultDistributor) {\n        try {\n            ListIterator<CliToken> tokens = line.listIterator();\n            while (tokens.hasNext()) {\n                CliToken token = tokens.next();\n                if (token.isText()) {\n                    // check before create process\n                    checkPermission(session, token);\n                    Command command = commandManager.getCommand(token.value());\n                    if (command != null) {\n                        return createCommandProcess(command, tokens, jobId, term, resultDistributor);\n                    } else {\n                        throw new IllegalArgumentException(token.value() + \": command not found\");\n                    }\n                }\n            }\n            throw new IllegalArgumentException();\n        } catch (Exception e) {\n            throw new RuntimeException(e);\n        }\n    }\n\n    private boolean runInBackground(List<CliToken> tokens) {\n        boolean runInBackground = false;\n        CliToken last = TokenUtils.findLastTextToken(tokens);\n        if (last != null && \"&\".equals(last.value())) {\n            runInBackground = true;\n            tokens.remove(last);\n        }\n        return runInBackground;\n    }","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/alibaba/arthas/blob/21cf2e9ba52b305290be7223b980ff504bb9cb5b/core/src/main/java/com/taobao/arthas/core/shell/system/impl/JobControllerImpl.java#L140-L176","documentation":"Thrown in createProcess when the first text token in a command line does not match any registered Command in the InternalCommandManager. The token is treated as a command name, and if no resolver provides it, Arthas reports it as unknown.","triggerScenarios":"Typing a misspelled command (e.g. 'trce' instead of 'trace'), using a command that requires a plugin/external-command jar that is not on the classpath, or piping where the first segment is not a real command.","commonSituations":"Typos in interactive sessions. Expecting a command from an external-command module that was not installed. Version differences where a command was renamed or removed.","solutions":["Run 'help' to list all available commands and confirm the exact spelling.","If using an external command, ensure its jar is in ARTHAS_HOME/lib or loaded via --external-command.","Check the Arthas version — some commands (e.g. profiler, jfr) need a recent version or specific modules."],"exampleFix":"// before\n$ trce com.example.Service hello\n// -> trce: command not found\n\n// after\n$ trace com.example.Service hello","handlingStrategy":"validation","validationCode":"// Verify command exists before creating a job\nCommand cmd = commandManager.getCommand(tokenValue);\nif (cmd == null) {\n    // show available commands via help\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run 'help' to discover available commands and exact spellings.","Install external-command jars if a command comes from a plugin.","Keep Arthas updated so command names match documentation."],"tags":["command","user-input","shell"],"backgroundTag":null,"analyzedSha":"21cf2e9ba52b305290be7223b980ff504bb9cb5b","analyzedAt":"2026-08-14T00:57:07.243Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}