pinpoint-apm/pinpoint · error · IllegalStateException

agentInfoRefreshIntervalMs must be greater than 0

Error message

agentInfoRefreshIntervalMs must be greater than 0

What it means

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.

Source

Thrown at agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/AgentInfoSender.java:247

        public Builder refreshInterval(long refreshIntervalMs) {
            this.refreshIntervalMs = refreshIntervalMs;
            return this;
        }

        public Builder sendInterval(long sendIntervalMs) {
            this.sendIntervalMs = sendIntervalMs;
            return this;
        }

        public Builder maxTryPerAttempt(int maxTryCountPerAttempt) {
            this.maxTryPerAttempt = maxTryCountPerAttempt;
            return this;
        }


        public AgentInfoSender build() {
            if (this.refreshIntervalMs <= 0) {
                throw new IllegalStateException("agentInfoRefreshIntervalMs must be greater than 0");
            }
            if (this.sendIntervalMs <= 0) {
                throw new IllegalStateException("agentInfoSendIntervalMs must be greater than 0");
            }
            if (this.maxTryPerAttempt <= 0) {
                throw new IllegalStateException("maxTryPerAttempt must be greater than 0");
            }
            return new AgentInfoSender(this);
        }
    }
}

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Set profiler.agentInfoRefreshIntervalMs to a positive value (e.g. 300000)
  2. Check config parsing for zero/negative values before building
  3. Use the default value if unsure

Example fix

// before
builder.setAgentInfoRefreshIntervalMs(0).build(); // throws
// after
builder.setAgentInfoRefreshIntervalMs(300000).build();
Defensive patterns

Strategy: validation

Validate before calling

if (refreshIntervalMs <= 0) {
    throw new IllegalArgumentException("agentInfoRefreshIntervalMs must be > 0");
}

Try / catch

try {
    sender = new Builder(jdbcUrl, spiderClient).setAgentInfoRefreshIntervalMs(cfg).build();
} catch (IllegalStateException e) {
    logger.warn("bad agent info config, using defaults", e);
    sender = new Builder(jdbcUrl, spiderClient).build();
}

Prevention

When it happens

Trigger: 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.

Common situations: Typo or zero value for profiler.agentInfoRefreshIntervalMs in pinpoint.config; template variable substitution producing empty/0 values; unit confusion (seconds vs ms).

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07). Data as JSON: /api/errors/539181fdc73cf968. Report an issue: GitHub.