{"record":{"id":"c6a23c7ce2e05717","repo":"apache/dolphinscheduler","slug":"110017","errorCode":"110017","errorMessage":"Alert server does not exist","messagePattern":"Alert server does not exist","errorType":"error_code","errorClass":"ServiceException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertPluginInstanceServiceImpl.java","lineNumber":308,"sourceCode":"\n    public Optional<Host> getAlertServerAddress() {\n        List<Server> serverList = registryClient.getServerList(RegistryNodeType.ALERT_SERVER);\n        if (CollectionUtils.isEmpty(serverList)) {\n            return Optional.empty();\n        }\n        Server server = serverList.get(0);\n        return Optional.of(new Host(server.getHost(), server.getPort()));\n    }\n\n    @Override\n    public void testSend(User loginUser, int pluginDefineId, String pluginInstanceParams) {\n        if (!canOperatorPermissions(loginUser, null, AuthorizationType.ALERT_PLUGIN_INSTANCE, ALERT_INSTANCE_CREATE)) {\n            throw new ServiceException(Status.USER_NO_OPERATION_PERM);\n        }\n\n        Optional<Host> alertServerAddressOptional = getAlertServerAddress();\n        if (!alertServerAddressOptional.isPresent()) {\n            throw new ServiceException(Status.ALERT_SERVER_NOT_EXIST);\n        }\n\n        Host alertServerAddress = alertServerAddressOptional.get();\n        AlertTestSendRequest alertTestSendRequest = new AlertTestSendRequest(\n                pluginDefineId,\n                pluginInstanceParams);\n\n        AlertSendResponse alertSendResponse;\n\n        try {\n            alertSendResponse = Clients\n                    .withService(IAlertOperator.class)\n                    .withHost(alertServerAddress.getAddress())\n                    .sendTestAlert(alertTestSendRequest);\n            log.info(\"Send alert to: {} successfully, response: {}\", alertServerAddress, alertSendResponse);\n        } catch (Exception e) {\n            log.error(\"Send alert: {} to: {} failed\", alertTestSendRequest, alertServerAddress, e);\n            throw new ServiceException(Status.ALERT_TEST_SENDING_FAILED, e.getMessage());","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertPluginInstanceServiceImpl.java#L290-L326","documentation":"Thrown by testSend when getAlertServerAddress() returns an empty Optional, i.e., no live Alert server (dolphinscheduler-alert) is registered in the registry. The API cannot deliver the test alert without an alert server host.","triggerScenarios":"Testing an alert channel while the alert server is down, unregistered, or the API server cannot discover it in ZooKeeper/registry.","commonSituations":"Alert service crashed or not started in the cluster; registry connectivity problems; alert server started on a host blocked from the API server's view; version upgrade leaving registry data stale.","solutions":["Start/verify the dolphinscheduler-alert service is running and registered in the registry.","Check the registry (ZooKeeper) nodes for the alert server registration path.","Confirm network connectivity between API server and alert server.","Restart the alert server and re-run the test send."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// before testSend, confirm an alert server is registered\nboolean alertServerUp = registryClient.checkNodeExists(REGISTRY_DOLPHINSCHEDULER_ALERT);\nif (!alertServerUp) throw new IllegalStateException(\"no alert server registered\");","typeGuard":null,"tryCatchPattern":"try { alertPluginInstanceService.testSend(loginUser, pluginDefineId, params); } catch (ServiceException e) { if (e.getCode() == Status.ALERT_SERVER_NOT_EXIST.getCode()) { /* start alert server or retry later */ } throw e; }","preventionTips":["Monitor alert-server liveness in the registry","Add alert-server health checks to deployment pipelines","Ensure registry (ZooKeeper) connectivity from API server","Alert on alert-server process downtime"],"tags":["service-discovery","alert-server"],"backgroundTag":"resource-not-found","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}