简体   繁体   English

jenkins email-ext 插件的零星问题

[英]sporadic issue with jenkins email-ext plugin

I have email notifications set up in a jenkins pipeline job using email-ext (v2.57.2).我使用 email-ext (v2.57.2) 在 jenkins 管道作业中设置了电子邮件通知。 The emails are sent fine for the first couple of iterations but then after about 4th execution, the following error occurs (and continues happening for all the subsequent runs):电子邮件在前几次迭代中发送良好,但在大约第 4 次执行后,出现以下错误(并且在所有后续运行中继续发生):

> [Pipeline] emailext messageContentType = text/html; charset=UTF-8
> Adding recipients from project recipient list Adding recipients from
> trigger recipient list Successfully created MimeMessage An attempt to
> send an e-mail to empty list of recipients, ignored. Some error
> occured trying to send the email...check the Jenkins log

Not quite sure which Jenkins log to look at...不太确定要查看哪个 Jenkins 日志...

Figured out that it had to do with the use of $class: "RequesterRecipientProvider. When a job runs in a scheduled fashion, this value comes up as null. Only when the job is run manually is it populated.发现它与 $class 的使用有关:“RequesterRecipientProvider。当一个作业以预定的方式运行时,这个值出现为 null。只有当作业手动运行时,它才会被填充。

Ended up switching the Jenkinsfile over to use a jenkins environment variable.最终切换 Jenkinsfile 以使用 jenkins 环境变量。

def emailRecipients = "${env.EMAIL_RECIPIENTS}";
emailext (subject: subject, body: details, to: emailRecipients)

Another potential cause for this issue is having the shallow clone option enabled in the Advanced clone behaviours of a multibranch pipeline job.此问题的另一个潜在原因是在多分支管道作业的高级克隆行为中启用了浅克隆选项。 With this option most if not all of the emailext recipient providers may come up empty, even when a job has been triggered by a commit that broke the build.使用此选项,即使不是所有的emailext收件人提供程序也可能是空的,即使作业是由破坏构建的提交触发的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM