alibaba/nacos · error · IllegalArgumentException

[http-client] invalid auth refresh interval:{}

Error message

[http-client] invalid auth refresh interval:{}

What it means

Thrown by ParamUtil.initRefreshIntervalMills as an IllegalArgumentException when the auth-refresh-interval configuration value cannot be parsed as a long. The property key is MAINTAINER_CLIENT_REFRESH_INTERVAL_MILLS_KEY with a default of DEFAULT_REFRESH_INTERVAL_MILLS. This controls how often the maintainer client refreshes its auth token.

Source

Thrown at maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/utils/ParamUtil.java:127

            return Integer.parseInt(maxRetryTimesStr);
        } catch (NumberFormatException e) {
            final String msg = "[http-client] invalid max retry times:" + maxRetryTimesStr;
            LOGGER.error("[settings] {}", msg, e);
            throw new IllegalArgumentException(msg, e);
        }
    }
    
    private static long initRefreshIntervalMills() {
        String refreshIntervalMillsStr = NacosClientProperties.PROTOTYPE.getProperty(
            MAINTAINER_CLIENT_REFRESH_INTERVAL_MILLS_KEY,
            String.valueOf(DEFAULT_REFRESH_INTERVAL_MILLS));
        try {
            return Long.parseLong(refreshIntervalMillsStr);
        } catch (NumberFormatException e) {
            final String msg =
                "[http-client] invalid auth refresh interval:" + refreshIntervalMillsStr;
            LOGGER.error("[settings] {}", msg, e);
            throw new IllegalArgumentException(msg, 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. Set MAINTAINER_CLIENT_REFRESH_INTERVAL_MILLS_KEY to a valid long in milliseconds (e.g. 5000).
  2. Remove the override to use the default refresh interval.
  3. Audit all config sources for non-numeric values in the refresh-interval property.

Example fix

# before
nacos.maintainer.client.refresh.interval.mills=1m

# after
nacos.maintainer.client.refresh.interval.mills=60000
Defensive patterns

Strategy: validation

Validate before calling

String raw = System.getProperty("nacos.maintainer.client.refresh.interval.mills", "");
if (!raw.isEmpty()) {
    try { Long.parseLong(raw); } catch (NumberFormatException e) {
    throw new IllegalArgumentException("refresh.interval must be a numeric millisecond value, got: " + raw);
    }
}

Prevention

When it happens

Trigger: Setting the system property or environment variable for MAINTAINER_CLIENT_REFRESH_INTERVAL_MILLS_KEY to a non-numeric value (e.g. '1m', 'auto'). NumberFormatException is caught, logged, and re-thrown.

Common situations: Properties file uses a human-readable duration ('1m') instead of a raw millisecond long. Environment variable misconfigured in a container orchestration manifest. Config injection bug leaving a placeholder string.

Related errors


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