pinpoint-apm/pinpoint · error · IllegalStateException

Tenant ID is not set

Error message

Tenant ID is not set

What it means

PinotAgentInfoStatisticsService.insert resolves the tenant ID from the configured TenantProvider and hard-fails with IllegalStateException when it returns null, because Pinot-based agent statistics storage is tenant-partitioned and a null tenant cannot be persisted.

Solutions

  1. Set the tenantId property in the collector/web configuration (e.g. config.setTenantId or pinpoint.tenantId in properties) so the TenantProvider returns a value
  2. Verify the active property sources actually load the tenant config file
  3. If single-tenant by design, supply a default tenant id at configuration time

Example fix

// before (application.properties)
# no tenant configured
// after
pinpoint.tenantId=myTenant
Defensive patterns

Strategy: validation

Validate before calling

String tenantId = tenantProvider.getTenantId();
if (tenantId == null) { throw new IllegalStateException("tenantId must be configured before inserting agent statistics"); }

Try / catch

try { service.insert(serviceUid, applicationName, agentInfoBo); } catch (IllegalStateException e) { log.error("tenantId not configured: {}", e.getMessage()); }

Prevention

When it happens

Trigger: insert(serviceUid, applicationName, agentInfoBo) invoked while tenantProvider.getTenantId() returns null — typically when no tenantId is configured in the web/collector properties that back the provider.

Common situations: Deployments migrated to the multi-tenant Pinot setup without adding tenantId to configuration; single-tenant legacy setups where tenant config was simply omitted.

Understand the failure class

Background: "missing required config value" errors: why libraries refuse to start when a configuration key is empty, unset, or blank — this error's family across 48 libraries.

Related errors


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

Appendix: source

Thrown at agent-statistics/agent-statistics-collector/src/main/java/com/navercorp/pinpoint/agentstatistics/collector/service/PinotAgentInfoStatisticsService.java:62

            TenantProvider tenantProvider
    ) {
        this.agentInfoStatisticsDao = Objects.requireNonNull(agentInfoStatisticsDao, "agentInfoStatisticsDao");
        this.tenantProvider = Objects.requireNonNull(tenantProvider, "tenantProvider");
    }

    @Override
    public void insert(
            ServiceUid serviceUid,
            String applicationName,
            AgentInfoBo agentInfoBo
    ) {
        Objects.requireNonNull(serviceUid, "serviceUid");
        Objects.requireNonNull(applicationName, "applicationName");
        Objects.requireNonNull(agentInfoBo, "agentInfoBo");

        final String tenantId = tenantProvider.getTenantId();
        if (tenantId == null) {
            throw new IllegalStateException("Tenant ID is not set");
        }

        agentInfoStatisticsDao.insert(
                null, // TODO: will be replaced with serviceUid
                applicationName,
                agentInfoBo
        );
    }
}

View on GitHub (pinned to 744c3d3075)