[JIRA] [docker-plugin] (JENKINS-30668) docker cloud doesn't pull the image before start the docker container

25 views
Skip to first unread message

hqli@freewheel.tv (JIRA)

unread,
Sep 27, 2015, 9:44:01 PM9/27/15
to jenkinsc...@googlegroups.com
huaqiang li created an issue
 
Jenkins / Bug JENKINS-30668
docker cloud doesn't pull the image before start the docker container
Issue Type: Bug Bug
Assignee: Kanstantsin Shautsou
Components: docker-plugin
Created: 28/Sep/15 1:43 AM
Priority: Major Major
Reporter: huaqiang li

in the Cloud i added a docker host , and add a Docker template with the docker image ID with my private registry:label , the docker plugin failed to start the docker container on docker host . so i have to pull the docker image manually on docker host , and then the docker cloud works to start the docker container as docker slave .

the docker cloud should pull the docker image before start docker container on docker host .

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

gentoo.integer@gmail.com (JIRA)

unread,
Sep 28, 2015, 5:18:02 AM9/28/15
to jenkinsc...@googlegroups.com

hqli@freewheel.tv (JIRA)

unread,
Sep 28, 2015, 5:29:01 AM9/28/15
to jenkinsc...@googlegroups.com

it is difficult to show the logs, the job doesn't run for the docker container is not started automatically.

but it is easy to do the test , you can just configure the image ID with registry and label , and just make sure no such image on the docker host , you can test your jenkins job to show the job is pending there to start the docker slave.

but after you pull the docker image manually on docker host , the jenkins job is running .

gentoo.integer@gmail.com (JIRA)

unread,
Dec 2, 2015, 6:27:06 PM12/2/15
to jenkinsc...@googlegroups.com

marco.pas@gmx.net (JIRA)

unread,
Jun 22, 2016, 5:15:02 AM6/22/16
to jenkinsc...@googlegroups.com
Marco Pas commented on Bug JENKINS-30668
 
Re: docker cloud doesn't pull the image before start the docker container

We are having the same issue. It just waits for an image. The only solutions now is to pull the image on the host.

This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

gentoo.integer@gmail.com (JIRA)

unread,
Jun 22, 2016, 6:44:01 AM6/22/16
to jenkinsc...@googlegroups.com

hqli@freewheel.tv (JIRA)

unread,
Jun 22, 2016, 9:20:01 PM6/22/16
to jenkinsc...@googlegroups.com

i updated the jenkins docker plugin to the latest 0.16.0 version , now it works to pull the image once before starting the container

mrstanwell@gmail.com (JIRA)

unread,
Sep 1, 2016, 6:46:03 PM9/1/16
to jenkinsc...@googlegroups.com

I have this problem running Jenkins 2.20 and docker-plugin 0.16.1. A docker slave template image doesn't get pulled automatically from a remote registry. If the image doesn't exist in the local registry, the job hangs waiting for an executor. If the image is pulled manually, the job starts. I've entered registry credentials under "Docker Plugin" on the Configuration screen, but it looks like an auth error is still being thrown:

{{INFO: Started provisioning Image of REDACTED/jenkins_d_slave from docker with 1 executors. Remaining excess workload: 0
Sep 01, 2016 5:23:58 PM com.nirima.jenkins.plugins.docker.DockerCloud pullImage
INFO: Pulling image 'REDACTED/jenkins_d_slave' since one was not found. This may take awhile...
Sep 01, 2016 5:23:58 PM com.github.dockerjava.core.async.ResultCallbackTemplate onError
SEVERE: Error during callback
com.github.dockerjava.api.InternalServerErrorException: Get http://REDACTED/jenkins_d_slave/tags/list: no basic auth credentials

at com.github.dockerjava.jaxrs.filter.ResponseStatusExceptionFilter.filter(ResponseStatusExceptionFilter.java:53)
at org.glassfish.jersey.client.ClientFilteringStages$ResponseFilterStage.apply(ClientFilteringStages.java:134)
at org.glassfish.jersey.client.ClientFilteringStages$ResponseFilterStage.apply(ClientFilteringStages.java:123)
at org.glassfish.jersey.process.internal.Stages.process(Stages.java:171)
at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:251)
at org.glassfish.jersey.client.JerseyInvocation$2.call(JerseyInvocation.java:683)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:424)
at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:679)
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:435)
at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:338)
at com.github.dockerjava.jaxrs.async.POSTCallbackNotifier.response(POSTCallbackNotifier.java:29)
at com.github.dockerjava.jaxrs.async.AbstractCallbackNotifier.call(AbstractCallbackNotifier.java:45)
at com.github.dockerjava.jaxrs.async.AbstractCallbackNotifier.call(AbstractCallbackNotifier.java:22)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Sep 01, 2016 5:23:58 PM com.nirima.jenkins.plugins.docker.DockerCloud$1 call
SEVERE: Error in provisioning; template='DockerTemplate{configVersion=2, labelString='maven-d', launcher=com.nirima.jenkins.plugins.docker.launcher.DockerComputerSSHLauncher@70153a03, remoteFsMapping='/home/jenkins', remoteFs='/home/jenkins', instanceCap=3, mode=NORMAL, retentionStrategy=com.nirima.jenkins.plugins.docker.strategy.DockerOnceRetentionStrategy@4668bd65, numExecutors=1, dockerTemplateBase=DockerTemplateBase

{image=REDACTED/jenkins_d_slave}

, removeVolumes=false, pullStrategy=PULL_LATEST}' for cloud='docker'
com.github.dockerjava.api.DockerClientException: Could not pull image
at com.github.dockerjava.core.command.PullImageResultCallback.awaitSuccess(PullImageResultCallback.java:47)
at com.nirima.jenkins.plugins.docker.DockerCloud.pullImage(DockerCloud.java:361)
at com.nirima.jenkins.plugins.docker.DockerCloud.provisionWithWait(DockerCloud.java:369)
at com.nirima.jenkins.plugins.docker.DockerCloud.access$000(DockerCloud.java:58)
at com.nirima.jenkins.plugins.docker.DockerCloud$1.call(DockerCloud.java:248)
at com.nirima.jenkins.plugins.docker.DockerCloud$1.call(DockerCloud.java:245)
at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

}}

charl.thiem+jenkins@gmail.com (JIRA)

unread,
Feb 17, 2017, 8:44:02 AM2/17/17
to jenkinsc...@googlegroups.com

Hi

Having same problem here. When using a private hosted Image it does not get pulled. But works if I pull it manually first.

Feb 17, 2017 3:33:06 PM com.nirima.jenkins.plugins.docker.DockerCloud provision
INFO: Asked to provision 1 slave(s) for: docker-agent
Feb 17, 2017 3:33:06 PM com.nirima.jenkins.plugins.docker.DockerCloud provision
INFO: Will provision 'private-docker.mycompany.co.za/mycompany/myimage', for label: 'docker-agent', in cloud: 'docker-agent-slave1'
Feb 17, 2017 3:33:06 PM com.nirima.jenkins.plugins.docker.DockerCloud addProvisionedSlave
INFO: Provisioning 'private-docker.mycompany.co.za/mycompany/myimage' number '0' on 'docker-agent-slave1'; Total containers: '0'
Feb 17, 2017 3:33:06 PM hudson.slaves.NodeProvisioner$StandardStrategyImpl apply
INFO: Started provisioning Image of private-docker.mycompany.co.za/mycompany/myimage from docker-agent-slave1 with 1 executors. Remaining excess workload: 0
Feb 17, 2017 3:33:06 PM com.nirima.jenkins.plugins.docker.DockerCloud pullImage
INFO: Pulling image 'private-docker.mycompany.co.za/mycompany/myimage' since one was not found. This may take awhile...
Feb 17, 2017 3:33:07 PM com.nirima.jenkins.plugins.docker.DockerCloud pullImage
INFO: Finished pulling image 'private-docker.mycompany.co.za/mycompany/myimage', took 335 ms
Feb 17, 2017 3:33:07 PM com.nirima.jenkins.plugins.docker.DockerCloud provisionWithWait
INFO: Trying to run container for private-docker.mycompany.co.za/mycompany/myimage
Feb 17, 2017 3:33:07 PM com.nirima.jenkins.plugins.docker.DockerCloud$1 call
SEVERE: Error in provisioning; template='DockerTemplate{configVersion=2, labelString='docker-agent', launcher=com.nirima.jenkins.plugins.docker.launcher.DockerComputerSSHLauncher@55dc326b, remoteFsMapping='', remoteFs='/home/jenkins', ins
tanceCap=1, mode=NORMAL, retentionStrategy=com.nirima.jenkins.plugins.docker.strategy.DockerOnceRetentionStrategy@516e2362, numExecutors=1, dockerTemplateBase=DockerTemplateBase{image=private-docker.mycompany.co.za/mycompany/jenkins-doc
ker}, removeVolumes=true, pullStrategy=PULL_LATEST}' for cloud='docker-agent-slave1'
com.github.dockerjava.api.exception.NotFoundException: {"message":"No such image: private-docker.mycompany.co.za/mycompany/myimage:latest"}
        at com.github.dockerjava.jaxrs.filter.ResponseStatusExceptionFilter.filter(ResponseStatusExceptionFilter.java:47)
        at org.glassfish.jersey.client.ClientFilteringStages$ResponseFilterStage.apply(ClientFilteringStages.java:140)
        at org.glassfish.jersey.client.ClientFilteringStages$ResponseFilterStage.apply(ClientFilteringStages.java:128)
        at org.glassfish.jersey.process.internal.Stages.process(Stages.java:171)
        at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:257)
        at org.glassfish.jersey.client.JerseyInvocation$2.call(JerseyInvocation.java:701)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:444)
        at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:697)
        at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:448)
        at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:349)
        at com.github.dockerjava.jaxrs.CreateContainerCmdExec.execute(CreateContainerCmdExec.java:34)
        at com.github.dockerjava.jaxrs.CreateContainerCmdExec.execute(CreateContainerCmdExec.java:15)
        at com.github.dockerjava.jaxrs.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:23)
        at com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:35)
        at com.github.dockerjava.core.command.CreateContainerCmdImpl.exec(CreateContainerCmdImpl.java:177)
        at com.nirima.jenkins.plugins.docker.DockerCloud.runContainer(DockerCloud.java:302)
        at com.nirima.jenkins.plugins.docker.DockerCloud.provisionWithWait(DockerCloud.java:394)
        at com.nirima.jenkins.plugins.docker.DockerCloud.access$000(DockerCloud.java:64)
        at com.nirima.jenkins.plugins.docker.DockerCloud$1.call(DockerCloud.java:261)
        at com.nirima.jenkins.plugins.docker.DockerCloud$1.call(DockerCloud.java:258)
        at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)}}

Looking at the logs of our Apache server (that proxies to our Nexus server) where the private repository is hosted, I can see that an attempt is made to send authentication details, but its sent as empty username and password

GET /v1/repositories/mycompany/myimage/images HTTP/1.1
Host: private-docker.mycompany.co.za
User-Agent: docker/1.13.1 go/go1.7.5 git-commit/092cba3 kernel/3.10.0-514.2.2.el7.x86_64 os/linux arch/amd64 UpstreamClient(Jersey/2.23.1 \(Apache HttpClient 4.5\))
Authorization: Basic Og==
X-Docker-Token: true
Accept-Encoding: gzip
Connection: close

From here You can see the password is sent as "Og==", which is decoded to ":", aka empty username and password.

I think the UI needs a place where the username and password for the repo can be added.

Docker Image: private-docker.mycompany.co.za/mycompany/myimage
That repo needs authentication to be able to download the image.

charl.thiem+jenkins@gmail.com (JIRA)

unread,
Feb 17, 2017, 8:47:03 AM2/17/17
to jenkinsc...@googlegroups.com
Charl Thiem edited a comment on Bug JENKINS-30668
Hi

Having same problem here. When using a private hosted Image it does not get pulled. But works if I pull it manually first.
{code}
{code}

Looking at the logs of our Apache server (that proxies to our Nexus server) where the private repository is hosted, I can see that an attempt is made to send authentication details, but its sent as empty username and password
{code}

GET /v1/repositories/mycompany/myimage/images HTTP/1.1
Host: private-docker.mycompany.co.za
User-Agent: docker/1.13.1 go/go1.7.5 git-commit/092cba3 kernel/3.10.0-514.2.2.el7.x86_64 os/linux arch/amd64 UpstreamClient(Jersey/2.23.1 \(Apache HttpClient 4.5\))
Authorization: Basic Og==
X-Docker-Token: true
Accept-Encoding: gzip
Connection: close
{code}

From here You can see the password is sent as "Og==", which is decoded to ":", aka empty username and password.

I think the UI needs a place where the username and password for the repo can be added.


That repo needs authentication to be able to download the image.

*Jenkins* : 2.32.2
*Docker plugin* : 0.16.2
All other plugins are up to date with latest
*Docker version*: 1.13.1, build 092cba3
Reply all
Reply to author
Forward
0 new messages