pinpoint-apm/pinpoint · warning

Failed to insert agent. applicationName

Error message

Failed to insert agent. applicationName: {}, agentId: {}

What it means

HbaseOtlpApplicationIndexV2Service.insert wraps all failures from applicationDao.insert and agentIdDao.insert (HBase writes of the application index v2 and agent-id mappings) in a try/catch and logs this warning. It means the agent's application/service-uid index could not be persisted to HBase; the exception is swallowed, so the caller never learns the insert failed.

Solutions

  1. Check HBase connectivity and ZooKeeper/quorum settings in the collector's HBase client configuration.
  2. Verify the v2 application-index and agent-id HBase tables exist and the collector user has write permissions (run table creation/migration scripts).
  3. Inspect the logged stack trace to identify the root cause (IO vs NPE from serviceUidSupplier) and fix the supplier to never return null ServiceUid.
  4. Retry the agent registration; since the log is a swallowed warning, re-send the agent info or verify downstream lookups tolerate the missing index.

Example fix

// before: supplier may return null and NPE is swallowed
ServiceUid serviceUid = serviceUidSupplier.get();
// after: guard before HBase writes
ServiceUid serviceUid = serviceUidSupplier.get();
if (serviceUid == null) {
    logger.warn("Skip agent insert: null serviceUid for {}", agentInfoBo.getApplicationName());
    return;
}
Defensive patterns

Strategy: validation

Validate before calling

ServiceUid serviceUid = serviceUidSupplier.get();
if (serviceUid == null || serviceUid.getUid() == null) {
    throw new IllegalArgumentException("serviceUid supplier returned null; agent insert would fail");
}
if (agentInfoBo == null || agentInfoBo.getApplicationName() == null || agentInfoBo.getAgentId() == null) {
    throw new IllegalArgumentException("agentInfoBo missing required fields for insert");
}

Type guard

boolean isInsertable(AgentInfoBo bo, ServiceUid uid) {
    return bo != null && bo.getAgentId() != null && bo.getApplicationName() != null && uid != null && uid.getUid() != null;
}

Try / catch

try {
    applicationIndexV2Service.insert(serviceUidSupplier, agentInfoBo);
} catch (Exception e) {
    // insert() already swallows exceptions, so this rarely fires;
    // instead check applicationIdDao lookup afterwards to detect silent failure
    logger.error("agent index insert reported failure; verify HBase availability", e);
}

Prevention

When it happens

Trigger: Any exception thrown by serviceUidSupplier.get(), applicationDao.insert(...) or agentIdDao.insert(...) for an AgentInfoBo, e.g. HBase connection failure, table missing, or a null ServiceUid from the supplier.

Common situations: HBase region/thrift server down or unreachable from the collector; missing or misconfigured HBase tables for the v2 application index; NPE from a ServiceUidSupplier that returns null; retried duplicate agent registrations during collector restarts.

Related errors


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

Appendix: source

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

    private final Logger logger = LogManager.getLogger(this.getClass());

    private final ApplicationDao applicationDao;
    private final AgentIdDao agentIdDao;

    public HbaseOtlpApplicationIndexV2Service(ApplicationDao applicationDao,
                                              AgentIdDao agentIdDao) {
        this.applicationDao = Objects.requireNonNull(applicationDao, "ApplicationDao");
        this.agentIdDao = Objects.requireNonNull(agentIdDao, "agentIdDao");
    }

    // TODO get serviceUid from agentInfoBo
    public void insert(ServiceUidSupplier serviceUidSupplier, AgentInfoBo agentInfoBo) {
        try {
            ServiceUid serviceUid = serviceUidSupplier.get();
            applicationDao.insert(serviceUid.getUid(), agentInfoBo.getApplicationName(), agentInfoBo.getServiceTypeCode());
            agentIdDao.insert(serviceUid.getUid(), agentInfoBo);
        } catch (Exception e) {
            logger.warn("Failed to insert agent. applicationName: {}, agentId: {}", agentInfoBo.getApplicationName(), agentInfoBo.getAgentId(), e);
        }
    }
}

View on GitHub (pinned to 744c3d3075)