{"record":{"id":"ed3b7b885b68e44c","repo":"alibaba/nacos","slug":"http-client-invalid-auth-refresh-interval","errorCode":null,"errorMessage":"[http-client] invalid auth refresh interval:{}","messagePattern":"\\[http-client\\] invalid auth refresh interval:(.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/utils/ParamUtil.java","lineNumber":127,"sourceCode":"            return Integer.parseInt(maxRetryTimesStr);\n        } catch (NumberFormatException e) {\n            final String msg = \"[http-client] invalid max retry times:\" + maxRetryTimesStr;\n            LOGGER.error(\"[settings] {}\", msg, e);\n            throw new IllegalArgumentException(msg, e);\n        }\n    }\n    \n    private static long initRefreshIntervalMills() {\n        String refreshIntervalMillsStr = NacosClientProperties.PROTOTYPE.getProperty(\n            MAINTAINER_CLIENT_REFRESH_INTERVAL_MILLS_KEY,\n            String.valueOf(DEFAULT_REFRESH_INTERVAL_MILLS));\n        try {\n            return Long.parseLong(refreshIntervalMillsStr);\n        } catch (NumberFormatException e) {\n            final String msg =\n                \"[http-client] invalid auth refresh interval:\" + refreshIntervalMillsStr;\n            LOGGER.error(\"[settings] {}\", msg, e);\n            throw new IllegalArgumentException(msg, e);\n        }\n    }\n    \n    public static int getConnectTimeout() {\n        return connectTimeout;\n    }\n    \n    public static void setConnectTimeout(int connectTimeout) {\n        ParamUtil.connectTimeout = connectTimeout;\n    }\n    \n    public static int getReadTimeout() {\n        return readTimeout;\n    }\n    \n    public static void setReadTimeout(int readTimeout) {\n        ParamUtil.readTimeout = readTimeout;\n    }","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/utils/ParamUtil.java#L109-L145","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Set MAINTAINER_CLIENT_REFRESH_INTERVAL_MILLS_KEY to a valid long in milliseconds (e.g. 5000).","Remove the override to use the default refresh interval.","Audit all config sources for non-numeric values in the refresh-interval property."],"exampleFix":"# before\nnacos.maintainer.client.refresh.interval.mills=1m\n\n# after\nnacos.maintainer.client.refresh.interval.mills=60000","handlingStrategy":"validation","validationCode":"String raw = System.getProperty(\"nacos.maintainer.client.refresh.interval.mills\", \"\");\nif (!raw.isEmpty()) {\n    try { Long.parseLong(raw); } catch (NumberFormatException e) {\n    throw new IllegalArgumentException(\"refresh.interval must be a numeric millisecond value, got: \" + raw);\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Specify the auth refresh interval as a raw long in milliseconds.","Validate all duration-typed properties as numeric at startup.","Avoid human-readable duration strings (e.g. '5m') in Nacos client properties."],"tags":["configuration","maintainer-client","auth","number-format","initialization"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}