Swarmkit: Create Service Bug

Created on 2 Sep 2016  Â·  12Comments  Â·  Source: docker/swarmkit

I have found a create service bug and reported it at project swarm

I have installed the latest version docker:

[root@docker-manager01 ~]# docker --version
Docker version 1.12.1, build 23cf638

There are 2 managers and 3 workers in the cluster.
I'd like to create a service with 5 replicas named hello-node and using an image called reg1.jzez.com/hello-node:1.0.

docker service create --replicas 5 --name hello-node --update-delay 10s -p 3000:3000 reg1.jzez.com/hello-node:1.0

However, there is no image called reg1.jzez.com/hello-node:1.0.
So,it'll not be successful.

After that, i pull reg1.jzez.com/hello-node:1.0 from my own private regirstry server at one node in the cluster.

Then the bug appered, about half an hour later, execute:

[root@docker-manager01 ~]# docker service ls
ID             NAME        REPLICAS             IMAGE               COMMAND
9rbcpg4qi712  hello-node    18/5      reg1.jzez.com/hello-node:1.0  

image
you can see that the REPLICAS was 18/5.

That's a bug. :(

kinbug

Most helpful comment

Having the same issue:
When we create a service the image is not pulled from the registry, getting the message image cannot be found. When I log in to the box and do a manual docker pull the image is pulled without issue and the in service ps I see another box running the container.

So imo there is a bug that doesnt allow swarm to pull the image from a private repo

All 12 comments

Can you also give the output of docker service ps hello-node?

I cannot reproduce the issue with similar setup. Besides docker service ps hello-node, can you also post output from history | grep hello-node?

@dongluochen @dperny OK, i find this issue may be caused by the authorization problem.

This moring, log in my company's server. And then closed the nginx authorization. My registry server was behind the nginx.

When prepare to reproduce this issue, but the bug disappered.

All of nodes in the cluster downloaded the reg1.jzez.com/hello-node:1.0 image automatically.

So, @dongluochen you can try a registry server behind the nginx which turns on the baisc_authorization function.

I'll retry to reproduce the issue later. Just a moment. :)

@dperny @dongluochen

Here is the screenshot:

image


In the cluster, just a node docker-worker01 exists the reg1.jzez.com/hello-node:1.0 image.

image


Others don't exist reg1.jzez.com/hello-node:1.0 image.

image
image
image
image
image


Turn on nginx basic_authorize function and the issue will be reproduced.

image

Good luck.

:)

I'll leave this open since there is already a lot of troubleshooting happening, but this isn't really a swarmkit issue.

@brainqi1991 I am confuse the reports. could you please recap the result again

Having the same issue:
When we create a service the image is not pulled from the registry, getting the message image cannot be found. When I log in to the box and do a manual docker pull the image is pulled without issue and the in service ps I see another box running the container.

So imo there is a bug that doesnt allow swarm to pull the image from a private repo

@MansM: You need to use the --with-registry-auth option to docker service create to copy the registry credentials to the service.

Or add the X-Auth header in your .docker/config.json

@aaronlehmann That works! --with-registry-auth option can pull from private registry.

this ticket should be closed.

Thanks. I'm closing this issue. Please open new issues if there are remaining problems related to registry authentication.

Was this page helpful?
0 / 5 - 0 ratings