Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authenticating to Docker registry fails if pull strategy not "Pull always" #286

Open
Krernertok opened this issue May 4, 2020 · 1 comment

Comments

@Krernertok
Copy link

New instances in the Docker Swarm are unable to pull the slave image using the "Pull once" pull strategy even though the provided credentials are correct. We are using Artifactory as our custom Docker registry.

Error message:

com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.exception.InternalServerErrorException:
Error response from daemon: Get [URL for container image]: unknown: Authentication is required

	at com.github.kostyasha.yad_docker_java.com.github.dockerjava.jaxrs.filter.ResponseStatusExceptionFilter.filter(ResponseStatusExceptionFilter.java:72)
	at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.client.ClientFilteringStages$ResponseFilterStage.apply(ClientFilteringStages.java:171)
	at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.client.ClientFilteringStages$ResponseFilterStage.apply(ClientFilteringStages.java:159)
	at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.process.internal.Stages.process(Stages.java:147)
	at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:301)
	at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.client.JerseyInvocation.lambda$invoke$0(JerseyInvocation.java:609)
	at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.internal.Errors.process(Errors.java:292)
	at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.internal.Errors.process(Errors.java:274)
	at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.internal.Errors.process(Errors.java:205)
	at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:390)
	at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:608)
	at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:421)
	at com.github.kostyasha.yad_docker_java.org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:327)
	at com.github.kostyasha.yad_docker_java.com.github.dockerjava.jaxrs.JerseyInvocationBuilder.post(JerseyInvocationBuilder.java:112)
	at com.github.kostyasha.yad_docker_java.com.github.dockerjava.core.exec.CreateContainerCmdExec.execute(CreateContainerCmdExec.java:33)
	at com.github.kostyasha.yad_docker_java.com.github.dockerjava.core.exec.CreateContainerCmdExec.execute(CreateContainerCmdExec.java:13)
	at com.github.kostyasha.yad_docker_java.com.github.dockerjava.core.exec.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:21)
	at com.github.kostyasha.yad_docker_java.com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:35)
	at com.github.kostyasha.yad_docker_java.com.github.dockerjava.core.command.CreateContainerCmdImpl.exec(CreateContainerCmdImpl.java:595)
	at com.github.kostyasha.yad.DockerCloud.runContainer(DockerCloud.java:177)
	at com.github.kostyasha.yad.DockerCloud.provisionWithWait(DockerCloud.java:237)
	at com.github.kostyasha.yad.DockerCloud.lambda$provision$0(DockerCloud.java:135)
	at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
	at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:71)
	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)

After changing the pull strategy to "Pull always" the slaves are able to pull the image correctly. However, changing the strategy back to "Pull once" causes the error to re-appear.

Jenkins version: 2.222.3
YAD version: 0.2.0

@KostyaSha
Copy link
Owner

KostyaSha commented Aug 31, 2020

Do you have any other log lines before? Especially Pulling image '{}'. This may take awhile... Trying identify code flow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants