{"record":{"id":"539181fdc73cf968","repo":"pinpoint-apm/pinpoint","slug":"agentinforefreshintervalms-must-be-greater-than-0","errorCode":null,"errorMessage":"agentInfoRefreshIntervalMs must be greater than 0","messagePattern":"agentInfoRefreshIntervalMs must be greater than 0","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/AgentInfoSender.java","lineNumber":247,"sourceCode":"        public Builder refreshInterval(long refreshIntervalMs) {\n            this.refreshIntervalMs = refreshIntervalMs;\n            return this;\n        }\n\n        public Builder sendInterval(long sendIntervalMs) {\n            this.sendIntervalMs = sendIntervalMs;\n            return this;\n        }\n\n        public Builder maxTryPerAttempt(int maxTryCountPerAttempt) {\n            this.maxTryPerAttempt = maxTryCountPerAttempt;\n            return this;\n        }\n\n\n        public AgentInfoSender build() {\n            if (this.refreshIntervalMs <= 0) {\n                throw new IllegalStateException(\"agentInfoRefreshIntervalMs must be greater than 0\");\n            }\n            if (this.sendIntervalMs <= 0) {\n                throw new IllegalStateException(\"agentInfoSendIntervalMs must be greater than 0\");\n            }\n            if (this.maxTryPerAttempt <= 0) {\n                throw new IllegalStateException(\"maxTryPerAttempt must be greater than 0\");\n            }\n            return new AgentInfoSender(this);\n        }\n    }\n}","sourceCodeStart":229,"sourceCodeEnd":258,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/AgentInfoSender.java#L229-L258","documentation":"AgentInfoSender.Builder.build() validates configuration before creating the sender and throws IllegalStateException when agentInfoRefreshIntervalMs is <= 0. The agent info refresh period must be a positive duration in milliseconds.","triggerScenarios":"Building an AgentInfoSender via new Builder(...).setAgentInfoRefreshIntervalMs(0 or negative).build(); typically caused by invalid pinpoint.properties values like profiler.agentInfoRefreshIntervalMs<=0 parsed into the builder.","commonSituations":"Typo or zero value for profiler.agentInfoRefreshIntervalMs in pinpoint.config; template variable substitution producing empty/0 values; unit confusion (seconds vs ms).","solutions":["Set profiler.agentInfoRefreshIntervalMs to a positive value (e.g. 300000)","Check config parsing for zero/negative values before building","Use the default value if unsure"],"exampleFix":"// before\nbuilder.setAgentInfoRefreshIntervalMs(0).build(); // throws\n// after\nbuilder.setAgentInfoRefreshIntervalMs(300000).build();","handlingStrategy":"validation","validationCode":"if (refreshIntervalMs <= 0) {\n    throw new IllegalArgumentException(\"agentInfoRefreshIntervalMs must be > 0\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    sender = new Builder(jdbcUrl, spiderClient).setAgentInfoRefreshIntervalMs(cfg).build();\n} catch (IllegalStateException e) {\n    logger.warn(\"bad agent info config, using defaults\", e);\n    sender = new Builder(jdbcUrl, spiderClient).build();\n}","preventionTips":["Validate profiler.agentInfoRefreshIntervalMs > 0 in config loading","Use documented defaults instead of hand-set values","Unit-test config parsing for zero/negative values"],"tags":["config","validation","agent-info","startup"],"backgroundTag":"invalid-config-value","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}