{"record":{"id":"330b5a98346cdff9","repo":"alibaba/arthas","slug":"unknown-action","errorCode":null,"errorMessage":"unknown action: {}","messagePattern":"unknown action: (.+?)","errorType":"http","errorClass":"ApiException","httpStatus":200,"severity":"error","filePath":"core/src/main/java/com/taobao/arthas/core/shell/term/impl/http/api/HttpApiHandler.java","lineNumber":127,"sourceCode":"            //return objectMapper.readValue(requestBody, ApiRequest.class);\n            return JSON.parseObject(requestBody, ApiRequest.class);\n        } catch (Exception e) {\n            throw new ApiException(\"parse request failed: \" + e.getMessage(), e);\n        }\n    }\n\n    private ApiResponse processRequest(ChannelHandlerContext ctx, ApiRequest apiRequest) {\n\n        String actionStr = apiRequest.getAction();\n        try {\n            if (StringUtils.isBlank(actionStr)) {\n                throw new ApiException(\"'action' is required\");\n            }\n            ApiAction action;\n            try {\n                action = ApiAction.valueOf(actionStr.trim().toUpperCase());\n            } catch (IllegalArgumentException e) {\n                throw new ApiException(\"unknown action: \" + actionStr);\n            }\n\n            //no session required\n            if (ApiAction.INIT_SESSION.equals(action)) {\n                return processInitSessionRequest(apiRequest);\n            }\n\n            //required session\n            Session session = null;\n            boolean allowNullSession = ApiAction.EXEC.equals(action);\n            String sessionId = apiRequest.getSessionId();\n            if (StringUtils.isBlank(sessionId)) {\n                if (!allowNullSession) {\n                    throw new ApiException(\"'sessionId' is required\");\n                }\n            } else {\n                session = sessionManager.getSession(sessionId);\n                if (session == null) {","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/alibaba/arthas/blob/21cf2e9ba52b305290be7223b980ff504bb9cb5b/core/src/main/java/com/taobao/arthas/core/shell/term/impl/http/api/HttpApiHandler.java#L109-L145","documentation":"Thrown when ApiAction.valueOf() fails because the provided action string (uppercased and trimmed) does not match any ApiAction enum constant. Valid actions are: EXEC, ASYNC_EXEC, INTERRUPT_JOB, PULL_RESULTS, INIT_SESSION, JOIN_SESSION, CLOSE_SESSION, SESSION_INFO.","triggerScenarios":"The action field contains a typo (e.g. 'execute' instead of 'exec'), a deprecated action name, or an entirely fabricated value that is not part of the enum.","commonSituations":"Using the wrong action vocabulary (e.g. 'run' instead of 'exec'). Version mismatch where a client targets actions that don't exist in the deployed Arthas version.","solutions":["Use one of the valid action values: EXEC, ASYNC_EXEC, INTERRUPT_JOB, PULL_RESULTS, INIT_SESSION, JOIN_SESSION, CLOSE_SESSION, SESSION_INFO.","Action matching is case-insensitive (uppercased internally) but spelling must be exact.","Check the Arthas version — older versions may not support all actions."],"exampleFix":"// before\n{\"action\": \"execute\", \"command\": \"version\"}\n// -> unknown action: execute\n\n// after\n{\"action\": \"exec\", \"command\": \"version\"}","handlingStrategy":"validation","validationCode":"// Client-side: validate action against known enum values\nSet<String> valid = EnumSet.allOf(ApiAction.class).stream()\n    .map(Enum::name).collect(Collectors.toSet());\nif (!valid.contains(req.getAction().trim().toUpperCase())) {\n    throw new IllegalArgumentException(\n        \"Invalid action. Valid: \" + valid);\n}","typeGuard":"boolean isValidAction(String action) {\n    try {\n        ApiAction.valueOf(action.trim().toUpperCase());\n        return true;\n    } catch (IllegalArgumentException e) {\n        return false;\n    }\n}","tryCatchPattern":null,"preventionTips":["Use the ApiAction enum constants client-side to avoid typos.","Reference the enum values: EXEC, ASYNC_EXEC, INTERRUPT_JOB, PULL_RESULTS, INIT_SESSION, JOIN_SESSION, CLOSE_SESSION, SESSION_INFO."],"tags":["http-api","action","enum-validation"],"backgroundTag":null,"analyzedSha":"21cf2e9ba52b305290be7223b980ff504bb9cb5b","analyzedAt":"2026-08-14T00:57:07.243Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}