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

Error when building a Maven project on a swarm node

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • swarm-plugin
    • Jenkins ver. 2.19.1
      Maven 3.3.9
      Swarm plugin 3.3

      Building a Maven project on a node managed by the swarm plugin generates the stack trace at the bottom of this description.

      The part of most interest appears to be this line:

      Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm) of the current c    lass, org/slf4j/LoggerFactory, and the class loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm) for resolved class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type LoggerFactory; used in the signature
      

      I noticed that this commit - f3a9b57cdeb986703f8cefc49b0c208f5e846efc - introduced org.slf4j.jcl-over-slf4j:1.7.22, whereas Maven itself uses version 1.7.5 (https://github.com/apache/maven/blob/maven-3.3.9/pom.xml#L65)

      The Maven plugin lists that package as an exclusion, presumably because of the fragility they mention and because it's provided from elsewhere: https://github.com/jenkinsci/maven-plugin/blob/9807ed59d2f4c15c17485589fca5dd0d5fde3741/pom.xml#L393-L396

      Note that non-Maven builds work just fine.

      $ java -Xmx1024m -cp /var/lib/jenkins/maven32-agent.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.2.2/boot/plexus-classworlds-2.5.1.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.2.2/conf/logging jenkins.maven3.agent.Maven32Main /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.2.2 /usr/local/bin/swarm-plugin.jar /var/lib/jenkins/maven32-interceptor.jar /var/lib/jenkins/maven3-interceptor-commons.jar 38918
      <===[JENKINS REMOTING CAPACITY]===>channel started
      ERROR: Failed to parse POMs
      java.io.IOException: Remote call on Channel to Maven [java, -Xmx1024m, -cp, /var/lib/jenkins/maven32-agent.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.2.2/boot/plexus-classworlds-2.5.1.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.2.2/conf/logging, jenkins.maven3.agent.Maven32Main, /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.2.2, /usr/local/bin/swarm-plugin.jar, /var/lib/jenkins/maven32-interceptor.jar, /var/lib/jenkins/maven3-interceptor-commons.jar, 38918] failed
      	at hudson.remoting.Channel.call(Channel.java:805)
      	at hudson.maven.ProcessCache$MavenProcess.call(ProcessCache.java:161)
      	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:873)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
      	at hudson.model.Run.execute(Run.java:1720)
      	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:544)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:404)
      Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm) for resolved class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type LoggerFactory; used in the signature
      	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:306)
      	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276)
      	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:288)
      	at hudson.maven.Maven3Builder$MavenExecutionListener.<init>(Maven3Builder.java:343)
      	at hudson.maven.Maven3Builder$JenkinsEventSpy.<init>(Maven3Builder.java:195)
      	at hudson.maven.Maven3Builder.call(Maven3Builder.java:113)
      	at hudson.maven.Maven3Builder.call(Maven3Builder.java:68)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:153)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:50)
      	at hudson.remoting.Request$2.run(Request.java:336)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:745)
      	at ......remote call to Channel to Maven [java, -Xmx1024m, -cp, /var/lib/jenkins/maven32-agent.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.2.2/boot/plexus-classworlds-2.5.1.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.2.2/conf/logging, jenkins.maven3.agent.Maven32Main, /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.2.2, /usr/local/bin/swarm-plugin.jar, /var/lib/jenkins/maven32-interceptor.jar, /var/lib/jenkins/maven3-interceptor-commons.jar, 38918](Native Method)
      	at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1433)
      	at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
      	at hudson.remoting.Channel.call(Channel.java:797)
      	... 7 more
      channel stopped
      

          [JENKINS-42098] Error when building a Maven project on a swarm node

          Oleg Nenashev added a comment -

          grahamlyons gregoirew When we do the security releases, we release *only* the security fixes. I've thougth mindjiver is going to release 3.6 after that, but seem's no. I will spin the release now

          Oleg Nenashev added a comment - grahamlyons gregoirew When we do the security releases, we release * only * the security fixes. I've thougth mindjiver is going to release 3.6 after that, but seem's no. I will spin the release now

          Oleg Nenashev added a comment -

          I have released 3.6 several minutes ago. Please check it

          Oleg Nenashev added a comment - I have released 3.6 several minutes ago. Please check it

          Arnold Robert Turdean added a comment - - edited

          The 3.6 contains the fix for this issue?

          Arnold Robert Turdean added a comment - - edited The 3.6 contains the fix for this issue?

          Oleg Nenashev added a comment -

          The fix has been released in Swarm Plugin/Client 3.6. Please reopen if you still see any issue.

          Oleg Nenashev added a comment - The fix has been released in Swarm Plugin/Client 3.6. Please reopen if you still see any issue.

          Great, today or tomorrow we will test it, thank you so much!

          Arnold Robert Turdean added a comment - Great, today or tomorrow we will test it, thank you so much!

          Lukas Elsner added a comment -

          Sweet, thanks for the update
          gregoirew I am evaluating Plugins like ECS-Plugin for AWS to replace our in-house developed docker-scaling daemon for Jenkins Slaves. Swarm client is really cool. Unfortunately breaking changes like this maven bug creates a lot of pain in Enterprise businesses like ours. I would love to continue using it, though.

          Cheers
          Lukas

          Lukas Elsner added a comment - Sweet, thanks for the update gregoirew I am evaluating Plugins like ECS-Plugin for AWS to replace our in-house developed docker-scaling daemon for Jenkins Slaves. Swarm client is really cool. Unfortunately breaking changes like this maven bug creates a lot of pain in Enterprise businesses like ours. I would love to continue using it, though. Cheers Lukas

          Oleg Nenashev added a comment -

          mindrunner, as always, any contributions will be appreciated I joined this plugin as a co-maintainer (I maintain Remoting now, and this plugin is frequently on my radars), but I do not have capacity to really work on stabilizing the plugin. Though I will be happy to review and deliver pull requests.

          Oleg Nenashev added a comment - mindrunner , as always, any contributions will be appreciated I joined this plugin as a co-maintainer (I maintain Remoting now, and this plugin is frequently on my radars), but I do not have capacity to really work on stabilizing the plugin. Though I will be happy to review and deliver pull requests.

          Lukas Elsner added a comment -

          oleg_nenashev Cool, I was actually thinking of that. Does swarm have an active maintainer? Is there any documentation on how to get started? Unfortunately, I missed the plugin development workshop on Jenkins World in September.

          Lukas Elsner added a comment - oleg_nenashev Cool, I was actually thinking of that. Does swarm have an active maintainer? Is there any documentation on how to get started? Unfortunately, I missed the plugin development workshop on Jenkins World in September.

          Update: We tested the 3.6 and it seems that it's working fine, thank you again for the fix!

          Arnold Robert Turdean added a comment - Update: We tested the 3.6 and it seems that it's working fine, thank you again for the fix!

          Oleg Nenashev added a comment -

          >Does swarm have an active maintainer? Is there any documentation on how to get started?

          I doubt there is a specific documentation for Swarm plugin. Regarding common plugin development guides, there is a documentation entry point here: https://jenkins.io/participate/code/ . We're migrating our docs to jenkins.io, so now the documentation may be scattered a bit.

          Oleg Nenashev added a comment - >Does swarm have an active maintainer? Is there any documentation on how to get started? I doubt there is a specific documentation for Swarm plugin. Regarding common plugin development guides, there is a documentation entry point here: https://jenkins.io/participate/code/ . We're migrating our docs to jenkins.io, so now the documentation may be scattered a bit.

            mindjiver Peter Jönsson
            grahamlyons Graham Lyons
            Votes:
            8 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated:
              Resolved: