[JIRA] (JENKINS-53486) email-ext fails when CasC attempts to set smtpHost
Title: Message Title Oleg Nenashev updated an issue Jenkins / JENKINS-53486 email-ext fails when CasC attempts to set smtpHost Change By: Oleg Nenashev Labels: configuration-as-code jcasc-compatibility Add Comment This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.193954.1536546047000.4403.1568641740737%40Atlassian.JIRA.
[JIRA] (JENKINS-53486) email-ext fails when CasC attempts to set smtpHost
Title: Message Title Robin Smith commented on JENKINS-53486 Re: email-ext fails when CasC attempts to set smtpHost Done - JENKINS-58570 Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.193954.1536546047000.16316.1563529680411%40Atlassian.JIRA. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-53486) email-ext fails when CasC attempts to set smtpHost
Title: Message Title Alex Earl commented on JENKINS-53486 Re: email-ext fails when CasC attempts to set smtpHost Yes, please file a separate issue. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.193954.1536546047000.15462.1563462540269%40Atlassian.JIRA. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-53486) email-ext fails when CasC attempts to set smtpHost
Title: Message Title Robin Smith commented on JENKINS-53486 Re: email-ext fails when CasC attempts to set smtpHost David van Laatum Ben Fiedler happy to raise this as a separate issue, if you prefer Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.193954.1536546047000.1004.1558086480530%40Atlassian.JIRA. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-53486) email-ext fails when CasC attempts to set smtpHost
Title: Message Title Robin Smith edited a comment on JENKINS-53486 Re: email-ext fails when CasC attempts to set smtpHost I think there may still be an issue here. The problem I have happens when I add smtpUsername / smtpPassword configuration fields, to authenticate with an SMTP server. This can be set up 'hands on' in the UI, so using the necessary fields described in the JCasC documentation, I set up something like this:{code:yaml} extendedEmailPublisher: smtpServer: smtp.server.comsmtpUsername: ale...@company.comsmtpPassword: ${SMTPpass}useSsl: truecharset: UTF-8defaultContentType: text/plaindefaultSubject: "Build $BUILD_NUMBER - $BUILD_STATUS"defaultBody: "Check console output at $BUILD_URL"{code}But adding the smtpUsername / smtpPassword fields seems to cause the 'smtpServer' value to be ignored completely (it's not ignored when the smtpUsername / smtpPassword fields are not present). Instead, the 'smtpHost' value from the Mailer plugin configuration is used in its place :-(If anyone stumbles across this page and needs to get SMTP authentication working for the Email Extension plugin, I was able to using this setup:{code:yaml} mailer: smtpHost: smtp.server.comuseSsl: truecharset: UTF-8 extendedEmailPublisher: smtpUsername: ale...@company.comsmtpPassword: ${SMTPpass}defaultContentType: text/plaindefaultSubject: "Build $BUILD_NUMBER - $BUILD_STATUS"defaultBody: "Check console output at $BUILD_URL"{code}It's not ideal that part of the configuration lives in each plugin though! (mailer plugin does not support SMTP auth fields - JENKINS-55109)See also: https://github.com/jenkinsci/configuration-as-code-plugin/issues/772 Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. To view
[JIRA] (JENKINS-53486) email-ext fails when CasC attempts to set smtpHost
Title: Message Title Robin Smith commented on JENKINS-53486 Re: email-ext fails when CasC attempts to set smtpHost I think there may still be an issue here. The problem I have happens when I add smtpUsername / smtpPassword configuration fields, to authenticate with an SMTP server. This can be set up 'hands on' in the UI, so using the necessary fields described in the JCasC documentation, I set up something like this: extendedEmailPublisher: smtpServer: smtp.server.com smtpUsername: ale...@company.com smtpPassword: ${SMTPpass} useSsl: true charset: UTF-8 defaultContentType: text/plain defaultSubject: "Build $BUILD_NUMBER - $BUILD_STATUS" defaultBody: "Check console output at $BUILD_URL" But adding the smtpUsername / smtpPassword fields seems to cause the 'smtpServer' value to be ignored completely (it's not ignored when the smtpUsername / smtpPassword fields are not present). Instead, the 'smtpHost' value from the Mailer plugin configuration is used in its place If anyone stumbles across this page and needs to get SMTP authentication working for the Email Extension plugin, I was able to using this setup: mailer: smtpHost: smtp.server.com useSsl: true charset: UTF-8 extendedEmailPublisher: smtpUsername: ale...@company.com smtpPassword: ${SMTPpass} defaultContentType: text/plain defaultSubject: "Build $BUILD_NUMBER - $BUILD_STATUS" defaultBody: "Check console output at $BUILD_URL" It's not ideal that part of the configuration lives in each plugin though! (mailer plugin does not support SMTP auth fields - JENKINS-55109) See also: https://github.com/jenkinsci/configuration-as-code-plugin/issues/772 Add Comment
[JIRA] (JENKINS-53486) email-ext fails when CasC attempts to set smtpHost
Title: Message Title Ben Fiedler edited a comment on JENKINS-53486 Re: email-ext fails when CasC attempts to set smtpHost Well this is embarrassing. I was sure I had originally tried smtpServer (the name that actually shows up extended descriptor) in jcasc unsuccessfully (getting a generic null error or something similar), but trying again with it just now and it works with no problem.Maybe I accidentally tried it with the mailer plugin , or coincidentally had some other problem with my yaml at the time .I will mark this is closed Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-53486) email-ext fails when CasC attempts to set smtpHost
Title: Message Title Ben Fiedler updated JENKINS-53486 User error Jenkins / JENKINS-53486 email-ext fails when CasC attempts to set smtpHost Change By: Ben Fiedler Status: Open Fixed but Unreleased Resolution: Not A Defect Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-53486) email-ext fails when CasC attempts to set smtpHost
Title: Message Title Ben Fiedler commented on JENKINS-53486 Re: email-ext fails when CasC attempts to set smtpHost Well this is embarrassing. I was sure I had originally tried smtpServer (the name that actually shows up extended descriptor) in jcasc unsuccessfully (getting a generic null error or something similar), but trying again with it just now and it works with no problem. Maybe I accidentally tried it with the mailer plugin. I will mark this is closed Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-53486) email-ext fails when CasC attempts to set smtpHost
Title: Message Title Alex Earl commented on JENKINS-53486 Re: email-ext fails when CasC attempts to set smtpHost Can you try using smtpServer instead? Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-53486) email-ext fails when CasC attempts to set smtpHost
Title: Message Title Ben Fiedler edited a comment on JENKINS-53486 Re: email-ext fails when CasC attempts to set smtpHost You are probably right; these are the fields in the extendedemailpublisher descriptor I have successfully configured using jcasc:charset, defaultBody, defaultContentType, defaultSubject, defaultReplyTo, smtpPort, and watchingEnabled.Oddly the smtpHost is the only value that throws an error. For now, as a workaround I am making a groovyscript and sticking it into jenkins init.groovy.d/ which loads the descriptor and then directly modifies the smtpHost member. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-53486) email-ext fails when CasC attempts to set smtpHost
Title: Message Title Ben Fiedler commented on JENKINS-53486 Re: email-ext fails when CasC attempts to set smtpHost You are probably right; these are the fields in the extendedemailpublisher descriptor I have successfully configured using jcasc: charset, defaultBody, defaultContentType, defaultSubject, defaultReplyTo, smtpPort, and watchingEnabled. Oddly the smtpHost is the only value that throws an error. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-53486) email-ext fails when CasC attempts to set smtpHost
Title: Message Title Alex Earl commented on JENKINS-53486 Re: email-ext fails when CasC attempts to set smtpHost There is a lot of custom JSON reading in the configure method of the descriptor, so I think there are a lot of changes needed in the plugin. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-53486) email-ext fails when CasC attempts to set smtpHost
Title: Message Title Enrico Weigelt commented on JENKINS-53486 Re: email-ext fails when CasC attempts to set smtpHost Did you check whether the setter is also present ? In my case (w/ plugin-mailer) only the getter was missing, but maybe here's the opposite case. IMHO, casc needs both. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-53486) email-ext fails when CasC attempts to set smtpHost
Title: Message Title Ben Fiedler updated an issue Jenkins / JENKINS-53486 email-ext fails when CasC attempts to set smtpHost Change By: Ben Fiedler The descriptor throws an error when you attempt to set a value for smtpHost using jcasc plugin. The error message is identical to [this reported github issue|https://github.com/jenkinsci/configuration-as-code-plugin/issues/501] and subsequently JENKINS-53467 for the Mailer plugin which was fixed by introducing a getSmtpHost() method. It appears the solution for this plugin may not be as trivial however; I noticed a getSmtpHost() method is already present in MailAccount.java . SEVERE: Failed ConfigurationAsCode.initjava.lang.Error: java.lang.reflect.InvocationTargetException at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:110) at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175) at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296) at jenkins.model.Jenkins$5.runTask(Jenkins.java:1068) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104) ... 8 moreCaused by: io.jenkins.plugins.casc.ConfiguratorException: unclassified: error configuring 'unclassified' with class io.jenkins.plugins.casc.impl.configurators.GlobalConfigurationCategoryConfigurator configurator at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:611) at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(ConfigurationAsCode.java:640) at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:627) at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:539) at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:270) at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:262) ... 13 moreCaused by: io.jenkins.plugins.casc.ConfiguratorException: Invalid configuration elements for type class hudson.plugins.emailext.ExtendedEmailPublisherDescriptor : smtpHost at io.jenkins.plugins.casc.BaseConfigurator.handleUnknown(BaseConfigurator.java:355) at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:345) at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:265) at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:330) at
[JIRA] (JENKINS-53486) email-ext fails when CasC attempts to set smtpHost
Title: Message Title Ben Fiedler created an issue Jenkins / JENKINS-53486 email-ext fails when CasC attempts to set smtpHost Issue Type: Bug Assignee: David van Laatum Components: email-ext-plugin Created: 2018-09-10 02:20 Environment: Jenkins lts version 2.121.3 email-ext 2.63 Labels: jcasc-compatibility configuration-as-code Priority: Minor Reporter: Ben Fiedler The descriptor throws an error when you attempt to set a value for smtpHost using jcasc plugin. The error message is identical to this reported github issue and subsequently JENKINS-53467 which was fixed by introducing a getSmtpHost() method. It appears the solution for this plugin may not be as trivial however; I noticed a getSmtpHost() method is already present in MailAccount.java . SEVERE: Failed ConfigurationAsCode.init java.lang.Error: java.lang.reflect.InvocationTargetException at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:110) at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175) at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296) at jenkins.model.Jenkins$5.runTask(Jenkins.java:1068) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at