alibaba/nacos · critical · IllegalArgumentException

invalid PER_TASK_CONFIG_SIZE, expected value type double

Error message

invalid PER_TASK_CONFIG_SIZE, expected value type double

What it means

Thrown by ParamUtil.initPerTaskConfigSize() during static class initialization when the PER_TASK_CONFIG_SIZE property cannot be parsed as a double via Double.parseDouble. The default value is "3000". Like other ParamUtil static init errors, this surfaces as ExceptionInInitializerError and blocks the entire Nacos client from loading.

Source

Thrown at client/src/main/java/com/alibaba/nacos/client/utils/ParamUtil.java:96

        try {
            tmp = NacosClientProperties.PROTOTYPE.getProperty(NACOS_READ_TIMEOUT_KEY,
                DEFAULT_NACOS_READ_TIMEOUT);
            return Integer.parseInt(tmp);
        } catch (NumberFormatException e) {
            final String msg = "[http-client] invalid read timeout:" + tmp;
            LOGGER.error("[settings] " + msg, e);
            throw new IllegalArgumentException(msg, e);
        }
    }
    
    private static double initPerTaskConfigSize() {
        try {
            return Double.parseDouble(
                NacosClientProperties.PROTOTYPE.getProperty(PER_TASK_CONFIG_SIZE_KEY,
                    DEFAULT_PER_TASK_CONFIG_SIZE_KEY));
        } catch (NumberFormatException e) {
            LOGGER.error("[PER_TASK_CONFIG_SIZE] PER_TASK_CONFIG_SIZE invalid", e);
            throw new IllegalArgumentException(
                "invalid PER_TASK_CONFIG_SIZE, expected value type double", e);
        }
    }
    
    public static int getConnectTimeout() {
        return connectTimeout;
    }
    
    public static void setConnectTimeout(int connectTimeout) {
        ParamUtil.connectTimeout = connectTimeout;
    }
    
    public static int getReadTimeout() {
        return readTimeout;
    }
    
    public static void setReadTimeout(int readTimeout) {
        ParamUtil.readTimeout = readTimeout;

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Locate the offending PER_TASK_CONFIG_SIZE value from the exception message embedded in the ExceptionInInitializerError.
  2. Check JVM system properties, environment variables, and nacos-client.properties for PER_TASK_CONFIG_SIZE.
  3. Change the value to a valid decimal number (e.g. 3000 or 3000.0).
  4. Ensure no locale-dependent comma separators are used; use a period as the decimal point.

Example fix

// before
System.setProperty("PER_TASK_CONFIG_SIZE", "3,000");

// after
System.setProperty("PER_TASK_CONFIG_SIZE", "3000");
Defensive patterns

Strategy: validation

Validate before calling

String rawSize = System.getProperty("PER_TASK_CONFIG_SIZE", "3000");
try {
    Double.parseDouble(rawSize);
} catch (NumberFormatException e) {
    throw new IllegalStateException("PER_TASK_CONFIG_SIZE must be a double, got: " + rawSize, e);
}

Prevention

When it happens

Trigger: Setting -DPER_TASK_CONFIG_SIZE to a non-numeric string (e.g. "large", "3.0.0", "3,000"). This property controls the max config payload size processed per single task in the config client.

Common situations: Operators mis-type the property name or value in JVM args or environment variables; locale issues where a comma is used as the decimal separator; values copied from documentation that include units or labels.

Related errors


AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14). Data as JSON: /api/errors/5ab64a28f0cff557. Report an issue: GitHub.