{"record":{"id":"0b515c6032b247e6","repo":"pinpoint-apm/pinpoint","slug":"failed-to-insert-agentinfobo","errorCode":null,"errorMessage":"Failed to insert agentInfoBo","messagePattern":"Failed to insert agentInfoBo","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"otlptrace/otlptrace-collector/src/main/java/com/navercorp/pinpoint/otlp/trace/collector/service/OtlpTraceExportService.java","lineNumber":177,"sourceCode":"                } catch (Exception e) {\n                    insertErrorCount++;\n                    spanChunkInsertErrorCounter.increment();\n                    throttledLogger.warn(\"Failed to insert spanChunkBo\", e);\n                }\n            }\n        }\n\n        int agentInfoErrorCount = 0;\n        for (AgentInfoBo agentInfoBo : otlpTraceMapperData.getAgentInfoBoList()) {\n            if (agentIdCache.getIfPresent(agentInfoBo.getAgentId()) == null) {\n                try {\n                    agentInfoService.insert(agentInfoBo);\n                    applicationIndexV2Service.insert(DEFAULT_SERVICE_UID, agentInfoBo);\n                    agentIdCache.put(agentInfoBo.getAgentId(), Boolean.TRUE);\n                } catch (Exception e) {\n                    agentInfoErrorCount++;\n                    agentInfoInsertErrorCounter.increment();\n                    throttledLogger.warn(\"Failed to insert agentInfoBo\", e);\n                }\n            }\n        }\n\n        if (exceptionMetaDataService != null) {\n            for (ExceptionMetaDataBo exceptionMetaDataBo : otlpTraceMapperData.getExceptionMetaDataBoList()) {\n                try {\n                    exceptionMetaDataService.save(exceptionMetaDataBo);\n                } catch (Exception e) {\n                    exceptionInsertErrorCounter.increment();\n                    throttledLogger.warn(\"Failed to insert exceptionMetaData\", e);\n                }\n            }\n        }\n\n        // Optional statistics side channel: a uriStat failure must not fail the trace export, so it\n        // is not counted toward serverErrorCount (spans are already stored at this point).\n        if (uriStatService != null) {","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/otlptrace/otlptrace-collector/src/main/java/com/navercorp/pinpoint/otlp/trace/collector/service/OtlpTraceExportService.java#L159-L195","documentation":"OtlpTraceExportService.export writes each AgentInfoBo via agentInfoService.insert and applicationIndexV2Service.insert, then caches the agentId; any exception in these HBase writes increments agentInfoErrorCount, bumps agentInfoInsertErrorCounter, and logs this throttled warning. Note the agentId is only cached after success, so failed agents are retried on next export.","triggerScenarios":"agentInfoService.insert(agentInfoBo) or applicationIndexV2Service.insert(DEFAULT_SERVICE_UID, agentInfoBo) throws synchronously during the agentInfo loop of export().","commonSituations":"AgentInfo or application-index HBase tables misconfigured/unavailable; HBase overload from agent storm after mass agent restart; service UID v2 tables not created after upgrade.","solutions":["Check the throttled stack trace to see whether AgentInfo or ApplicationIndexV2 write failed.","Verify both HBase table families exist with correct schema (run pinpoint HBase scripts).","Confirm DEFAULT_SERVICE_UID configuration matches the v2 index expectations.","Retry/resend agent info — the agentId cache skips only successfully inserted agents."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if (agentInfoBo == null || agentInfoBo.getAgentId() == null || agentInfoBo.getApplicationName() == null) {\n    logger.warn(\"Skipping invalid AgentInfoBo: missing agentId/applicationName\");\n    return;\n}","typeGuard":null,"tryCatchPattern":"try {\n    agentInfoService.insert(agentInfoBo);\n    applicationIndexV2Service.insert(DEFAULT_SERVICE_UID, agentInfoBo);\n    agentIdCache.put(agentInfoBo.getAgentId(), Boolean.TRUE);\n} catch (Exception e) {\n    // do NOT put agentId into cache; next export retries naturally\n    agentInfoInsertErrorCounter.increment();\n    logger.warn(\"Failed to insert agentInfoBo for {}\", agentInfoBo.getAgentId(), e);\n}","preventionTips":["Run the pinpoint HBase table creation scripts so AgentInfo and v2 application index tables exist.","Rely on the agentIdCache-on-success pattern so failed inserts are retried on the next export.","Watch agent storms after mass agent restarts and stagger collector load.","Verify DEFAULT_SERVICE_UID configuration matches the v2 index requirements."],"tags":["hbase","agent-info","export-failure"],"backgroundTag":"database-write-failed","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"}