The installer fails if the target machine has pip-docker 3.0.1. It successes when pip-docker is downgraded to 3.0.0.
masterdocker on linux2.4.3.0-1Arch Linux and Ubuntucd awx/installerinventory to add the ssh credentials of the target machine (Ubuntu)ansible-playbook -i inventory install.yml
Successful installation.
Error: "Error connecting: load_config() got an unexpected keyword argument 'config_dict'"
After downgrading pip-docker from 3.0.1 to 3.0.0, there is no error.
confirm. Also downgrading to pip-docker 3.0.0, I still have the error
@kevin-zhaoshuai
This is how I downgraded to 3.0.0:
apt remove python-docker
pip install --upgrade pip
pip uninstall docker
pip install 'docker>=3.0.0,<3.0.1'
Also, what is the output of: pip list | grep docker, thanks
What task fails? This sounds as if it's an issue with the Ansible docker module, not the playbook itself.
@wenottingham
The task is Activate postgres container. I agree that the error could be upstream (the Ansible docker module).
Reading that task, it does sound like a generic issue with the docker_container module.
Please file that at https://github.com/ansible/ansible/
The issue is reproduced regardless _ansible_ . Downgrading to _docker==3.0.0_ doesn't help.
Just did:
import docker
c = docker.from_env()
and got:
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/site-packages/docker/client.py", line 81, in from_env
kwargs_from_env(kwargs))
File "/usr/lib/python2.7/site-packages/docker/client.py", line 38, in __init__
self.api = APIClient(args, *kwargs)
File "/usr/lib/python2.7/site-packages/docker/api/client.py", line 110, in __init__
config_dict=self._general_configs
TypeError: load_config() got an unexpected keyword argument 'config_dict'
Docker version is
Server Version: 17.12.0-ce
Regards
same with u @w7089
in ubuntu server 16.04.3
pip install 'docker>=3.0.0,<3.0.1'
or docker-3.1.0
I concur. the issue reproduces in all of the pip-docker versions I tried. 3.0.0, 3.0.1 and 3.1.0.
I am also using ubuntu 16.04.
downgrading to pip-docker 2.6.1 helped getting around the issue.
Same here. Doubt it's related to awx though. Seems like a problem with the module.
UPDATE:
If I manually go to the machine after the playbook fails and type
docker-compose up
in the directory where the compose file is placed, it run just fine with the most recent version of docker-py, but it fails with the downgraded one. Playbook also fails with the downgraded version with the following error (comes AFTER the error described in this page):
TASK [local_docker : Start the containers] ********************************************************************************************************************
fatal: [66.66.66.66]: FAILED! => {
"changed": false,
"errors": [],
"module_stderr": "Creating awx_memcached_1 ... \r\nCreating awx_rabbitmq_1 ... \r\nCreating awx_postgres_1 ... \r\n",
"module_stdout": "latest: Pulling from ansible/awx_web\nDigest: sha256:5978c1f818e8a77f94e503f2003b03b4f5193f40a0cb4b8dac53fe3e799ecffb\nStatus: Downloaded newer image for ansible/awx_web:latest\nlatest: Pulling from ansible/awx_task\nDigest: sha256:5c5a1a61aabe9ed02892221cb9420af74be9e34323c0bcd47e8c3fe8d8b14bf6\nStatus: Downloaded newer image for ansible/awx_task:latest\n"
}
MSG:
Error starting project __init__() got an unexpected keyword argument 'device_cgroup_rules'
I was having this issue on a centos 7 machine, solved with the help of this thread and also https://github.com/docker/compose/issues/1567
The module was only part of the issue for me, the other issue was docker-compose. I uninstalled any instances of docker-compose on the target machine and then reinstalled it using:
sudo curl -L https://github.com/docker/compose/releases/download/1.20.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
And then in the ansible role just don't use the module. Change the following:
- name: Start the containers
docker_service:
project_src: "{{ docker_compose_dir }}"
to
- name: Start the containers
command: /usr/bin/docker-compose up -d
args:
chdir: "{{ docker_compose_dir }}"
# pip list|grep docker
docker (3.2.1)
docker-py (1.10.6)
docker-pycreds (0.2.2)
dockerpty (0.4.1)
# docker-compose version
docker-compose version 1.20.1, build 5d8c71b
docker-py version: 3.1.4
CPython version: 3.6.4
OpenSSL version: OpenSSL 1.0.1t 3 May 2016
Hopefully this helps
@GraemeCrawford It is an elegant workaround, thanks, but it's not a resolution.
@yuanfm @GraemeCrawford @megakoresh @iamcomet The issue is fixed in _docker-py 3.1.3_
For me, even installing docker 3.1.3 resulted in errors. What I had to do was:
pip uninstall docker-py --no-cache-dir
pip install docker==3.1.4
And the error stopped.
Docker 18.03.0-ce, build 0520e24
docker (3.1.4)
docker-compose (1.20.0)
It also seems to work when you install docker or docker[tls] before docker-py.
My docker pip packages are (pip list | grep docker)
docker (3.2.1)
docker-py (1.10.6)
docker-pycreds (0.2.2)
@roegema : Confirmed it works. What i did is:
pip uninstall -y docker docker-py && pip install docker docker-compose
pip list | grep docker
docker 3.2.1
docker-compose 1.21.0
docker-py 1.10.6
docker-pycreds 0.2.2
dockerpty 0.4.1
Most helpful comment
For me, even installing docker 3.1.3 resulted in errors. What I had to do was:
And the error stopped.