-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Ansible / docker==7.0.0 docker compose up -> kwargs_from_env ssl_version #3194
Comments
also experiencing this, docker-compose seems broken with the latest version of the docker python module. |
Same here on: docker 6.1.3 works ansible -vvv error The full traceback is:
File "/tmp/ansible_community.docker.docker_compose_payload_87nbuv_v/ansible_community.docker.docker_compose_payload.zip/ansible_collections/community/docker/plugins/modules/docker_compose.py", line 727, in __init__
File "/usr/local/lib/python3.10/dist-packages/compose/cli/command.py", line 60, in project_from_options
return get_project(
File "/usr/local/lib/python3.10/dist-packages/compose/cli/command.py", line 152, in get_project
client = get_client(
File "/usr/local/lib/python3.10/dist-packages/compose/cli/docker_client.py", line 41, in get_client
client = docker_client(
File "/usr/local/lib/python3.10/dist-packages/compose/cli/docker_client.py", line 124, in docker_client
kwargs = kwargs_from_env(environment=environment, ssl_version=tls_version)
fatal: [network-installer]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"api_version": "auto",
"build": false,
"ca_cert": null,
"client_cert": null,
"client_key": null,
"debug": false,
"definition": null,
"dependencies": true,
"docker_host": "unix://var/run/docker.sock",
"env_file": null,
"files": null,
"hostname_check": false,
"nocache": false,
"profiles": null,
"project_name": null,
"project_src": "/etc/compose/",
"pull": false,
"recreate": "smart",
"remove_images": null,
"remove_orphans": false,
"remove_volumes": false,
"restarted": false,
"scale": null,
"services": null,
"ssl_version": null,
"state": "present",
"stopped": false,
"timeout": null,
"tls": false,
"tls_hostname": null,
"use_ssh_client": false,
"validate_certs": false
}
},
"msg": "Configuration error - kwargs_from_env() got an unexpected keyword argument 'ssl_version'"
} |
The Please consider pinning at least by major version to avoid surprise breakage like this. |
See also: upgrade notes in the release @ https://github.com/docker/docker-py/releases/tag/7.0.0 |
In
(See file |
Compose v1 (the Python version) is no longer maintained or supported. Compose v2 is bundled with Docker Desktop, included in the apt/yum repos for Docker Engine on Linux, available standalone on GitHub @ https://github.com/docker/compose/releases, etc. |
Do I understand you correctly that I am confused since the change in release 7.0.0 (6.1.3...7.0.0#diff-c40bbe508dae196428f3740f4aa8fbd143f8e3c0d80aa3e6952938cb2f90addbL332) changed the Here is a basic example of mine: - name: Deploy traefik
community.docker.docker_compose:
project_src: "{{ project_directory }}"
state: present
become: true |
compose v2 is written in Go, not in Python. compose v1 does not work with Docker SDK for Python 7.0.0+, only with versions up to 6.x.y. You need to pin the version of Docker SDK for Python to avoid installing an invalid combination of the no longer maintained docker-compose v1 and Docker SDK for Python.
|
@marcsc13 , You are right, |
docker compose (v2) is not available on many current LTS Linux distributions, e.g. Ubuntu Server 22.04. It only has docker-compose (v1), docker compose (v2) is not available without installing docker from third party repos. So I think forcing the world to v2 cannot be a solution here. If docker-compose v1.29.2 python lib is not compatible with docker-py 7.0.0 this should be reflected in its dependencies (docker<7.0.0) But honestly, docker-py 7.x should simply not make changes which breaks the old docker-compose v1.29.2 We had to pin dozens of systems now to docker-py 6.1.3 because also our ansible based deployments were broken. Luckily we noticed that bug on a test system before any live-servers got affected. Ansible (which is very wildly used for docker compose deployments) itself still does not have a stable compose v2 implementation. |
Same problem... Very unpleasant experience... Had to degrade to 6.1.3 |
Same problem for me as well. Maybe a "compat" function with deprecation message would have been a smoother transition. |
to resolve this issue you need to downgrade the version of docker:
|
Docker compatibility is fixed in ansible collection community.docker Version 3.5.0 https://github.com/ansible-collections/community.docker/blob/main/CHANGELOG.rst#v3-5-0 It is currently not part of the ansible-community release: https://github.com/ansible-community/ansible-build-data/blob/main/9/CHANGELOG-v9.rst You can install the new version of the collection manually: |
unfortunatly not yet a complete solution.
docker-compose command is broken. not sure if there will be a fixed python docker-compose version. UPDATE: There won't be a new release of v1 of docker-compose.
There is some work on a new docker_compose_v2 ansible module. not released yet.
so currently the only option is to downgrade the python docker library |
The fix does not cover docker_compose nor claims it does. The only thing that changes for the docker_compose module is that its documentation now mentionst that you need Docker SDK for Python < 7.0.0 (https://docs.ansible.com/ansible/devel/collections/community/docker/docker_compose_module.html#requirements).
If anyone wants to pick up that work, I'll happily help. |
@pgassmann either it is broken again with version 3.6.0 of community.docker, or your suggestion doesn't work. I've pinned all of the collections into my project and it just broke after updating to the latest collection version for me too. |
@agowa you need to restrict the version of Docker SDK for Python. That's the only way to fix this. |
On the controller I've Edit: Oh, docker SDK is |
Works around docker/docker-py#3194
* Fixed bug with docker version 7.0.0, which includes the command as a replace of . See docker/docker-py#3194 * fix my dislexya * looking for the correct version of docker-compose * remove changelog fragment
docker/docker-py#3194 forces downgrade to docker 6.1.3
Update: In the lastest ansible release 9.2.0, the new docker_compose_v2 modules are available. there's a separate module for more specific docker compose pull tasks: https://docs.ansible.com/ansible/latest/collections/community/docker/docker_compose_v2_pull_module.html#ansible-collections-community-docker-docker-compose-v2-pull-module |
Docker Compose v2 is worth the switch, btw. |
Hello
Env :
Debian 12, python3.9.2, Docker version 24.0.7, build afdd53b
With fresh pip install docker==7.0.0
My task is failing with this error :
With the 6.1.3 it's ok.
It looks like if i run it manually (directly on the target host) with (pip) docker===7.0.0 it's working....
Cheers !
The text was updated successfully, but these errors were encountered: