pinpoint-apm/pinpoint · error

Failed to insert spanChunkBo

Error message

Failed to insert spanChunkBo

What it means

OtlpTraceExportService.export iterates all TraceService instances calling insertSpanChunk(spanChunkBo); a synchronous exception while persisting a span chunk (partial spans/spans without a root) increments insertErrorCount and spanChunkInsertErrorCounter and logs this throttled warning. Export proceeds, but the chunk is lost for that sink and counted in serverErrorCount.

Source

Thrown at otlptrace/otlptrace-collector/src/main/java/com/navercorp/pinpoint/otlp/trace/collector/service/OtlpTraceExportService.java:162

            for (TraceService traceService : traceServiceList) {
                try {
                    traceService.insertSpan(spanBo);
                } catch (Exception e) {
                    insertErrorCount++;
                    spanInsertErrorCounter.increment();
                    throttledLogger.warn("Failed to insert spanBo", e);
                }
            }
        }

        for (SpanChunkBo spanChunkBo : otlpTraceMapperData.getSpanChunkBoList()) {
            for (TraceService traceService : traceServiceList) {
                try {
                    traceService.insertSpanChunk(spanChunkBo);
                } catch (Exception e) {
                    insertErrorCount++;
                    spanChunkInsertErrorCounter.increment();
                    throttledLogger.warn("Failed to insert spanChunkBo", e);
                }
            }
        }

        int agentInfoErrorCount = 0;
        for (AgentInfoBo agentInfoBo : otlpTraceMapperData.getAgentInfoBoList()) {
            if (agentIdCache.getIfPresent(agentInfoBo.getAgentId()) == null) {
                try {
                    agentInfoService.insert(agentInfoBo);
                    applicationIndexV2Service.insert(DEFAULT_SERVICE_UID, agentInfoBo);
                    agentIdCache.put(agentInfoBo.getAgentId(), Boolean.TRUE);
                } catch (Exception e) {
                    agentInfoErrorCount++;
                    agentInfoInsertErrorCounter.increment();
                    throttledLogger.warn("Failed to insert agentInfoBo", e);
                }
            }
        }

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Read the throttled stack trace to identify the failing TraceService.
  2. Verify the span chunk HBase table schema and write permissions.
  3. Tune write executor capacity / HBase client buffers for chunk throughput.
  4. Fix or remove the broken trace sink from the collector configuration.
Defensive patterns

Strategy: try-catch

Validate before calling

if (spanChunkBo == null || spanChunkBo.getSpanChunkBoList() == null) {
    logger.warn("Skipping invalid spanChunkBo during export");
    continue;
}

Try / catch

try {
    traceService.insertSpanChunk(spanChunkBo);
} catch (Exception e) {
    spanChunkInsertErrorCounter.increment();
    logger.warn("Failed to insert spanChunkBo via {}", traceService.getClass().getSimpleName(), e);
}

Prevention

When it happens

Trigger: traceService.insertSpanChunk(spanChunkBo) throws for any sink — HBase write error, rejected execution, or invalid chunk data — during export of otlpTraceMapperData.getSpanChunkBoList().

Common situations: SpanChunk HBase table missing or full; collector under load with saturated write executors; failing secondary trace sink after a version upgrade.

Related errors


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