ReadTimeout UnixHTTPConnectionPool

Bug #1809844 reported by alpha23
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla-ansible
Fix Released
Medium
Mark Goddard
Rocky
Fix Released
Medium
Unassigned
Stein
Fix Released
Medium
Unassigned
Train
Fix Released
Medium
Unassigned
Ussuri
Fix Released
Medium
Mark Goddard

Bug Description

During a kolla-ansible deploy, I frequently have encountered the following failure:

fatal: [localhost]: FAILED! => {"changed": true, "msg": "'Traceback (most recent call last):\\n File \"/tmp/ansible_kolla_docker_payload_OeUe5x/__main__.py\", line 835, in main\\n result = bool(getattr(dw, module.params.get(\\'action\\'))())\\n File \"/tmp/ansible_kolla_docker_payload_OeUe5x/__main__.py\", line 712, in create_volume\\n if not self.check_volume():\\n File \"/tmp/ansible_kolla_docker_payload_OeUe5x/__main__.py\", line 275, in check_volume\\n for vol in self.dc.volumes()[\\'Volumes\\'] or list():\\n File \"/usr/local/lib/python2.7/dist-packages/docker/utils/decorators.py\", line 34, in wrapper\\n return f(self, *args, **kwargs)\\n File \"/usr/local/lib/python2.7/dist-packages/docker/api/volume.py\", line 38, in volumes\\n return self._result(self._get(url, params=params), True)\\n File \"/usr/local/lib/python2.7/dist-packages/docker/utils/decorators.py\", line 46, in inner\\n return f(self, *args, **kwargs)\\n File \"/usr/local/lib/python2.7/dist-packages/docker/api/client.py\", line 191, in _get\\n return self.get(url, **self._set_request_timeout(kwargs))\\n File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 521, in get\\n return self.request(\\'GET\\', url, **kwargs)\\n File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 508, in request\\n resp = self.send(prep, **send_kwargs)\\n File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 618, in send\\n r = adapter.send(request, **kwargs)\\n File \"/usr/local/lib/python2.7/dist-packages/requests/adapters.py\", line 521, in send\\n raise ReadTimeout(e, request=request)\\nReadTimeout: UnixHTTPConnectionPool(host=\\'localhost\\', port=None): Read timed out. (read timeout=60)\\n'"}

The ReadTimeout occurs on different tasks. The underlying cause is that the docker daemon is not responding within the default 60 second timeout. The workaround when running docker or docker-compose is to set timeout environment variables, e.g.:

export DOCKER_CLIENT_TIMEOUT=120
export COMPOSE_HTTP_TIMEOUT=120

See also https://github.com/docker/compose/issues/3927

However, I have been unable to set these directly in the kolla-ansible playbook 'ansible/site.yml' (via environment variables) and setting the environment variables in bash has no affect on the read timeout.

Does anyone know how to set the docker timeout variable variables in kolla-ansible?

I have temporarily set the nice priority value of the dockerd process to -10 which does avoid the the issue some of the time. Setting the timeout value would be the correct solution.

stable/queens release

alpha23 (alpha23)
description: updated
Revision history for this message
Mark Goddard (mgoddard) wrote :

I don't think this is currently possible. From looking at the docker-py code [1], we should be able to pass a timeout argument to the docker.APIClient constructor. We'd need a new module argument for the kolla_docker module in kolla-ansible.

[1] https://github.com/docker/docker-py/blob/c344660f20353bedec6c18ef22b25b3083c8fe3f/docker/api/client.py#L102

Revision history for this message
alpha23 (alpha23) wrote :

I could not find a way to accomplish this without hard-coding the timeout in /usr/local/lib/python2.7/dist-packages/docker/api/client.py

I would be in favor of an argument. This issue could easily be solved with an argument as it is with other docker clients. Reconfiguring kolla was not possible without changing the timeout.
 Setting the nice priority value ended up working only some of the time. Hard-coding source code that may be overwritten with future updates is not the right solution.

Revision history for this message
Mark Goddard (mgoddard) wrote :

I have hit this issue in virtualised environments that are heavily loaded.

affects: kolla → kolla-ansible
Changed in kolla-ansible:
status: New → Triaged
Mark Goddard (mgoddard)
Changed in kolla-ansible:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (master)

Fix proposed to branch: master
Review: https://review.opendev.org/696316

Changed in kolla-ansible:
assignee: nobody → Mark Goddard (mgoddard)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (master)

Reviewed: https://review.opendev.org/696316
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=01050dc01fa8558eb453c48faa2a8efd398c5367
Submitter: Zuul
Branch: master

commit 01050dc01fa8558eb453c48faa2a8efd398c5367
Author: Mark Goddard <email address hidden>
Date: Wed Nov 27 14:52:03 2019 +0000

    Support configuration of Docker client timeout

    Adds support for configuration of the Docker client timeout via
    'docker_client_timeout'.

    This change also increases the default timeout to 120 seconds, as we
    sometimes see timeouts in CI and heavily loaded or underpowered
    environments. Increasing 'docker_client_timeout' further may be helpful
    in cases where Docker reports 'Read timed out'.

    Change-Id: I73745771078cb2c0ebae2b1d87ba2c4c12958d82
    Closes-Bug: #1809844

Changed in kolla-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/698257

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/698258

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.opendev.org/698259

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (stable/stein)

Reviewed: https://review.opendev.org/698258
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=f1fe39bcafbe51bc2a4174b591dc1095d7410686
Submitter: Zuul
Branch: stable/stein

commit f1fe39bcafbe51bc2a4174b591dc1095d7410686
Author: Mark Goddard <email address hidden>
Date: Wed Nov 27 14:52:03 2019 +0000

    Support configuration of Docker client timeout

    Adds support for configuration of the Docker client timeout via
    'docker_client_timeout'.

    This change also increases the default timeout to 120 seconds, as we
    sometimes see timeouts in CI and heavily loaded or underpowered
    environments. Increasing 'docker_client_timeout' further may be helpful
    in cases where Docker reports 'Read timed out'.

    Change-Id: I73745771078cb2c0ebae2b1d87ba2c4c12958d82
    Closes-Bug: #1809844
    (cherry picked from commit 01050dc01fa8558eb453c48faa2a8efd398c5367)

tags: added: in-stable-stein
tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (stable/rocky)

Reviewed: https://review.opendev.org/698259
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=e414adf0353e30fa7d71b53e4cc3d6c580df35fc
Submitter: Zuul
Branch: stable/rocky

commit e414adf0353e30fa7d71b53e4cc3d6c580df35fc
Author: Mark Goddard <email address hidden>
Date: Wed Nov 27 14:52:03 2019 +0000

    Support configuration of Docker client timeout

    Adds support for configuration of the Docker client timeout via
    'docker_client_timeout'.

    This change also increases the default timeout to 120 seconds, as we
    sometimes see timeouts in CI and heavily loaded or underpowered
    environments. Increasing 'docker_client_timeout' further may be helpful
    in cases where Docker reports 'Read timed out'.

    Change-Id: I73745771078cb2c0ebae2b1d87ba2c4c12958d82
    Closes-Bug: #1809844
    (cherry picked from commit 01050dc01fa8558eb453c48faa2a8efd398c5367)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (stable/train)

Reviewed: https://review.opendev.org/698257
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=efe6083bb36ef90ea40db73dd633507cab0d59ec
Submitter: Zuul
Branch: stable/train

commit efe6083bb36ef90ea40db73dd633507cab0d59ec
Author: Mark Goddard <email address hidden>
Date: Wed Nov 27 14:52:03 2019 +0000

    Support configuration of Docker client timeout

    Adds support for configuration of the Docker client timeout via
    'docker_client_timeout'.

    This change also increases the default timeout to 120 seconds, as we
    sometimes see timeouts in CI and heavily loaded or underpowered
    environments. Increasing 'docker_client_timeout' further may be helpful
    in cases where Docker reports 'Read timed out'.

    Change-Id: I73745771078cb2c0ebae2b1d87ba2c4c12958d82
    Closes-Bug: #1809844
    (cherry picked from commit 01050dc01fa8558eb453c48faa2a8efd398c5367)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 7.2.0

This issue was fixed in the openstack/kolla-ansible 7.2.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 8.1.0

This issue was fixed in the openstack/kolla-ansible 8.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 9.0.1

This issue was fixed in the openstack/kolla-ansible 9.0.1 release.

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.