-
Notifications
You must be signed in to change notification settings - Fork 122
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
docker_compose_v2 fails with "Error when processing ${container_name}: Error" #807
Comments
This very likely isn't related to #787, but more likely a bug in Docker Compose itself. I don't think it should emit that error if there isn't really an error. But I have to look into more detail and try this out (I only have a few minutes right now). |
ok, |
The problem here is that Docker Compose issues warnings and errors due to pulling (apparently). You can also see them nicely with the default output:
Unfortunately these error/warning messages are not helpful since they do not contain any details (the syslog offers I also tracked down the warning/error generation in Docker Compose itself, the messages associated to them are "pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed". I'll create a PR for Compose that will expose these messages. With the PR it looks like this:
The nice output version is kind of broken since the messages are longer than a line if you don't have an ultra-wide terminal, though (might be that they chose not to show the full message because of that...). I guess the docker_compose_v2 module has to treat errors that do not result in a non-zero exit code as non-fatal errors and simply emit warnings. (Which in the current state of Docker Compose are not very helpful, since the message "dummy Error" isn't helpful at all, but 🤷.) |
docker/compose#11555 improves the Compose error reporting when pulling, and #810 no longer fails the module on non-fatal errors. |
SUMMARY
Define a compose project with two or more services using the same image which needs to be built.
Invoke
community.docker.docker_compose_v2
scaling one of the services, not the other.ISSUE TYPE
COMPONENT NAME
community.docker.docker_compose_v2
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
FIXME
EXPECTED RESULTS
community.docker.docker_compose_v2
should not fail and/or manage the root cause of the error.From what I understand the problem might be linked with the stderr output, see in the snippet below:
ACTUAL RESULTS
community.docker.docker_compose_v2
fails giving:"failed": true
,"msg": "Error when processing dummy: Error"
but also returns:
"rc": 0
After the failure the target system has the services up as expected, I cannot find docker logs about the supposed error.
If the user the same
docker compose up
of the module via shell in the same conditions ( see example playbook ) the shell does not fail..The text was updated successfully, but these errors were encountered: