[JIRA] [workflow-plugin] (JENKINS-29170) [Mail step] Snippet generator generates invalid code

15 views
Skip to first unread message

cleclerc@cloudbees.com (JIRA)

unread,
Jul 1, 2015, 2:42:01 PM7/1/15
to jenkinsc...@googlegroups.com
Cyrille Le Clerc created an issue
 
Jenkins / Bug JENKINS-29170
[Mail step] Snippet generator generates invalid code
Issue Type: Bug Bug
Assignee: Jesse Glick
Components: workflow-plugin
Created: 01/Jul/15 6:41 PM
Environment: org.jenkins-ci.main:jenkins-war:1.609.1
org.jenkins-ci.plugins.workflow:workflow-aggregator:1.8
Priority: Minor Minor
Reporter: Cyrille Le Clerc

The snippet generator generates an invalid syntax: mimeType: '' causes javax.mail.internet.ParseException: Expected MIME type, got instead of defaulting to text/plain.

mail bcc: '', body: 'ready to deploy my-app?', cc: '', charset: '', from: '', mimeType: '', replyTo: '', subject: 'ready to deploy my-app?', to: 'm...@example.com'
javax.mail.internet.ParseException: Expected MIME type, got ;
	at javax.mail.internet.ContentType.<init>(ContentType.java:95)
	at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1322)
	at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1021)
	at javax.mail.internet.MimeMultipart.updateHeaders(MimeMultipart.java:419)
	at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1345)
	at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:2106)
	at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:2074)
	at javax.mail.Transport.send(Transport.java:123)
	at org.jenkinsci.plugins.workflow.steps.MailStep$MailStepExecution.run(MailStep.java:113)
	at org.jenkinsci.plugins.workflow.steps.MailStep$MailStepExecution.run(MailStep.java:100)
	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:34)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:136)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:98)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:15)
	at WorkflowScript.run(WorkflowScript:13)
	at Unknown.Unknown(Unknown)
	at ___cps.transform___(Native Method)
	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:69)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:106)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:79)
	at sun.reflect.GeneratedMethodAccessor314.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
	at sun.reflect.GeneratedMethodAccessor319.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
	at com.cloudbees.groovy.cps.Next.step(Next.java:58)
	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:145)
	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:164)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:271)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:71)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:180)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:178)
	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

jglick@cloudbees.com (JIRA)

unread,
Aug 12, 2015, 8:01:07 AM8/12/15
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Aug 12, 2015, 8:01:08 AM8/12/15
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Aug 12, 2015, 8:02:02 AM8/12/15
to jenkinsc...@googlegroups.com
Jesse Glick commented on Bug JENKINS-29170
 
Re: [Mail step] Snippet generator generates invalid code

Probably failing to default to use Util.fixEmpty.

anyone.can.test@gmail.com (JIRA)

unread,
May 27, 2016, 7:43:01 AM5/27/16
to jenkinsc...@googlegroups.com

I had the same problems.
I just change to use emailext, instead of mail.
It works.

owood@cloudbees.com (JIRA)

unread,
Jul 7, 2016, 8:47:02 PM7/7/16
to jenkinsc...@googlegroups.com

Cyrille Le Clerc

Remove:

  • mimeType = ''
  • charset = ''

to allow the mailer to use the defaults.

Example:

mail bcc: '', body: 'ready to deploy my-app?', cc: '', from: '', replyTo: '', subject: 'ready to deploy my-app?', to: 'm...@example.com'
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

owood@cloudbees.com (JIRA)

unread,
Jul 7, 2016, 8:47:03 PM7/7/16
to jenkinsc...@googlegroups.com
Owen Wood closed an issue as Not A Defect
 

Not a defect IMO

Change By: Owen Wood
Status: Open Closed
Resolution: Not A Defect

owood@cloudbees.com (JIRA)

unread,
Jul 7, 2016, 8:54:01 PM7/7/16
to jenkinsc...@googlegroups.com
Owen Wood reopened an issue
 

Re-opening as this is an issue with the snippet generator, not the plugin. My bad

Change By: Owen Wood
Resolution: Not A Defect
Status: Closed Reopened

owood@cloudbees.com (JIRA)

unread,
Jul 7, 2016, 8:55:01 PM7/7/16
to jenkinsc...@googlegroups.com
Owen Wood updated an issue
Change By: Owen Wood
Comment: Not a defect IMO

owood@cloudbees.com (JIRA)

unread,
Jul 7, 2016, 8:55:02 PM7/7/16
to jenkinsc...@googlegroups.com
Owen Wood updated an issue
Change By: Owen Wood
Comment:
Re-opening as this is an issue with the snippet generator, not the plugin. My bad

owood@cloudbees.com (JIRA)

unread,
Jul 7, 2016, 8:58:02 PM7/7/16
to jenkinsc...@googlegroups.com
Owen Wood edited a comment on Bug JENKINS-29170
 
Re: [Mail step] Snippet generator generates invalid code
[~cleclerc] As a workaround.

Remove:

* {{mimeType = ''}}
* {{charset = ''}}


to allow the mailer to use the defaults.

Example:

{code}

mail bcc: '', body: 'ready to deploy my-app?', cc: '', from: '', replyTo: '', subject: 'ready to deploy my-app?', to: 'm...@example.com'
{code}

owood@cloudbees.com (JIRA)

unread,
Jul 7, 2016, 10:31:01 PM7/7/16
to jenkinsc...@googlegroups.com
Owen Wood assigned an issue to Owen Wood
 
Change By: Owen Wood
Assignee: Jesse Glick Owen Wood

owood@cloudbees.com (JIRA)

unread,
Jul 7, 2016, 10:36:01 PM7/7/16
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Jul 8, 2016, 12:03:02 AM7/8/16
to jenkinsc...@googlegroups.com
Jesse Glick started work on Bug JENKINS-29170
 
Change By: Jesse Glick
Status: Open In Progress

jglick@cloudbees.com (JIRA)

unread,
Jul 8, 2016, 12:03:02 AM7/8/16
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Jul 11, 2016, 11:08:01 AM7/11/16
to jenkinsc...@googlegroups.com
Jesse Glick resolved as Fixed
Change By: Jesse Glick
Status: In Progress Resolved
Resolution: Fixed
Reply all
Reply to author
Forward
0 new messages