pinpoint-apm/pinpoint · error · IllegalStateException

agentInfoSendIntervalMs must be greater than 0

Error message

agentInfoSendIntervalMs must be greater than 0

What it means

Builder validation in AgentInfoSender.Builder.build: sendIntervalMs was configured as <= 0 (default 0 when Builder.sendInterval was never called or given a non-positive value), so the periodic agent-info sender cannot schedule sends and construction is rejected.

Source

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

        }

        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. Call Builder.sendInterval with a positive millisecond value before build()
  2. Check pinpoint.agent.info.send.interval configuration for a zero/negative setting

Example fix

// before
builder.setAgentInfoSendIntervalMs(-1).build(); // throws
// after
builder.setAgentInfoSendIntervalMs(5000).build();
Defensive patterns

Strategy: validation

Validate before calling

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

Try / catch

try {
    sender = builder.setAgentInfoSendIntervalMs(cfg).build();
} catch (IllegalStateException e) {
    logger.warn("bad sendIntervalMs, falling back to default", e);
    sender = builder.setAgentInfoSendIntervalMs(5000).build();
}

Prevention

When it happens

Trigger: Building AgentInfoSender after calling setAgentInfoSendIntervalMs(0 or negative); usually from profiler.agentInfoSendIntervalMs being zero/negative in the configuration.

Common situations: Misconfigured profiler.agentInfoSendIntervalMs in pinpoint.config; programmatic builder misuse in tests; unit mistakes entering seconds where ms expected.

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/32888b094595aa08. Report an issue: GitHub.