kolla-ansible -i ./all-in-one prechecks command not working

Bug #2066255 reported by Siddalingeshwar
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
kolla-ansible
New
Undecided
Unassigned

Bug Description

I was running this command but, I got the error like

TASK [mariadb : Get container facts] ********************************************************************************************************
task path: /usr/local/share/kolla-ansible/ansible/roles/mariadb/tasks/precheck.yml:8
Using module file /usr/local/share/kolla-ansible/ansible/library/kolla_container_facts.py
Pipelining is enabled.
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: root
<localhost> EXEC /bin/sh -c '/usr/bin/python3 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/requests/adapters.py", line 532, in send
    conn = self._get_connection(request, verify, proxies=proxies, cert=cert)
  File "/usr/local/lib/python3.10/dist-packages/requests/adapters.py", line 400, in _get_connection
    conn = self.poolmanager.connection_from_host(
  File "/usr/lib/python3/dist-packages/urllib3/poolmanager.py", line 245, in connection_from_host
    return self.connection_from_context(request_context)
  File "/usr/lib/python3/dist-packages/urllib3/poolmanager.py", line 257, in connection_from_context
    raise URLSchemeUnknown(scheme)
urllib3.exceptions.URLSchemeUnknown: Not supported URL scheme http+docker

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/docker/api/client.py", line 214, in _retrieve_server_version
    return self.version(api_version=False)["ApiVersion"]
  File "/usr/local/lib/python3.10/dist-packages/docker/api/daemon.py", line 181, in version
    return self._result(self._get(url), json=True)
  File "/usr/local/lib/python3.10/dist-packages/docker/utils/decorators.py", line 46, in inner
    return f(self, *args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/docker/api/client.py", line 237, in _get
    return self.get(url, **self._set_request_timeout(kwargs))
  File "/usr/local/lib/python3.10/dist-packages/requests/sessions.py", line 602, in get
    return self.request("GET", url, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.10/dist-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/requests/adapters.py", line 534, in send
    raise InvalidURL(e, request=request)
requests.exceptions.InvalidURL: Not supported URL scheme http+docker

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 107, in <module>
  File "<stdin>", line 99, in _ansiballz_main
  File "<stdin>", line 47, in invoke_module
  File "/usr/lib/python3.10/runpy.py", line 224, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.10/runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_kolla_container_facts_payload_9ej46t78/ansible_kolla_container_facts_payload.zip/ansible/modules/kolla_container_facts.py", line 132, in <module>
  File "/tmp/ansible_kolla_container_facts_payload_9ej46t78/ansible_kolla_container_facts_payload.zip/ansible/modules/kolla_container_facts.py", line 126, in main
  File "/tmp/ansible_kolla_container_facts_payload_9ej46t78/ansible_kolla_container_facts_payload.zip/ansible/modules/kolla_container_facts.py", line 74, in use_docker
  File "/usr/local/lib/python3.10/dist-packages/docker/api/client.py", line 197, in __init__
    self._version = self._retrieve_server_version()
  File "/usr/local/lib/python3.10/dist-packages/docker/api/client.py", line 221, in _retrieve_server_version
    raise DockerException(
docker.errors.DockerException: Error while fetching server API version: Not supported URL scheme http+docker
fatal: [localhost]: FAILED! => {
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.10/dist-packages/requests/adapters.py\", line 532, in send\n conn = self._get_connection(request, verify, proxies=proxies, cert=cert)\n File \"/usr/local/lib/python3.10/dist-packages/requests/adapters.py\", line 400, in _get_connection\n conn = self.poolmanager.connection_from_host(\n File \"/usr/lib/python3/dist-packages/urllib3/poolmanager.py\", line 245, in connection_from_host\n return self.connection_from_context(request_context)\n File \"/usr/lib/python3/dist-packages/urllib3/poolmanager.py\", line 257, in connection_from_context\n raise URLSchemeUnknown(scheme)\nurllib3.exceptions.URLSchemeUnknown: Not supported URL scheme http+docker\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/usr/local/lib/python3.10/dist-packages/docker/api/client.py\", line 214, in _retrieve_server_version\n return self.version(api_version=False)[\"ApiVersion\"]\n File \"/usr/local/lib/python3.10/dist-packages/docker/api/daemon.py\", line 181, in version\n return self._result(self._get(url), json=True)\n File \"/usr/local/lib/python3.10/dist-packages/docker/utils/decorators.py\", line 46, in inner\n return f(self, *args, **kwargs)\n File \"/usr/local/lib/python3.10/dist-packages/docker/api/client.py\", line 237, in _get\n return self.get(url, **self._set_request_timeout(kwargs))\n File \"/usr/local/lib/python3.10/dist-packages/requests/sessions.py\", line 602, in get\n return self.request(\"GET\", url, **kwargs)\n File \"/usr/local/lib/python3.10/dist-packages/requests/sessions.py\", line 589, in request\n resp = self.send(prep, **send_kwargs)\n File \"/usr/local/lib/python3.10/dist-packages/requests/sessions.py\", line 703, in send\n r = adapter.send(request, **kwargs)\n File \"/usr/local/lib/python3.10/dist-packages/requests/adapters.py\", line 534, in send\n raise InvalidURL(e, request=request)\nrequests.exceptions.InvalidURL: Not supported URL scheme http+docker\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"<stdin>\", line 107, in <module>\n File \"<stdin>\", line 99, in _ansiballz_main\n File \"<stdin>\", line 47, in invoke_module\n File \"/usr/lib/python3.10/runpy.py\", line 224, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib/python3.10/runpy.py\", line 96, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_kolla_container_facts_payload_9ej46t78/ansible_kolla_container_facts_payload.zip/ansible/modules/kolla_container_facts.py\", line 132, in <module>\n File \"/tmp/ansible_kolla_container_facts_payload_9ej46t78/ansible_kolla_container_facts_payload.zip/ansible/modules/kolla_container_facts.py\", line 126, in main\n File \"/tmp/ansible_kolla_container_facts_payload_9ej46t78/ansible_kolla_container_facts_payload.zip/ansible/modules/kolla_container_facts.py\", line 74, in use_docker\n File \"/usr/local/lib/python3.10/dist-packages/docker/api/client.py\", line 197, in __init__\n self._version = self._retrieve_server_version()\n File \"/usr/local/lib/python3.10/dist-packages/docker/api/client.py\", line 221, in _retrieve_server_version\n raise DockerException(\ndocker.errors.DockerException: Error while fetching server API version: Not supported URL scheme http+docker\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}

PLAY RECAP **********************************************************************************************************************************
localhost : ok=23 changed=0 unreachable=0 failed=1 skipped=15 rescued=0 ignored=0

can you please help me with this

Revision history for this message
Michael Sherman (msherman-uchicago) wrote :

I'm pretty sure this is caused by this recent docker-py error from a new version of the requests module.

https://github.com/docker/docker-py/issues/3256

I was able to workaround it by manually installing requests==2.31 into Kolla's virtualenv on the target host.

More generally, the workaround can be added to `docker_sdk_pip_packages` for the docker_sdk role in the Kolla Ansible collection.

```
docker_sdk_pip_packages:
  - "docker>=3.0.0,<7.0.0"
  - "requests<2.32" # workaround for https://github.com/docker/docker-py/issues/3256
```

Revision history for this message
Siddalingeshwar (siddu2tg19cs045) wrote :

Can you please help me out regarding how and where to locate these "docker_sdk_pip_packages". So that I can modify the "request" version to check the work around.

Revision history for this message
Maksim Petyakin (petru4o) wrote :

Hi, I did this:
pip list | grep '(docker|requests)' (view installed packages)
pip uninstall requests, Delete and reinstall pip install requests==2.31.0
it helped me, thanks Michael Sherman for the hint

Revision history for this message
Travis Best (tb2097) wrote :

To give a little more detail here...
for whatever user you did the initial install to, you need to modify the ansible_collection config file to put the exception in, so it is using the correct version (2.31.0) in the venv on the target machines.

To do this I needed to sudo su - then navigate to

/home/<deployment user>/.ansible/collections/ansible_collections/openstack/kolla/roles/docker_sdk/defaults

vi main.yml

```
docker_sdk_pip_packages:
  - "docker>=3.0.0,<7.0.0"
  - "requests<2.32" # workaround for https://github.com/docker/docker-py/issues/3256
```

Revision history for this message
Deepak (deepakkanda) wrote :
Download full text (16.0 KiB)

Hi,
I had a similar issue but requests less 2.32 still fails on two specific nodes. anyone have thoughts?

TASK [loadbalancer : Get container facts] ******************************************************************************************************************************
task path: /home/svrmanager/openstack_deployment/.venv/tata-antelope/share/kolla-ansible/ansible/roles/loadbalancer/tasks/precheck.yml:8
<nw01> ESTABLISH SSH CONNECTION FOR USER: serviceusr
<nw01> SSH: EXEC sshpass -d10 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="serviceusr"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o 'ControlPath="/home/svrmanager/.ansible/cp/9da2addcb5"' nw01 '/bin/sh -c '"'"'echo ~serviceusr && sleep 0'"'"''
<nw01> (0, b'/home/serviceusr\n', b'')
<nw01> ESTABLISH SSH CONNECTION FOR USER: serviceusr
<nw01> SSH: EXEC sshpass -d10 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="serviceusr"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o 'ControlPath="/home/svrmanager/.ansible/cp/9da2addcb5"' nw01 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /home/serviceusr/.ansible/tmp `"&& mkdir "` echo /home/serviceusr/.ansible/tmp/ansible-tmp-1716818453.4983635-55860-244673703959212 `" && echo ansible-tmp-1716818453.4983635-55860-244673703959212="` echo /home/serviceusr/.ansible/tmp/ansible-tmp-1716818453.4983635-55860-244673703959212 `" ) && sleep 0'"'"''
<nw01> (0, b'ansible-tmp-1716818453.4983635-55860-244673703959212=/home/serviceusr/.ansible/tmp/ansible-tmp-1716818453.4983635-55860-244673703959212\n', b'')
Using module file /home/svrmanager/openstack_deployment/.venv/tata-antelope/share/kolla-ansible/ansible/library/kolla_container_facts.py
<nw01> PUT /home/svrmanager/.ansible/tmp/ansible-local-546786k36th5u/tmplpx3ontf TO /home/serviceusr/.ansible/tmp/ansible-tmp-1716818453.4983635-55860-244673703959212/AnsiballZ_kolla_container_facts.py
<nw01> SSH: EXEC sshpass -d10 sftp -o BatchMode=no -b - -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="serviceusr"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o 'ControlPath="/home/svrmanager/.ansible/cp/9da2addcb5"' '[nw01]'
<nw01> (0, b'sftp> put /home/svrmanager/.ansible/tmp/ansible-local-546786k36th5u/tmplpx3ontf /home/serviceusr/.ansible/tmp/ansible-tmp-1716818453.4983635-55860-244673703959212/AnsiballZ_kolla_container_facts.py\n', b'')
<nw01> ESTABLISH SSH CONNECTION FOR USER: serviceusr
<nw01> SSH: EXEC sshpass -d10 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="serviceusr"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o 'ControlPath="/home/svrmanager/.ansible/cp/9da2addcb5"' nw01 '/bin/sh -c '"'"'chmod u+x /home/serviceusr/.ansible/tmp/ansible-tmp-1716818453.4983635-55860-244673703959212/ /home/serviceusr/.ansible/tmp/ansible-tmp-1716818453.4983635-55860-244673703959212/AnsiballZ_kolla_container_facts.py && sleep 0'"'"''
<nw01> (0, b'', b'')
<nw01> ESTABLISH SSH CONNECTION FOR USER: serviceusr
<nw01> SSH: EXEC sshpass -d10 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="serviceusr"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o 'ControlPath="/home/svrmanager/.ansible/cp/9da2addcb5"' -tt nw01 '/bin/sh -c '"'"'sudo -H -S -...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.