myENA / consul-backinator

Command line Consul backup and restore utility supporting KVs, ACLs and Queries
Mozilla Public License 2.0
226 stars 22 forks source link

docker oci runtime error: container_linux.go:247 #33

Closed nani-ar closed 7 years ago

nani-ar commented 7 years ago

Error trace .

{"line":"2017-08-31T17:06:19Z [WARN] Error with docker; stopping container module=\"TaskEngine\" task=\"ConsulBackup:3 arn:aws:ecs:us-west-2:776609208984:task/a03e35fe-2e1e-4a73-922a-e98f63a82b6f, Status: (CREATED-\u003eRUNNING) Containers: [ConsulBackup (RUNNING-\u003eRUNNING),]\" container=\"ConsulBackup(myena/consul-backinator:latest) (RUNNING-\u003eRUNNING)\" err=\"API error (404): oci runtime error: container_linux.go:247: starting container process caused \"exec: \\"backup -addr=10.0.1.50:8500 -file=s3://bakup-consul/consul_backup/first.bak?region=us-west-2\\": stat backup -addr=10.0.1.50:8500 -file=s3://bakup-consul/consul_backup/first.bak?region=us-west-2: no such file or directory\"","source":"stdout","tag":"ecs-agent/236df33fb65d"}

aaronhurt commented 7 years ago

What's your ENTRYPOINT? This looks like a bad ENTRYPOINT or CMD definition to the container.

aaronhurt commented 7 years ago

Okay, that's the problem and why you are getting that error message. It's trying to execute all of that as a single binary and can't find it.

Take a look at the CMD and ENTRYPOINT documentation ... specifically the array style. You probably only want to specify ENTRYPOINT or CMD and not both.

https://docs.docker.com/engine/reference/builder/#cmd https://docs.docker.com/engine/reference/builder/#entrypoint

aaronhurt commented 7 years ago

You could do this a few ways:

1) Leave the upstream container ENTRYPOINT and specify CMD

ENTRYPOINT ["/usr/local/bin/consul-backinator"]
CMD ["backup", "-addr=10.0.1.50:8500", "-file=s3://accesskey:secretkey@bakup-consul/consul_backup/?region=us-west-2"]

2) Do not specify an ENTRYPOINT (use the docker default) and specify CMD

CMD ["/usr/local/bin/consul-backinator", "backup", "-addr=10.0.1.50:8500", "-file=s3://accesskey:secretkey@bakup-consul/consul_backup/?region=us-west-2"]

3) Do not modify theDockerfile and pass the arguments at runtime

docker run myena/consul-backinator backup -addr=10.0.1.50:8500 -file=s3://accesskey:secretkey@bakup-consul/consul_backup/?region=us-west-2
aaronhurt commented 7 years ago

This part of the documentation provides a good description:

https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact

nani-ar commented 7 years ago

yeah, its working, thank you

aaronhurt commented 7 years ago

This is the same issue and solution as reported in #29