{"record":{"id":"09e97c51b20ba70a","repo":"pinpoint-apm/pinpoint","slug":"failed-to-insert-exceptionmetadata","errorCode":null,"errorMessage":"Failed to insert exceptionMetaData","messagePattern":"Failed to insert exceptionMetaData","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"otlptrace/otlptrace-collector/src/main/java/com/navercorp/pinpoint/otlp/trace/collector/service/OtlpTraceExportService.java","lineNumber":188,"sourceCode":"                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) {\n            try {\n                uriStatService.store(otlpTraceMapperData.getUriStatSpanList());\n            } catch (Exception e) {\n                uriStatInsertErrorCounter.increment();\n                throttledLogger.warn(\"Failed to insert uriStat\", e);\n            }\n        }\n\n        final int serverErrorCount = insertErrorCount + agentInfoErrorCount;\n        return new OtlpTraceExportResult(clientRejected, serverErrorCount, buildServerMessage(insertErrorCount, agentInfoErrorCount));\n    }","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/otlptrace/otlptrace-collector/src/main/java/com/navercorp/pinpoint/otlp/trace/collector/service/OtlpTraceExportService.java#L170-L206","documentation":"OtlpTraceExportService.export saves each ExceptionMetaDataBo through exceptionMetaDataService.save (when the service is configured); a thrown exception increments exceptionInsertErrorCounter and logs this throttled warning. Unlike span/agentInfo failures this is NOT counted toward serverErrorCount, so the export result still reports success.","triggerScenarios":"exceptionMetaDataService.save(exceptionMetaDataBo) throws for any entry in otlpTraceMapperData.getExceptionMetaDataBoList() during export — only when the exception metadata service bean is configured.","commonSituations":"Exception metadata storage (e.g. Pinot/HBase backend) down or misconfigured; optional service not enabled but still throwing; schema mismatch after upgrade.","solutions":["Check the throttled stack trace for the storage backend root cause.","Verify the exception-metadata backend connectivity and table/collection schema.","If exception metadata is not needed, disable the service bean so the loop is skipped entirely.","Note this failure is not reflected in serverErrorCount — monitor exceptionInsertErrorCounter metrics separately."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (exceptionMetaDataService == null || otlpTraceMapperData.getExceptionMetaDataBoList().isEmpty()) {\n    return; // optional feature disabled or nothing to save\n}","typeGuard":null,"tryCatchPattern":"try {\n    exceptionMetaDataService.save(exceptionMetaDataBo);\n} catch (Exception e) {\n    exceptionInsertErrorCounter.increment();\n    logger.warn(\"Failed to insert exceptionMetaData (non-fatal, not counted in serverErrorCount)\", e);\n}","preventionTips":["Remember this error path does not fail the export — monitor exceptionInsertErrorCounter separately.","Verify the exception metadata backend schema/connectivity when enabling the optional service.","Disable the bean entirely if the feature is unused to avoid the failing loop.","Check backend capacity if exception volume is high after error-heavy deployments."],"tags":["exception-metadata","export-failure","write-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-17T15:17:12.973Z"}