alibaba/arthas · error · IllegalArgumentException

${action} operation requires index parameter

Error message

${action} operation requires index parameter

What it means

Both the info and replay actions require an index parameter referencing a specific TimeTunnel recording entry (the index shown by tt list). Without it Arthas cannot know which recorded invocation to inspect or replay.

Source

Thrown at core/src/main/java/com/taobao/arthas/core/mcp/tool/function/monitor200/TimeTunnelTool.java:121

    /**
     * 验证参数
     */
    private void validateParameters(String action, String classPattern, String methodPattern, 
                                   Integer index, String searchExpression) {
        switch (action) {
            case "record":
                if (classPattern == null || classPattern.trim().isEmpty()) {
                    throw new IllegalArgumentException("classPattern is required for record operation");
                }
                if (methodPattern == null || methodPattern.trim().isEmpty()) {
                    throw new IllegalArgumentException("methodPattern is required for record operation");
                }
                break;
            case "info":
            case "replay":
                if (index == null) {
                    throw new IllegalArgumentException(action + " operation requires index parameter");
                }
                break;
            case "search":
                if (searchExpression == null || searchExpression.trim().isEmpty()) {
                    throw new IllegalArgumentException("search operation requires searchExpression parameter");
                }
                break;
            case "delete":
                if (index == null) {
                    throw new IllegalArgumentException("delete operation requires index parameter");
                }
                break;
            case "list":
            case "deleteall":
                break;
            default:
                throw new IllegalArgumentException("Unsupported action: " + action);
        }

View on GitHub (pinned to 21cf2e9ba5)

Solutions

  1. Run tt(action="list") first to see recorded entries and their indices.
  2. Pass the integer index shown in the list output.
  3. Ensure the index still exists (it may have been deleted).

Example fix

// before
tt(action="info")
// after
// first: tt(action="list") to find index 1000
tt(action="info", index=1000)
Defensive patterns

Strategy: validation

Validate before calling

// Before calling tt info/replay, validate index
if (("info".equals(normalizedAction) || "replay".equals(normalizedAction))
        && index == null) {
    throw new IllegalArgumentException("index is required for tt " + normalizedAction);
}

Try / catch

try {
    String result = timeTunnel(action, ..., index, ...);
} catch (IllegalArgumentException e) {
    if (e.getMessage().contains("index parameter")) {
        // index missing for info or replay — run tt list first to find it
    }
}

Prevention

When it happens

Trigger: Calling tt with action=info or action=replay while index is null. The same message is used for both actions, with the action name interpolated.

Common situations: User forgets to run tt list first to discover available indices; MCP client omits the index field.

Related errors


AI-assisted analysis of alibaba/arthas@21cf2e9ba5 (2026-08-14). Data as JSON: /api/errors/a688207a0a64f2a7. Report an issue: GitHub.