service fails with error "Failed with result 'start-limit"

13,418 views
Skip to first unread message

ac sandeep

unread,
Aug 5, 2015, 9:55:26 AM8/5/15
to CoreOS User
Hi all,

I am trying to run the private docker registry v2 on my CoreOS cluster (using Vagrant). Below is my service file:
[
Unit]
Description=Local Docker registry Service

After=etcd.service
After=docker.service
Requires=etcd.service
Requires=docker.service

[Service]
TimeoutStartSec=0
Restart=always
RestartSec=10s
EnvironmentFile=/etc/environment
User=core


ExecStartPre=-/usr/bin/docker kill docker-registry
ExecStartPre=-/usr/bin/docker rm docker-registry


ExecStart=/usr/bin/docker run --name docker-registry \
 
-p ${COREOS_PRIVATE_IPV4}:5000:5000  \
 
-e "REGISTRY_STORAGE=s3" \
 
-e "REGISTRY_STORAGE_S3_REGION=eu-west-1" \
 
-e "REGISTRY_STORAGE_S3_BUCKET=xxx" \
 
-e "REGISTRY_STORAGE_S3_ACCESSKEY=AWSKEY" \
 
-e "REGISTRY_STORAGE_S3_SECRETKEY=AWSSECRETKEY" \
  registry
:2


ExecStop=/usr/bin/docker stop docker-registry

When i start this service it crashes immediately with 6-7 restarts and then finally it ends in this error:

Aug 05 13:42:44 core-01 systemd[1]: Starting Local Docker registry Service...
Aug 05 13:42:44 core-01 systemd[1]: Started Local Docker registry Service.
Aug 05 13:42:44 core-01 docker[9203]: 4c9b3013c7aa7b2bac04613cbeefca5acc1a3942a02c56c11c7b761cefb9dd1f
Aug 05 13:42:44 core-01 docker[9264]: docker-registry
Aug 05 13:42:45 core-01 systemd[1]: docker-registry.service: Service hold-off time over, scheduling restart.
Aug 05 13:42:45 core-01 systemd[1]: Starting Local Docker registry Service...
Aug 05 13:42:45 core-01 docker[9299]: docker-registry
Aug 05 13:42:45 core-01 systemd[1]: Started Local Docker registry Service.
Aug 05 13:42:45 core-01 docker[9313]: b6ac646f0ba77c540a10f7c7ba4aef43b6e9f3f3c46dfe896dab3bb1f05fa3c0
Aug 05 13:42:45 core-01 docker[9370]: docker-registry
Aug 05 13:42:45 core-01 systemd[1]: docker-registry.service: Service hold-off time over, scheduling restart.
Aug 05 13:42:45 core-01 systemd[1]: Starting Local Docker registry Service...
Aug 05 13:42:45 core-01 docker[9393]: docker-registry
Aug 05 13:42:45 core-01 docker[9401]: docker-registry
Aug 05 13:42:45 core-01 systemd[1]: Started Local Docker registry Service.
Aug 05 13:42:45 core-01 docker[9408]: c937f2cb56b7c187bfff5aab2c3faf04838768fd9e79f11c3a764db067d81c45
Aug 05 13:42:46 core-01 systemd[1]: docker-registry.service: Service hold-off time over, scheduling restart.
Aug 05 13:42:46 core-01 systemd[1]: Starting Local Docker registry Service...
Aug 05 13:42:46 core-01 docker[9498]: docker-registry
Aug 05 13:42:46 core-01 docker[9509]: docker-registry
Aug 05 13:42:46 core-01 systemd[1]: Started Local Docker registry Service.
Aug 05 13:42:46 core-01 docker[9515]: 600dd6f23b5e92b5a79f413a2e2d2af9eb64f25e0fd14a08cc69fa294b973595
Aug 05 13:42:46 core-01 docker[9566]: docker-registry
Aug 05 13:42:46 core-01 systemd[1]: docker-registry.service: Service hold-off time over, scheduling restart.
Aug 05 13:42:46 core-01 systemd[1]: Starting Local Docker registry Service...
Aug 05 13:42:46 core-01 docker[9607]: docker-registry
Aug 05 13:42:46 core-01 systemd[1]: Started Local Docker registry Service.
Aug 05 13:42:46 core-01 docker[9614]: c0558ac29874b2a24ec3f97dbd839db7d1bc0131301a5dc8c9f66c778e4281dc
Aug 05 13:42:47 core-01 systemd[1]: docker-registry.service: Service hold-off time over, scheduling restart.
Aug 05 13:42:47 core-01 systemd[1]: Starting Local Docker registry Service...
Aug 05 13:42:47 core-01 docker[9690]: docker-registry
Aug 05 13:42:47 core-01 systemd[1]: Started Local Docker registry Service.
Aug 05 13:42:47 core-01 docker[9701]: f48261f573f40d53576c8a772c96a36721fc24b1cd3d47569e3c56f104a2f87c
Aug 05 13:42:47 core-01 systemd[1]: docker-registry.service: Service hold-off time over, scheduling restart.
Aug 05 13:42:47 core-01 systemd[1]: docker-registry.service: Start request repeated too quickly.
Aug 05 13:42:47 core-01 systemd[1]: Failed to start Local Docker registry Service.
Aug 05 13:42:47 core-01 systemd[1]: docker-registry.service: Unit entered failed state.
Aug 05 13:42:47 core-01 systemd[1]: docker-registry.service: Failed with result 'start-limit'.

I am able to run the Docker private registry on the CLI. When i run it as a fleet unit file it ends up in error. Not sure what i am doing wrong. Any help would be appreciated.

PS: I have tried "KillMode=none" but seems to have no effect.

Regards
S

Brandon Philips

unread,
Aug 5, 2015, 6:50:59 PM8/5/15
to ac sandeep, CoreOS User
Hello Sandeep-

Does it work if you just run the docker command outside of the systemd unit?

Brandon

--
You received this message because you are subscribed to the Google Groups "CoreOS User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coreos-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ac sandeep

unread,
Aug 5, 2015, 10:09:54 PM8/5/15
to CoreOS User

Hi Brandon,

Thank you for responding. Yes, it does work correctly when run outside of the systemd unit.

docker run --name docker-registry -d -p 5000:5000 -e "REGISTRY_STORAGE=s3" -e "REGISTRY_STORAGE_S3_REGION=eu-west-1" -e "REGISTRY_STORAGE_S3_BUCKET=xxx" -e "REGISTRY_STORAGE_S3_ACCESSKEY=xxxxxx" -e "REGISTRY_STORAGE_S3_SECRETKEY=xxx"  registry:2

This works correctly and i am able to push/pull the images.

Regards
Sandeep

ac sandeep

unread,
Aug 6, 2015, 2:53:21 AM8/6/15
to CoreOS User
Update: Just to add the version of CoreOS. I am using Alpha channel version 752.1.0


Regards
Sandeep

On Wednesday, 5 August 2015 19:25:26 UTC+5:30, ac sandeep wrote:
Hi all,

Brandon Philips

unread,
Aug 7, 2015, 1:52:27 PM8/7/15
to ac sandeep, CoreOS User
What does `systemctl status docker-registry` tell you about the exit code, etc? It seems like more logging would be nice in the registry code.


Aside: TimeoutStartSec isn't necessary in the unit file.

--
Message has been deleted

ac sandeep

unread,
Aug 10, 2015, 3:01:50 AM8/10/15
to CoreOS User, acsa...@gmail.com
Pasting the response of the service status.

core@core-01 ~ $ systemctl status docker-registry
● docker-registry.service - Local Docker registry Service
   Loaded: loaded (/etc/systemd/system/docker-registry.service; linked-runtime; vendor preset: disabled)
   Active: failed (Result: start-limit) since Mon 2015-08-10 06:46:54 UTC; 2min 33s ago
  Process: 1212 ExecStop=/usr/bin/docker stop docker-registry (code=exited, status=0/SUCCESS)
  Process: 1175 ExecStart=/usr/bin/docker run --name docker-registry -d -m 512m -p ${COREOS_PRIVATE_IPV4}:5000:5000 -e REGISTRY_STORAGE=s3 -e REGISTRY_STORAGE_S3_REGION=eu-west-1 -e REGISTRY_STORAGE_S3_BUCKET=xxx -e REGISTRY_STORAGE_S3_ACCESSKEY=xxxx -e REGISTRY_STORAGE_S3_SECRETKEY=xxx registry:2 (code=exited, status=0/SUCCESS)
  Process: 1169 ExecStartPre=/usr/bin/docker rm docker-registry (code=exited, status=0/SUCCESS)
  Process: 1160 ExecStartPre=/usr/bin/docker kill docker-registry (code=exited, status=0/SUCCESS)
 Main PID: 1175 (code=exited, status=0/SUCCESS)

Aug 10 06:46:54 core-01 systemd[1]: docker-registry.service: Service hold-off time over, scheduling restart.
Aug 10 06:46:54 core-01 systemd[1]: docker-registry.service: Start request repeated too quickly.
Aug 10 06:46:54 core-01 systemd[1]: Failed to start Local Docker registry Service.
Aug 10 06:46:54 core-01 systemd[1]: docker-registry.service: Unit entered failed state.
Aug 10 06:46:54 core-01 systemd[1]: docker-registry.service: Failed with result 'start-limit'.


Regards
S

Brandon Philips

unread,
Aug 10, 2015, 1:08:23 PM8/10/15
to ac sandeep, CoreOS User
It looks like the docker run command is exiting with exit status 0. There isn't much else I can help with unless you can figure out why it is exiting by increasing log verbosity or something.

Brandon

Bryan Talbot

unread,
Aug 10, 2015, 1:34:56 PM8/10/15
to CoreOS User
The run command in the error output is not the same as what you show in your unit file. Remove the '-d' flag from the 'docker run' command and it will probably work.

ac sandeep

unread,
Aug 11, 2015, 1:22:49 AM8/11/15
to CoreOS User
Hi Bryan....i changed the tag from registry:2 to registry:2.0.1 and it works now. Thanks all of you for your help. Not sure how to mark it as solved.

Regards
S
Reply all
Reply to author
Forward
0 new messages