docker-lambda icon indicating copy to clipboard operation
docker-lambda copied to clipboard

Container exit code is 1 when there are no application errors

Open ravikashyap1 opened this issue 5 years ago • 4 comments

I am running .net 2.1 code which completes with no errors but the docker container exits with 1 occasionally. This happens about 1% of the time. I am running this as a Fargate task in AWS, and so don't have the docker container id to inspect. In what circumstances would docker-lambda return an exit code of 1 ?

ravikashyap1 avatar Jul 14 '20 18:07 ravikashyap1

There are a few cases that the mock bootstrap will exit with this code:

https://github.com/lambci/docker-lambda/blob/187542add179d199825090c10d6bbb387d76fea1/dotnetcore2.1/run/MockBootstraps/MockRuntime.cs#L125

https://github.com/lambci/docker-lambda/blob/187542add179d199825090c10d6bbb387d76fea1/dotnetcore2.1/run/MockBootstraps/MockRuntime.cs#L214

I'm guessing it's probably a socket timeout or similar

mhart avatar Jul 14 '20 18:07 mhart

Is there a workaround you recommend?

ravikashyap1 avatar Jul 14 '20 18:07 ravikashyap1

Unfortunately I've never seen it before. If you find a way of reliably reproducing it, let me know and I'll see if I can determine the root cause.

mhart avatar Jul 14 '20 19:07 mhart

I have not been able to repro this manually. It happens completely at random and the last occurrence was when the container ran for just under 5 seconds and without any app error, but the container exited with 1. A retry (run the container all over again, with the same payload) works.

ravikashyap1 avatar Jul 14 '20 20:07 ravikashyap1