{"record":{"id":"720e5542fcc22a92","repo":"alibaba/nacos","slug":"http-client-invalid-max-retry-times","errorCode":null,"errorMessage":"[http-client] invalid max retry times:{}","messagePattern":"\\[http-client\\] invalid max retry times:(.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/utils/ParamUtil.java","lineNumber":113,"sourceCode":"        try {\n            return Integer.parseInt(readTimeoutStr);\n        } catch (NumberFormatException e) {\n            final String msg = \"[http-client] invalid read timeout:\" + readTimeoutStr;\n            LOGGER.error(\"[settings] {}\", msg, e);\n            throw new IllegalArgumentException(msg, e);\n        }\n    }\n    \n    private static int initMaxRetryTimes() {\n        String maxRetryTimesStr =\n            NacosClientProperties.PROTOTYPE.getProperty(MAINTAINER_CLIENT_MAX_RETRY_TIMES_KEY,\n                String.valueOf(DEFAULT_MAX_RETRY_TIMES));\n        try {\n            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() {","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/utils/ParamUtil.java#L95-L131","documentation":"Thrown by ParamUtil.initMaxRetryTimes as an IllegalArgumentException when the max-retry configuration value cannot be parsed as an integer. The property key is MAINTAINER_CLIENT_MAX_RETRY_TIMES_KEY, defaulting to DEFAULT_MAX_RETRY_TIMES. Runs at class-load time.","triggerScenarios":"Setting the system property or environment variable for MAINTAINER_CLIENT_MAX_RETRY_TIMES_KEY to a non-numeric value. NumberFormatException triggers the logged IllegalArgumentException.","commonSituations":"Properties file or JVM argument contains a non-numeric retry count (e.g. 'three', '5x'). Templated config with an unresolved variable placeholder. Copy-paste error from documentation.","solutions":["Set MAINTAINER_CLIENT_MAX_RETRY_TIMES_KEY to a valid integer (e.g. 3).","Remove the override to fall back to the default retry count.","Audit all configuration sources for non-numeric values in the retry-times property."],"exampleFix":"# before\n-Dnacos.maintainer.client.max.retry.times=5x\n\n# after\n-Dnacos.maintainer.client.max.retry.times=5","handlingStrategy":"validation","validationCode":"String raw = System.getProperty(\"nacos.maintainer.client.max.retry.times\", \"\");\nif (!raw.isEmpty()) {\n    try { Integer.parseInt(raw); } catch (NumberFormatException e) {\n    throw new IllegalArgumentException(\"max.retry.times must be numeric, got: \" + raw);\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Specify retry count as a plain integer with no suffix or multiplier.","Validate numeric config properties at bootstrap before the client initializes.","Use the documented default if you do not need a custom retry count."],"tags":["configuration","maintainer-client","retry","number-format","initialization"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}