alibaba/arthas · warning · IllegalArgumentException

{optionName} must not be blank.

Error message

{optionName} must not be blank.

What it means

Thrown as IllegalArgumentException by ClassLoaderMetaspaceCommand.parseTimeMillis when the value passed for a time option (optionName) is null or blank (StringUtils.isBlank). parseTimeMillis expects a non-empty duration string with optional ms/s/m suffix and a numeric body.

Source

Thrown at core/src/main/java/com/taobao/arthas/core/command/klass100/ClassLoaderMetaspaceCommand.java:458

                if (blockCompare != 0) {
                    return blockCompare;
                }
                return safeName(o1).compareTo(safeName(o2));
            }
        });
        if (limit == null || sorted.size() <= limit) {
            return sorted;
        }
        return new ArrayList<Row>(sorted.subList(0, limit));
    }

    private static String safeName(Row row) {
        return row.getName() == null ? "" : row.getName();
    }

    static long parseTimeMillis(String value, String optionName) {
        if (StringUtils.isBlank(value)) {
            throw new IllegalArgumentException(optionName + " must not be blank.");
        }

        String text = value.trim().toLowerCase();
        long multiplier = 1;
        if (text.endsWith("ms")) {
            text = text.substring(0, text.length() - 2).trim();
        } else if (text.endsWith("s")) {
            text = text.substring(0, text.length() - 1).trim();
            multiplier = 1000;
        } else if (text.endsWith("m")) {
            text = text.substring(0, text.length() - 1).trim();
            multiplier = 60 * 1000;
        }

        try {
            long millis = Long.parseLong(text) * multiplier;
            if (millis <= 0) {
                throw new IllegalArgumentException(optionName + " must be greater than 0.");

View on GitHub (pinned to 21cf2e9ba5)

Solutions

  1. Supply a concrete duration: e.g. 30s, 5m, 200ms, or a bare number (interpreted as ms).
  2. Omit the option entirely rather than passing blank if you want the default.
  3. Validate the option string before invoking the command.

Example fix

// before
classloader --refresh-interval ''

// after
classloader --refresh-interval 5s
Defensive patterns

Strategy: validation

Validate before calling

if (StringUtils.isBlank(value)) {
    // omit the option or supply a real duration before calling parseTimeMillis
}

Type guard

static boolean hasDurationText(String s) { return s != null && !s.trim().isEmpty(); }

Try / catch

try { long ms = ClassLoaderMetaspaceCommand.parseTimeMillis(value, optionName); } catch (IllegalArgumentException e) { /* prompt user for a non-blank duration */ }

Prevention

When it happens

Trigger: Invoke the classloader command with a time option (e.g. --refresh-interval or similar) given an empty string or omitted-but-supplied-blank value. Any option routed through parseTimeMillis with isBlank value triggers this before unit parsing.

Common situations: User supplies --option '' (empty quotes); a wrapper script passes an unset environment variable that resolves to blank; a UI that submits the field empty.

Related errors


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