Why no X-Registry-Auth header when docker plugin sends pull request?

84 views
Skip to first unread message

hough.ron

unread,
Sep 1, 2016, 11:20:28 PM9/1/16
to Jenkins Users
Hello all...

I'm using Jenkins 2.20, docker plugin 0.16.1, Docker 1.10.3.  I have a build slave docker container on a private registry, and I have a "Docker Cloud" set up in Jenkins with a template for the build slave container.  When a job tries to provision a slave using this template, it fails if the image hasn't already been pulled by hand to the local registry.  Looking at the http traffic revealed that Jenkins was making a POST to the Docker server like http://HOST:PORT/images/create?fromImage=REGISTRY:PORT/image, and this was getting a "no basic auth credentials" error back from the docker server.  Now, if I add an X-Registry-Auth header with encoded credentials to the POST, the call will succeed.  My question is:  why isn't Jenkins adding the X-Registry-Auth header?  Am I doing something wrong, or is this a bug?  I have an entry for the registry with id/pword in the "Docker Plugin" section of the Jenkins Configuration, but that apparently isn't being used.

Any advice would me much appreciated.  Thanks!

Ron

Jenkins log:
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)

Reply all
Reply to author
Forward
0 new messages