{"record":{"id":"4a3f31ec7181cdfe","repo":"apache/dolphinscheduler","slug":"receivers-must-not-be-null","errorCode":null,"errorMessage":"receivers must not be null","messagePattern":"receivers must not be null","errorType":"exception","errorClass":"AlertEmailException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailSender.java","lineNumber":86,"sourceCode":"    private final String mailProtocol = \"SMTP\";\n    private final String mailSmtpHost;\n    private final String mailSmtpPort;\n    private final String mailSenderEmail;\n    private final String enableSmtpAuth;\n    private final String mailUser;\n    private final String mailPasswd;\n    private final String mailUseStartTLS;\n    private final String mailUseSSL;\n    private final String sslTrust;\n    private final String showType;\n    private final AlertTemplate alertTemplate;\n    private final String mustNotNull = \" must not be null\";\n    private String xlsFilePath;\n\n    MailSender(Map<String, String> config) {\n        String receiversConfig = config.get(MailParamsConstants.NAME_PLUGIN_DEFAULT_EMAIL_RECEIVERS);\n        if (receiversConfig == null || \"\".equals(receiversConfig)) {\n            throw new AlertEmailException(MailParamsConstants.NAME_PLUGIN_DEFAULT_EMAIL_RECEIVERS + mustNotNull);\n        }\n\n        receivers = Arrays.asList(receiversConfig.split(\",\"));\n\n        String receiverCcsConfig = config.get(MailParamsConstants.NAME_PLUGIN_DEFAULT_EMAIL_RECEIVERCCS);\n\n        receiverCcs = new ArrayList<>();\n        if (receiverCcsConfig != null && !\"\".equals(receiverCcsConfig)) {\n            receiverCcs.addAll(Arrays.asList(receiverCcsConfig.split(\",\")));\n        }\n\n        mailSmtpHost = config.get(MailParamsConstants.NAME_MAIL_SMTP_HOST);\n        requireNonNull(mailSmtpHost, MailParamsConstants.NAME_MAIL_SMTP_HOST + mustNotNull);\n\n        mailSmtpPort = config.get(MailParamsConstants.NAME_MAIL_SMTP_PORT);\n        requireNonNull(mailSmtpPort, MailParamsConstants.NAME_MAIL_SMTP_PORT + mustNotNull);\n\n        mailSenderEmail = config.get(MailParamsConstants.NAME_MAIL_SENDER);","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailSender.java#L68-L104","documentation":"The MailSender constructor requires the configuration key PLUGIN_DEFAULT_EMAIL_RECEIVERS. If it is absent or an empty string, it throws AlertEmailException('receivers must not be null') during alert plugin initialization.","triggerScenarios":"Creating MailSender with a config map lacking 'receivers' or with 'receivers' set to ''.","commonSituations":"Email alert instance created in the UI without filling the Receivers field; alert parameters JSON missing the receivers key after an upgrade or manual edit.","solutions":["Open the email alert instance settings in DolphinScheduler and set the Receivers field (comma-separated addresses).","Ensure the alert plugin params JSON contains PLUGIN_DEFAULT_EMAIL_RECEIVERS with a non-empty value.","Re-create the alert instance if the parameter was lost during upgrade."],"exampleFix":"// before\n{\"xlsx.file.path\":\"/tmp/xls\", \"mail.protocol\":\"SMTP\"} // no receivers\n// after\n{\"xlsx.file.path\":\"/tmp/xls\", \"receivers\":\"ops@example.com,dev@example.com\"}","handlingStrategy":"validation","validationCode":"java.util.Map<String,String> cfg = ...;\nObject r = cfg.get(\"receivers\");\nif (r == null || r.toString().trim().isEmpty()) throw new IllegalArgumentException(\"receivers required\");","typeGuard":null,"tryCatchPattern":"try { new MailSender(config); } catch (AlertEmailException e) { /* prompt user to fill receivers */ }","preventionTips":["Fill the Receivers field when creating email alert instances in the UI","Validate alert params JSON before saving","Re-check alert instance params after upgrades"],"tags":["configuration","email","missing-parameter"],"backgroundTag":"missing-required-config-field","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}