{"record":{"id":"90c28b66ea556ec6","repo":"alibaba/arthas","slug":"search-operation-requires-searchexpression-paramet","errorCode":null,"errorMessage":"search operation requires searchExpression parameter","messagePattern":"search operation requires searchExpression parameter","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/com/taobao/arthas/core/mcp/tool/function/monitor200/TimeTunnelTool.java","lineNumber":126,"sourceCode":"                                   Integer index, String searchExpression) {\n        switch (action) {\n            case \"record\":\n                if (classPattern == null || classPattern.trim().isEmpty()) {\n                    throw new IllegalArgumentException(\"classPattern is required for record operation\");\n                }\n                if (methodPattern == null || methodPattern.trim().isEmpty()) {\n                    throw new IllegalArgumentException(\"methodPattern is required for record operation\");\n                }\n                break;\n            case \"info\":\n            case \"replay\":\n                if (index == null) {\n                    throw new IllegalArgumentException(action + \" operation requires index parameter\");\n                }\n                break;\n            case \"search\":\n                if (searchExpression == null || searchExpression.trim().isEmpty()) {\n                    throw new IllegalArgumentException(\"search operation requires searchExpression parameter\");\n                }\n                break;\n            case \"delete\":\n                if (index == null) {\n                    throw new IllegalArgumentException(\"delete operation requires index parameter\");\n                }\n                break;\n            case \"list\":\n            case \"deleteall\":\n                break;\n            default:\n                throw new IllegalArgumentException(\"Unsupported action: \" + action);\n        }\n    }\n\n    /**\n     * 标准化操作类型\n     */","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/alibaba/arthas/blob/21cf2e9ba52b305290be7223b980ff504bb9cb5b/core/src/main/java/com/taobao/arthas/core/mcp/tool/function/monitor200/TimeTunnelTool.java#L108-L144","documentation":"The search action requires searchExpression, an OGNL expression evaluated against each recorded invocation to filter results.","triggerScenarios":"Calling tt with action=search while searchExpression is null or blank.","commonSituations":"User forgets the OGNL filter expression; passes an empty string.","solutions":["Provide a valid OGNL searchExpression (e.g., 'method.name==\"primeFactors\"' or 'params[0]>0').","Use tt(action=\"list\") to see all recordings without filtering."],"exampleFix":"// before\ntt(action=\"search\")\n// after\ntt(action=\"search\", searchExpression='method.name==\"primeFactors\"')","handlingStrategy":"validation","validationCode":"// Before calling tt search, validate searchExpression\nif (\"search\".equals(normalizedAction)\n        && (searchExpression == null || searchExpression.trim().isEmpty())) {\n    throw new IllegalArgumentException(\"searchExpression is required for tt search\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    String result = timeTunnel(action, ..., searchExpression, ...);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"searchExpression\")) {\n        // searchExpression missing for search action\n    }\n}","preventionTips":["Always provide an OGNL searchExpression when using action=search.","Use action=list to see all recordings without a filter expression.","Validate the OGNL expression syntax client-side if possible."],"tags":["tt","required-param","validation","timetunnel","arthas-mcp"],"backgroundTag":null,"analyzedSha":"21cf2e9ba52b305290be7223b980ff504bb9cb5b","analyzedAt":"2026-08-14T00:57:07.243Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}