{"record":{"id":"e92dd813a6fd219d","repo":"alibaba/nacos","slug":"http-client-invalid-connect-timeout-e92dd8","errorCode":null,"errorMessage":"[http-client] invalid connect timeout:{}","messagePattern":"\\[http-client\\] invalid connect timeout:(.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/utils/ParamUtil.java","lineNumber":87,"sourceCode":"        \n        maxRetryTimes = initMaxRetryTimes();\n        LOGGER.info(\"[settings] [maintainer-http-client] max retry times:{}\", maxRetryTimes);\n        \n        refreshIntervalMills = initRefreshIntervalMills();\n        LOGGER.info(\"[settings] [maintainer-http-client] auth refresh interval mills:{}\",\n            refreshIntervalMills);\n    }\n    \n    private static int initConnectionTimeout() {\n        String connectTimeoutStr =\n            NacosClientProperties.PROTOTYPE.getProperty(MAINTAINER_CLIENT_CONNECT_TIMEOUT_KEY,\n                DEFAULT_CONNECT_TIMEOUT);\n        try {\n            return Integer.parseInt(connectTimeoutStr);\n        } catch (NumberFormatException e) {\n            final String msg = \"[http-client] invalid connect timeout:\" + connectTimeoutStr;\n            LOGGER.error(\"[settings] {}\", msg, e);\n            throw new IllegalArgumentException(msg, e);\n        }\n    }\n    \n    private static int initReadTimeout() {\n        String readTimeoutStr =\n            NacosClientProperties.PROTOTYPE.getProperty(MAINTAINER_CLIENT_READ_TIMEOUT_KEY,\n                DEFAULT_READ_TIMEOUT);\n        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 =","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/utils/ParamUtil.java#L69-L105","documentation":"Thrown by ParamUtil.initConnectionTimeout as an IllegalArgumentException when the connect-timeout configuration value cannot be parsed as an integer. The property key is MAINTAINER_CLIENT_CONNECT_TIMEOUT_KEY with a default of DEFAULT_CONNECT_TIMEOUT. A non-numeric value (e.g. 'abc', '10s') triggers NumberFormatException, which is logged then re-thrown.","triggerScenarios":"Setting the system property or environment variable for MAINTAINER_CLIENT_CONNECT_TIMEOUT_KEY to a non-numeric string. The static initializer of ParamUtil runs at class load time, so this crashes during client initialization.","commonSituations":"Typo in a properties file (e.g. connect.timeout=10s instead of 1000). Passing a human-readable duration string where a raw integer (milliseconds) is expected. Copy-pasting a config snippet from documentation that used the wrong unit.","solutions":["Set MAINTAINER_CLIENT_CONNECT_TIMEOUT_KEY to a valid integer value in milliseconds (e.g. 1000).","Remove the custom override to fall back to DEFAULT_CONNECT_TIMEOUT.","Check all properties files, JVM -D flags, and environment variables for the connect-timeout key and correct any non-numeric values."],"exampleFix":"# before\n-Dnacos.maintainer.client.connect.timeout=10s\n\n# after\n-Dnacos.maintainer.client.connect.timeout=1000","handlingStrategy":"validation","validationCode":"String raw = System.getProperty(\"nacos.maintainer.client.connect.timeout\", \"\");\nif (!raw.isEmpty()) {\n    try { Integer.parseInt(raw); } catch (NumberFormatException e) {\n    throw new IllegalArgumentException(\"connect.timeout must be a numeric millisecond value, got: \" + raw);\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always specify connect timeout as a raw integer in milliseconds, never with a unit suffix.","Validate all numeric Nacos properties in a config bootstrap step before the client loads.","Document the expected unit (milliseconds) next to each timeout property in your config templates."],"tags":["configuration","maintainer-client","timeout","number-format","initialization"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}