Uploaded image for project: 'Jenkins Artifactory Plug-in'
  1. Jenkins Artifactory Plug-in
  2. HAP-1241

Unable to push Docker image to Artifactory from Jenkins Pipeline

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: 3 - High
    • Resolution: Not a Bug
    • Affects Version/s: 3.4.0
    • Fix Version/s: None
    • Component/s: Common
    • Labels:
      None
    • Environment:

      Running Jenkins on AWS EKS. 

      Jenkins: v2.190.1

      Artifactory Plugin: v3.4.0

      Description

      I am running a Jenkins Pipeline and trying to upload a docker image but it is failing using the Artifactory command.

      This is a snippet of my Jenkinsfile stage:

      stage("Build docker image") {
           steps {
               container('docker') {
                   sh 'docker -v'
                   script {
                       def rtServer = Artifactory.server "artifactory"
                       def rtDocker = Artifactory.docker server: rtServer
                       docker.build("app", "--build-arg JAR_FILE=app.jar -f Dockerfile .")
      
                       def buildInfo = rtDocker.push '<companyname>.jfrog.io/app','docker-snapshot-local'
                   }
               }
           }
      }
      

      This fails after the docker.build with the following message:

      [Pipeline] newBuildInfo
      [Pipeline] dockerPushStep
      expected to call org.jfrog.hudson.pipeline.common.types.Docker.push but wound up catching dockerPushStep; see: https://jenkins.io/redirect/pipeline-cps-method-mismatches/
      [Pipeline] }
      

      Jenkins EOF console log:

      Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from ip-XX-XX-XX-XX.ec2.internal/XX.XX.XX.XX:42790
              at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1743)
              at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
              at hudson.remoting.Channel.call(Channel.java:957)
              at org.jfrog.hudson.pipeline.common.docker.utils.DockerAgentUtils.getImageIdFromAgent(DockerAgentUtils.java:291)
              at org.jfrog.hudson.pipeline.common.executors.DockerExecutor.execute(DockerExecutor.java:59)
              at org.jfrog.hudson.pipeline.scripted.steps.DockerPushStep$Execution.run(DockerPushStep.java:104)
              at org.jfrog.hudson.pipeline.scripted.steps.DockerPushStep$Execution.run(DockerPushStep.java:71)
              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 ...io.netty.channel.epoll.AbstractEpollChannel.doConnect(AbstractEpollChannel.java:713)
          at io.netty.channel.epoll.EpollDomainSocketChannel.doConnect(EpollDomainSocketChannel.java:87)
          at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.connect(AbstractEpollChannel.java:555)
          at io.netty.channel.DefaultChannelPipeline$HeadContext.connect(DefaultChannelPipeline.java:1366)
          at io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:545)
          at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:530)
          at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.connect(CombinedChannelDuplexHandler.java:497)
          at io.netty.channel.ChannelOutboundHandlerAdapter.connect(ChannelOutboundHandlerAdapter.java:47)
          at io.netty.channel.CombinedChannelDuplexHandler.connect(CombinedChannelDuplexHandler.java:298)
          at io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:545)
          at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:530)
          at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:512)
          at io.netty.channel.DefaultChannelPipeline.connect(DefaultChannelPipeline.java:1024)
          at io.netty.channel.AbstractChannel.connect(AbstractChannel.java:259)
          at io.netty.bootstrap.Bootstrap$3.run(Bootstrap.java:252)
          at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
          at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
          at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:335)
          at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)
          at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
          at java.lang.Thread.run(Thread.java:748)

       

        Attachments

          Activity

            People

            Assignee:
            eyalb Eyal Ben Moshe
            Reporter:
            wteixeira Wanderley Teixeira
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: