pinpoint-apm/pinpoint · warning

Service not found. serviceName

Error message

Service not found. serviceName: {}, applicationName: {}

What it means

AgentLookupServiceImpl.getRecentAgents resolves the Service for the given serviceName to look up recently active agents. If the service does not exist (ServiceNotFoundException), it logs this warning and returns an empty list instead of failing, so callers see 'no recent agents' for unknown services.

Solutions

  1. Verify serviceName matches an entry resolvable by serviceModelResolver (check service registry/config)
  2. Handle the empty list on the caller side as 'unknown service' vs 'no agents' distinctly if needed
  3. Refresh/clear the service cache or re-fetch the service list after creating a new service
  4. Validate the serviceName parameter in the API layer before invoking the lookup

Example fix

// before
List<ClusterKeyAndMetadata> agents = agentLookupService.getRecentAgents(serviceName, applicationName);
if (agents.isEmpty()) { /* no agents */ }
// after
if (!knownServices.contains(serviceName)) {
    throw new IllegalArgumentException("Unknown service: " + serviceName);
}
List<ClusterKeyAndMetadata> agents = agentLookupService.getRecentAgents(serviceName, applicationName);
Defensive patterns

Strategy: fallback

Validate before calling

// verify the service exists before looking up agents
List<Service> services = serviceModelResolver.getAllServices();
boolean known = services.stream().anyMatch(s -> s.getName().equals(serviceName));
if (!known) {
    throw new IllegalArgumentException("Unknown service: " + serviceName);
}

Try / catch

List<ClusterKeyAndMetadata> agents = agentLookupService.getRecentAgents(serviceName, applicationName);
if (agents.isEmpty()) {
    // distinguish unknown service vs no active agents in UI messaging
}

Prevention

When it happens

Trigger: Calling getRecentAgents (directly or via the realtime agent-lookup API) with a serviceName that serviceModelResolver cannot resolve — typically a typo or a service removed from the service registry.

Common situations: Frontend passing a stale or misspelled serviceName; service deleted/renamed in the Pinpoint service configuration; user lacking access to a service that appears not to exist; cache lag after service creation.

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/b6ebe35fdc592201. Report an issue: GitHub.

Appendix: source

Thrown at web/src/main/java/com/navercorp/pinpoint/web/realtime/AgentLookupServiceImpl.java:64

    private final ApplicationAgentListService applicationAgentListService;
    private final ServiceModelResolver serviceModelResolver;
    private final Duration recentness;

    AgentLookupServiceImpl(ApplicationAgentListService applicationAgentListService,
                           ServiceModelResolver serviceModelResolver,
                           Duration recentness) {
        this.applicationAgentListService = Objects.requireNonNull(applicationAgentListService, "applicationAgentListService");
        this.serviceModelResolver = Objects.requireNonNull(serviceModelResolver, "serviceModelResolver");
        this.recentness = Objects.requireNonNullElse(recentness, Duration.ZERO);
    }

    @Override
    public List<ClusterKeyAndMetadata> getRecentAgents(String serviceName, String applicationName) {
        final Service service;
        try {
            service = serviceModelResolver.getService(serviceName);
        } catch (ServiceNotFoundException e) {
            logger.warn("Service not found. serviceName: {}, applicationName: {}", serviceName, applicationName);
            return List.of();
        }

        long now = System.currentTimeMillis();
        long from = now - recentness.toMillis();
        Range between = Range.between(from, now);
        TimeWindow timeWindow = new TimeWindow(between);

        return intoClusterKeyAndMetadataList(service.getServiceName(),
                this.applicationAgentListService.activeStatisticsAgentList(service, applicationName, null,
                        timeWindow,
                        ACTUAL_AGENT_INFO_PREDICATE
                ));
    }

    private static List<ClusterKeyAndMetadata> intoClusterKeyAndMetadataList(String serviceName, List<AgentAndStatus> agentAndStatusList) {
        return agentAndStatusList.stream()
                .map(AgentAndStatus::getAgentInfo)

View on GitHub (pinned to 744c3d3075)