Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-16863

After upgrade to 1.502, hudson.tasks.Mailer.UserProperty is unresolvable

    XMLWordPrintable

Details

    Description

      Looked for this in JIRA for a bit and found https://issues.jenkins-ci.org/browse/JENKINS-16862 which is close to the issue I'm seeing, but not sure if really a dupe.

      After upgrade to 1.502, hudson.tasks.Mailer.UserProperty is unresolvable in a groovy script which emails the user (LDAP) who kicked off the job.

      Stack dump is:

      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      /mnt/cns/DeviceMgmt/jenkins/scripts/JenkinsEmailer.groovy: 50: unable to resolve class hudson.tasks.Mailer.UserProperty
      @ line 50, column 37.
      if (userProp instanceof hudson.tasks.Mailer.UserProperty)
      ^

      1 error

      at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:302)
      at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:858)
      at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:548)
      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:497)
      at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:306)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:283)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:267)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:197)
      at groovy.lang.GroovyClassLoader$parseClass.call(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
      at Script1.run(Script1.groovy:11)
      at groovy.lang.GroovyShell.evaluate(GroovyShell.java:580)
      at groovy.lang.GroovyShell.evaluate(GroovyShell.java:618)
      at groovy.lang.GroovyShell.evaluate(GroovyShell.java:589)
      at groovy.lang.Script.evaluate(Script.java:208)
      at groovy.lang.Script$evaluate.callCurrent(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
      at Script1.run(Script1.groovy:14)
      at groovy.lang.GroovyShell.evaluate(GroovyShell.java:580)
      at groovy.lang.GroovyShell.evaluate(GroovyShell.java:618)
      at groovy.lang.GroovyShell.evaluate(GroovyShell.java:589)
      at org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder.perform(GroovyPostbuildRecorder.java:276)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:814)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:786)
      at hudson.model.Build$BuildExecution.post2(Build.java:183)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:733)
      at hudson.model.Run.execute(Run.java:1593)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:237)

      Attachments

        Issue Links

          Activity

            jglick Jesse Glick added a comment -

            Unrelated to JENKINS-16862 I think.

            jglick Jesse Glick added a comment - Unrelated to JENKINS-16862 I think.
            slide_o_mix Alex Earl added a comment -

            Probably need to make sure that the Mailer plugin is installed and enabled.

            slide_o_mix Alex Earl added a comment - Probably need to make sure that the Mailer plugin is installed and enabled.
            brian3791 Brian Brooks added a comment -

            I'm encountering the same issue with 1.512. Is the problem a master JVM vs. slave JVM issue, similar to the Groovy Plugin's System Groovy script vs. groovy script difference?...

            "Groovy Script vs System Groovy Script
            The plain "Groovy Script" is run in a forked JVM, on the slave where the build is run. It's the basically the same as running the "groovy" command and pass in the script.

            The system groovy script, OTOH, runs inside the Hudson master's JVM. Thus it will have access to all the internal objects of Hudson, so you can use this to alter the state of Hudson. It is similar to the Jenkins Script Console functionality."
            https://wiki.jenkins-ci.org/display/JENKINS/Groovy+plugin

            brian3791 Brian Brooks added a comment - I'm encountering the same issue with 1.512. Is the problem a master JVM vs. slave JVM issue, similar to the Groovy Plugin's System Groovy script vs. groovy script difference?... "Groovy Script vs System Groovy Script The plain "Groovy Script" is run in a forked JVM, on the slave where the build is run. It's the basically the same as running the "groovy" command and pass in the script. The system groovy script, OTOH, runs inside the Hudson master's JVM. Thus it will have access to all the internal objects of Hudson, so you can use this to alter the state of Hudson. It is similar to the Jenkins Script Console functionality." https://wiki.jenkins-ci.org/display/JENKINS/Groovy+plugin
            slide_o_mix Alex Earl added a comment -

            Did you make sure that the Mailer plugin is installed and enabled?

            slide_o_mix Alex Earl added a comment - Did you make sure that the Mailer plugin is installed and enabled?
            brian3791 Brian Brooks added a comment - - edited

            Attached screenshot showing proof that Mailer plugin 1.4 is installed and enabled.

            brian3791 Brian Brooks added a comment - - edited Attached screenshot showing proof that Mailer plugin 1.4 is installed and enabled.
            brian3791 Brian Brooks added a comment -

            Here's what the failure looks like in our environment...
            Groovy script failed:
            groovy.lang.MissingPropertyException: No such property: hudson for class: SonarReports
            at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)
            at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)
            at SonarReports.sendSuccessMail(SonarReports.groovy:158)
            at SonarReports$sendSuccessMail.callCurrent(Unknown Source)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:153)
            at SonarReports.doSuccess(SonarReports.groovy:192)
            at SonarReports$doSuccess.callCurrent(Unknown Source)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:153)
            at SonarReports.run(SonarReports.groovy:224)
            at groovy.lang.GroovyShell.evaluate(GroovyShell.java:580)
            at groovy.lang.GroovyShell.evaluate(GroovyShell.java:627)
            at groovy.lang.GroovyShell$evaluate.call(Unknown Source)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
            at Script1.run(Script1.groovy:4)
            at groovy.lang.GroovyShell.evaluate(GroovyShell.java:580)
            at groovy.lang.GroovyShell.evaluate(GroovyShell.java:618)
            at groovy.lang.GroovyShell.evaluate(GroovyShell.java:589)
            at org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder.perform(GroovyPostbuildRecorder.java:276)
            at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
            at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:802)
            at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:774)
            at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:949)
            at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:724)
            at hudson.model.Run.execute(Run.java:1600)
            at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477)
            at hudson.model.ResourceController.execute(ResourceController.java:88)
            at hudson.model.Executor.run(Executor.java:237)

            brian3791 Brian Brooks added a comment - Here's what the failure looks like in our environment... Groovy script failed: groovy.lang.MissingPropertyException: No such property: hudson for class: SonarReports at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50) at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231) at SonarReports.sendSuccessMail(SonarReports.groovy:158) at SonarReports$sendSuccessMail.callCurrent(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:153) at SonarReports.doSuccess(SonarReports.groovy:192) at SonarReports$doSuccess.callCurrent(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:153) at SonarReports.run(SonarReports.groovy:224) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:580) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:627) at groovy.lang.GroovyShell$evaluate.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at Script1.run(Script1.groovy:4) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:580) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:618) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:589) at org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder.perform(GroovyPostbuildRecorder.java:276) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:802) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:774) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:949) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:724) at hudson.model.Run.execute(Run.java:1600) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:237)
            slide_o_mix Alex Earl added a comment -

            Can you post your groovy script? This looks like a different failure than described in this issue.

            slide_o_mix Alex Earl added a comment - Can you post your groovy script? This looks like a different failure than described in this issue.
            brian3791 Brian Brooks added a comment - - edited

            Attaching the SonarReports.groovy script run by the Groovy Post-Build action plugin (https://wiki.jenkins-ci.org/display/JENKINS/Groovy+Postbuild+Plugin). Execution of this script fails when line # 158 is executed

            mailSession = hudson.tasks.Mailer.descriptor().createSession()

            brian3791 Brian Brooks added a comment - - edited Attaching the SonarReports.groovy script run by the Groovy Post-Build action plugin ( https://wiki.jenkins-ci.org/display/JENKINS/Groovy+Postbuild+Plugin ). Execution of this script fails when line # 158 is executed mailSession = hudson.tasks.Mailer.descriptor().createSession()
            brian3791 Brian Brooks added a comment - - edited

            A fix for this groovy post-build defect might be similar to the fix JENKINS-6068 applied for the Groovy plugin defect JENKINS-14154.

            At least JENKINS-6068 suggests a possible workaround that involves doing something like
            Class.forName("hudson.tasks.Mailer", true, manager.hudson.getPluginManager().uberClassLoader)

            Where the manager.hudson identifier in the "manager.hudson.getPluginManager().uberClassLoader" part is the hudson instance owned by the manager variable. The groovy post-build action plugin binds this variable for script use.

            brian3791 Brian Brooks added a comment - - edited A fix for this groovy post-build defect might be similar to the fix JENKINS-6068 applied for the Groovy plugin defect JENKINS-14154 . At least JENKINS-6068 suggests a possible workaround that involves doing something like Class.forName("hudson.tasks.Mailer", true, manager.hudson.getPluginManager().uberClassLoader) Where the manager.hudson identifier in the "manager.hudson.getPluginManager().uberClassLoader" part is the hudson instance owned by the manager variable. The groovy post-build action plugin binds this variable for script use.
            brian3791 Brian Brooks added a comment -

            After applying the uberClassLoader workaround, the Groovy post-build action script succeeds.

            brian3791 Brian Brooks added a comment - After applying the uberClassLoader workaround, the Groovy post-build action script succeeds.
            ikedam ikedam added a comment -

            The same root cause to JENKINS-14154.

            ikedam ikedam added a comment - The same root cause to JENKINS-14154 .

            People

              wolfs Stefan Wolf
              fuckyoupieceofshit fuck you
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: