New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add --remove-orphans to docker-compose command? #23
Comments
@vicyap But did you do anything with the compose file or the containers during the run of pytest? I used this plugin quite extensively and didn't see that problem before. |
Hmm. I have seen this problem intermittently. We have a set of VMs connected to Jenkins which runs our CI. My current theory is that a job was aborted and left containers running. Then when the job re-runs it produces this error. I'll try to reproduce it. |
Ok. I didn't use --remove-orphans before and I'm not sure how that affects other workflows with Compose. So I'd be cautious about adding that. But if we can change something in the code that would prevent the situation from occuring, i.e. killing the containers when the tests are killed, that would be safer, I guess. But I think there should be a reproducible flow before the code is changed. |
I agree, I don't know the impact of just adding in |
I'm guessing it's got something to do with changing the compose file while a previous instance is running |
Yes, this option is useful after removing services from a compose file. Example:
Run
I don't see how this could happen during normal operation. You could probably trigger this on long builds by editing your
Hint: you might want to look for builds from multiple branches where one branch contains a service that is not defined in other branches. Think of this sequence:
Hint: concurrent builds on the same machine might also be an issue, especially if the compose project name is fixed across branches. Think of this sequence:
IMO, you might consider using a random compose project name to avoid conflicts in both cases, then run a cron job on your build machine to clean up orphaned containers once in a while to account for jobs that get killed. Note: if editing |
So... is there anything that needs to be done regarding this issue, or should it be closed? |
Since there is no response from @vicyap, I will close this issue. Feel free to open a new issue if you run into this issue again. |
I got the following error while using the plugin. Does it make sense to add --remove-orphans to the docker-compose command?
The text was updated successfully, but these errors were encountered: