Skip to content
This repository has been archived by the owner on Oct 22, 2023. It is now read-only.

False error and no log output if container exits too quickly #65

Closed
ineffyble opened this issue Feb 14, 2019 · 2 comments
Closed

False error and no log output if container exits too quickly #65

ineffyble opened this issue Feb 14, 2019 · 2 comments

Comments

@ineffyble
Copy link
Contributor

I'll prefix this by saying that I haven't been able to replicate it on my MacBook, but it's happening consistently on multiple CentOS machines.

If running a task that exits almost immediately (for example, where the command is echo "hi", instead of container output, I get:

Error: could not run container xxx
Resizing TTY for container 'xxx' failed: bad file descriptor: unknown

with a failure message.

If I make a task to shell into the container and run the same command/script, it passes.

If I make the task run longer (for example, changing my echo.sh to have echo "hi" && sleep 5), I correctly see the log output and batect completes without failure.

This sounds related to #19. It seems to be a regression as this didn't used to occur - whether that's due to a change in batect, Docker, or something else about my environment, I'm not sure.

batect version: 0.25
JVM version: Oracle Corporation OpenJDK 64-Bit Server VM 1.8.0_191
OS version: Linux 3.10.0-862.14.4.el7.x86_64 (amd64)
Docker version: 18.9.2 (API version: 1.39)
@charleskorn
Copy link
Collaborator

Thanks for the feedback @ineffyble! I've just run into this myself. It looks like the Docker daemon is not coping with the fact that the container has just exited (trying the same thing a few seconds later gives me a "container is stopped" / "container doesn't exist" message) - might be a race condition in the daemon somewhere.

Regardless, this is an easy thing for me to fix, so I'll take a look.

@charleskorn
Copy link
Collaborator

I've just pushed a fix for this and I'll cut a release tonight. Thanks again for your feedback @ineffyble!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants