alibaba/arthas · error · IllegalArgumentException

Unsupported action: ${action}

Error message

Unsupported action: ${action}

What it means

validateParameters rejects any action that normalizeAction could not map to a known canonical form (record, list, info, search, replay, delete, deleteall). This is the primary and normally-reachable validation gate for unknown tt actions.

Source

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

                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);
        }
    }

    /**
     * 标准化操作类型
     */
    private String normalizeAction(String action) {
        if (action == null || action.trim().isEmpty()) {
            return "record";
        }

        String normalizedAction = action.trim().toLowerCase();

        switch (normalizedAction) {
            case "record":
            case "r":
            case "-t":
            case "t":

View on GitHub (pinned to 21cf2e9ba5)

Solutions

  1. Use a valid action or its alias: record/t, list/l, info/i, search/s, replay/p, delete/d, deleteAll/da.
  2. Check spelling and casing (the input is lowercased before matching).
  3. If action is omitted entirely it defaults to record, so this error only fires for non-empty unrecognized values.

Example fix

// before
tt(action="watch")
// after
tt(action="record", classPattern="demo.MathGame", methodPattern="*")
Defensive patterns

Strategy: validation

Validate before calling

// Before calling tt, validate action against known values and aliases
Set<String> valid = Set.of("record","t","list","l","info","i","search","s",
    "replay","p","delete","d","deleteall","da");
if (action != null && !action.trim().isEmpty()
        && !valid.contains(action.trim().toLowerCase())) {
    throw new IllegalArgumentException("Unsupported tt action: " + action);
}

Try / catch

try {
    String result = timeTunnel(action, ...);
} catch (IllegalArgumentException e) {
    if (e.getMessage().startsWith("Unsupported action")) {
        // action not recognized — check valid actions in the message
    }
}

Prevention

When it happens

Trigger: Passing an action string (after lowercasing and alias mapping) that does not match any known action or alias. normalizeAction returns unrecognized values as-is, which then falls through to this default case.

Common situations: Typo in the action name; using an unsupported action; passing a flag like '-t' that normalizeAction does map (so it would not hit this), versus a genuinely unknown string.

Related errors


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