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

Failed to deserialize response to UserRequest when using Artifactory plugin with pipeline on docker container as build slave

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • artifactory-plugin
    • Development:
      Jenkins master running on Ubuntu VM with docker-container build slave

      When I try to execute a maven build using the Artifactory plugin with pipeline, the maven build compiles successfully but I get an error during the artifactory publish stage.  This pipeline job works perfectly fine executing on the master node.

      [Pipeline] End of Pipeline
      java.lang.SecurityException: Rejected: org.jfrog.build.client.DeployDetails; see https://jenkins.io/redirect/class-filter/
      	at hudson.remoting.ClassFilter.check(ClassFilter.java:76)
      	at hudson.remoting.MultiClassLoaderSerializer$Input.resolveClass(MultiClassLoaderSerializer.java:129)
      	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1859)
      	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1745)
      	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2033)
      	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1567)
      	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:427)
      	at java.util.ArrayList.readObject(ArrayList.java:797)
      	at sun.reflect.GeneratedMethodAccessor135.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1158)
      	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2169)
      	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2060)
      	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1567)
      	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:427)
      	at hudson.remoting.UserRequest.deserialize(UserRequest.java:277)
      	at hudson.remoting.UserResponse.retrieve(UserRequest.java:310)
      	at hudson.remoting.Channel.call(Channel.java:952)
      Caused: java.io.IOException: Failed to deserialize response to UserRequest:org.jfrog.hudson.pipeline.types.buildInfo.BuildInfo$DeployPathsAndPropsCallable@143172a3
      	at hudson.remoting.Channel.call(Channel.java:960)
      	at hudson.FilePath.act(FilePath.java:998)
      Caused: java.io.IOException: remote file operation failed: /home/jenkins/workspace/docker-test@tmp at hudson.remoting.Channel@49324854:docker-2c62fc44d7565
      	at hudson.FilePath.act(FilePath.java:1005)
      	at hudson.FilePath.act(FilePath.java:987)
      	at org.jfrog.hudson.pipeline.types.buildInfo.BuildInfo.appendDeployableArtifacts(BuildInfo.java:159)
      	at org.jfrog.hudson.pipeline.steps.ArtifactoryMavenBuild$Execution.run(ArtifactoryMavenBuild.java:112)
      	at org.jfrog.hudson.pipeline.steps.ArtifactoryMavenBuild$Execution.run(ArtifactoryMavenBuild.java:61)
      	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
      	at hudson.security.ACL.impersonate(ACL.java:290)
      	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
      	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:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Finished: FAILURE

       

      Here is my pipeline script:

      #!groovy
      def server = Artifactory.server "malva.nicc.noblis.org"
      def buildInfo = Artifactory.newBuildInfo()
      buildInfo.env.capture = true
      def rtMaven = Artifactory.newMavenBuild()
      rtMaven.tool = "Jenkins_maven" // Tool name from Jenkins configuration
      rtMaven.deployer releaseRepo: 'maven-release-local', snapshotRepo: 'maven-snapshot-local', server: server
      rtMaven.resolver releaseRepo: 'maven_virtual_aggregation_of_repos', snapshotRepo: 'maven-snapshot-local', server: server
      
      
      // Compile the projects.
      stage('compile') {
          node (label: "docker-build-slave"){
           git url: 'ssh://git@<hostname>/mos/docker-test.git',
                  branch: 'master'
              try {
                  rtMaven.run pom: 'pom.xml', goals: 'clean package -U -DskipTests', buildInfo: buildInfo
                  buildInfo.retention maxBuilds: 10, maxDays: 7, deleteBuildArtifacts: true
              } catch (any) {
                  currentBuild.result = 'FAILURE'
                  emailext (
                          subject: "FAILED: Compilation Error '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
                          mimeType: "text/html",
                          body: """<p>Could not compile code for build '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
                          <p>Logs are attached.  You can also check console output at &QUOT;<a href='${env.BUILD_URL}/console'>${env.JOB_NAME} [${env.BUILD_NUMBER}]/console</a>&QUOT;</p>""",
                          recipientProviders: [[$class: 'FirstFailingBuildSuspectsRecipientProvider'],
                                               [$class: 'CulpritsRecipientProvider'],
                                               [$class: 'RequesterRecipientProvider']],
                          attachLog: true
                  )
                  throw any //rethrow exception to prevent the build from proceeding
              }
          }
      }
      

       

      Here is my Dockerfile for the build slave:

      FROM jenkinsci/slave:alpine
      
      USER root
      RUN mkdir -p /home/jenkins/.ssh
      ADD id_rsa /home/jenkins/.ssh/id_rsa
      RUN ssh-keyscan -H -p <port> <hostname> >> /home/jenkins/.ssh/known_hosts && \
          chmod 700 /home/jenkins/.ssh/id_rsa && \
          chown -R jenkins:jenkins /home/jenkins/.ssh && \
          wget http://mirrors.gigenet.com/apache/maven/maven-3/3.5.3/binaries/apache-maven-3.5.3-bin.tar.gz && \
          tar -xzf apache-maven-3.5.3-bin.tar.gz -C /usr/local && \
          ln -s /usr/local/apache-maven-3.5.3 /usr/local/maven && \
          mkdir -p /home/jenkins/.m2/repository && \
          chown -R jenkins:jenkins /home/jenkins/.m2 && \
          chmod -R 777 /home/jenkins/.m2 && \
          apk update && \
          apk add procps
      ENV PATH /usr/local/maven/bin:$PATH \
          M2_HOME /usr/local/maven
      VOLUME /home/jenkins/.m2

       

            eyalbe Eyal Ben Moshe
            look4parker Michael Parker
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: