pinpoint-apm/pinpoint · info · ResponseStatusException

agent info not found

Error message

agent info not found

What it means

AgentInfoController.getAgentInfo looks up agent info plus lifecycle status for the given agentId at a timestamp. When agentInfoService.findAgentInfoAndStatus returns null, it throws HTTP 404 'agent info not found'.

Source

Thrown at web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/AgentInfoController.java:82

    private final RangeValidator rangeValidator;

    public AgentInfoController(AgentInfoService agentInfoService, AgentEventService agentEventService, ConfigProperties configProperties) {
        this.agentInfoService = Objects.requireNonNull(agentInfoService, "agentInfoService");
        this.agentEventService = Objects.requireNonNull(agentEventService, "agentEventService");
        Objects.requireNonNull(configProperties, "configProperties");
        this.rangeValidator = new ForwardRangeValidator(Duration.ofDays(configProperties.getInspectorPeriodMax()));
    }

    @PreAuthorize("@naverPermissionEvaluator.hasInspectorPermission(#serviceName.getName(), new com.navercorp.pinpoint.common.server.bo.AgentParam(#agentId, #timestamp))")
    @GetMapping(value = "/getAgentInfo")
    public AgentAndStatus getAgentInfo(
            @ServiceParam ServiceName serviceName,
            @RequestParam("agentId") @NotBlank String agentId,
            @RequestParam("timestamp") Timestamp timestamp) {
        AgentAndStatus result = this.agentInfoService.findAgentInfoAndStatus(agentId, timestamp.getEpochMillis());
        if (result == null) {
            throw new ResponseStatusException(HttpStatus.NOT_FOUND, "agent info not found");
        }
        return result;
    }

    @GetMapping(value = "/getDetailedAgentInfo")
    public DetailedAgentAndStatus getDetailedAgentInfo(
            @ServiceParam ServiceName serviceName,
            @RequestParam("agentId") @NotBlank String agentId,
            @RequestParam("timestamp") Timestamp timestamp) {
        DetailedAgentAndStatus result = this.agentInfoService.findDetailedAgentInfoAndStatus(agentId, timestamp.getEpochMillis());
        if (result == null) {
            throw new ResponseStatusException(HttpStatus.NOT_FOUND, "detailed agent info not found");
        }
        return result;
    }

    @GetMapping(value = "/getAgentStatus")
    public AgentStatus getAgentStatus(

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Verify the agentId exists (check the agent list for the application)
  2. Query a timestamp within the agent's actual lifetime
  3. Use /getAgentList or the UI to confirm the agent's exact id and time range

Example fix

// before
AgentAndStatus r = svc.findAgentInfoAndStatus(id, ts);
// after
AgentAndStatus r = svc.findAgentInfoAndStatus(id, ts);
if (r == null) throw new ResponseStatusException(HttpStatus.NOT_FOUND, "agent info not found: " + id); // handled by caller via 404 check
Defensive patterns

Strategy: fallback

Validate before calling

if (agentId == null || agentId.isBlank()) throw new IllegalArgumentException("agentId required");

Try / catch

try { return api.getAgentInfo(id, ts); } catch (ResponseStatusException e) { if (e.getStatus() == HttpStatus.NOT_FOUND) return Optional.empty(); throw e; }

Prevention

When it happens

Trigger: GET /getAgentInfo?agentId=X&timestamp=Y where the agentId never existed, was deleted, or has no data recorded at/around the given timestamp.

Common situations: Typo in agentId; querying a timestamp before the agent first started; agent data purged by TTL/cleanup jobs; querying the wrong cluster.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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