{"record":{"id":"6195ced9a43a4002","repo":"pinpoint-apm/pinpoint","slug":"agent-list-is-empty-for-application","errorCode":null,"errorMessage":"agent list is empty for application:{}","messagePattern":"agent list is empty for application:(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"web/src/main/java/com/navercorp/pinpoint/web/agentlist/service/AgentsServiceImpl.java","lineNumber":67,"sourceCode":"        this.hyperLinkFactory = Objects.requireNonNull(hyperLinkFactory, \"hyperLinkFactory\");\n    }\n\n\n    @Override\n    public List<AgentStatusAndLink> getAgentsByApplicationName(\n            Application application,\n            TimeWindow timeWindow,\n            ApplicationAgentListQueryRule applicationAgentListQueryRule,\n            AgentInfoFilter agentInfoPredicate\n    ) {\n        Objects.requireNonNull(application, \"application\");\n        Objects.requireNonNull(timeWindow, \"timeWindow\");\n        Objects.requireNonNull(applicationAgentListQueryRule, \"applicationAgentListQueryRule\");\n        Objects.requireNonNull(agentInfoPredicate, \"agentInfoPredicate\");\n\n        List<AgentAndStatus> agentInfoAndStatuses = getActivateAgentInfoList(application, timeWindow, applicationAgentListQueryRule, agentInfoPredicate);\n        if (agentInfoAndStatuses.isEmpty()) {\n            logger.warn(\"agent list is empty for application:{}\", application);\n        }\n\n        return AgentsFactory.addLinks(\n                hyperLinkFactory,\n                agentInfoAndStatuses\n        );\n    }\n\n    private List<AgentAndStatus> getActivateAgentInfoList(\n            Application application,\n            TimeWindow timeWindow,\n            ApplicationAgentListQueryRule applicationAgentListQueryRule,\n            AgentInfoFilter agentInfoFilter\n    ) {\n        final Service service = application.getService();\n        final String applicationName = application.getApplicationName();\n        final ServiceType serviceType = application.getServiceType();\n        final Range windowRange = timeWindow.getWindowRange();","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/web/src/main/java/com/navercorp/pinpoint/web/agentlist/service/AgentsServiceImpl.java#L49-L85","documentation":"AgentsServiceImpl.getAgentsByApplicationName collects active agent info for an application over a time window; if the resulting list is empty it logs this warning before returning. It is not a thrown exception: the call still succeeds and returns an (empty) Agents result with links attached. The warning flags that no matching agent data existed for the given application/timeWindow/query rule/predicate combination.","triggerScenarios":"Calling getAgentsByApplicationName(application, timeWindow, applicationAgentListQueryRule, agentInfoPredicate) when getActivateAgentInfoList returns zero AgentAndStatus entries — e.g. no agents were active in the time window, the application name has no recorded agent life cycles, or the query rule/predicate filters out every candidate agent.","commonSituations":"Querying an application name with a typo; asking for a time window before the app was deployed or after it was decommissioned; overly strict agentInfoPredicate filtering out agents; stale/empty agent-info (HBase) tables; front-end charts requesting data for a just-created application.","solutions":["Verify the application name exactly matches a name registered in agent info (check the application list endpoint or HBase AgentInfo table).","Widen the time window so it covers a period when the application's agents were actually running.","Inspect the applicationAgentListQueryRule and agentInfoPredicate; relax filters that exclude all agents.","Check that the collector is ingesting agent data (agent start, collector logs) if all applications appear empty.","If emptiness is expected, treat the warning as informational and handle the empty result in the caller."],"exampleFix":"// before\nList<AgentAndStatus> agents = agentsService.getAgentsByApplicationName(app, range);\nrender(agents);\n// after\nList<AgentAndStatus> agents = agentsService.getAgentsByApplicationName(app, range);\nif (agents.isEmpty()) {\n    logger.info(\"no agents found for {} in {}; check name and time range\", app, range);\n}\nrender(agents);","handlingStrategy":"validation","validationCode":"// pre-check on the caller side\nif (application == null || application.isBlank()) throw new IllegalArgumentException(\"application required\");\n// optionally query agent life-cycle for the window first\nboolean anyActive = agentsService.getApplicationAgents(application, timeWindow).stream().anyMatch(a -> a.getStatus().isRunning());\nif (!anyActive) logger.info(\"skip agent list for {}: none active in window\", application);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the application name against the registered application list before querying.","Always pass a time window that covers known deployment periods.","Keep query rules/predicates permissive enough to include at least running agents.","Handle empty results explicitly in UI code instead of assuming agents exist."],"tags":["empty-result","agent-monitoring","apm"],"backgroundTag":"empty-result-set","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}