{"record":{"id":"1862c6db8d10ca13","repo":"pinpoint-apm/pinpoint","slug":"tenant-id-is-not-set","errorCode":null,"errorMessage":"Tenant ID is not set","messagePattern":"Tenant ID is not set","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"agent-statistics/agent-statistics-collector/src/main/java/com/navercorp/pinpoint/agentstatistics/collector/service/PinotAgentInfoStatisticsService.java","lineNumber":62,"sourceCode":"            TenantProvider tenantProvider\n    ) {\n        this.agentInfoStatisticsDao = Objects.requireNonNull(agentInfoStatisticsDao, \"agentInfoStatisticsDao\");\n        this.tenantProvider = Objects.requireNonNull(tenantProvider, \"tenantProvider\");\n    }\n\n    @Override\n    public void insert(\n            ServiceUid serviceUid,\n            String applicationName,\n            AgentInfoBo agentInfoBo\n    ) {\n        Objects.requireNonNull(serviceUid, \"serviceUid\");\n        Objects.requireNonNull(applicationName, \"applicationName\");\n        Objects.requireNonNull(agentInfoBo, \"agentInfoBo\");\n\n        final String tenantId = tenantProvider.getTenantId();\n        if (tenantId == null) {\n            throw new IllegalStateException(\"Tenant ID is not set\");\n        }\n\n        agentInfoStatisticsDao.insert(\n                null, // TODO: will be replaced with serviceUid\n                applicationName,\n                agentInfoBo\n        );\n    }\n}\n","sourceCodeStart":44,"sourceCodeEnd":72,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-statistics/agent-statistics-collector/src/main/java/com/navercorp/pinpoint/agentstatistics/collector/service/PinotAgentInfoStatisticsService.java#L44-L72","documentation":"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.","triggerScenarios":"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.","commonSituations":"Deployments migrated to the multi-tenant Pinot setup without adding tenantId to configuration; single-tenant legacy setups where tenant config was simply omitted.","solutions":["Set the tenantId property in the collector/web configuration (e.g. config.setTenantId or pinpoint.tenantId in properties) so the TenantProvider returns a value","Verify the active property sources actually load the tenant config file","If single-tenant by design, supply a default tenant id at configuration time"],"exampleFix":"// before (application.properties)\n# no tenant configured\n// after\npinpoint.tenantId=myTenant","handlingStrategy":"validation","validationCode":"String tenantId = tenantProvider.getTenantId();\nif (tenantId == null) { throw new IllegalStateException(\"tenantId must be configured before inserting agent statistics\"); }","typeGuard":null,"tryCatchPattern":"try { service.insert(serviceUid, applicationName, agentInfoBo); } catch (IllegalStateException e) { log.error(\"tenantId not configured: {}\", e.getMessage()); }","preventionTips":["Set tenantId explicitly in collector/web properties when using Pinot statistics","Fail fast at startup if tenantProvider.getTenantId() is null","Add a configuration self-check on boot"],"tags":["java","configuration","tenant"],"backgroundTag":"missing-config-value","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}