Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 9, 2026

Jobs intermittently fail when pip encounters hash mismatches during package downloads from PyPI. This occurs due to corrupted downloads, network issues, or stale cache.

Changes

  • Add retry logic to pip installations - 3 retries with 5s delay on failure
  • Force cache bypass - Use --no-cache-dir to avoid corrupted cached packages
  • Apply to affected roles - openstacksdk and keycloak roles updated

Example

- name: Install openstacksdk
  ansible.builtin.pip:
    name: openstacksdk
    version: "{{ openstacksdk_version | default(omit) }}"
    extra_args: --no-cache-dir
  register: _openstacksdk_install
  retries: 3
  delay: 5
  until: _openstacksdk_install is succeeded

Pattern follows existing retry conventions in octavia, neutron, and keycloak roles.

Original prompt

This section details on the original issue you should resolve

<issue_title>Jobs fail with odd PyPI error</issue_title>
<issue_description>```
TASK [vexxhost.atmosphere.openstacksdk : Install openstacksdk] *****************
Friday 06 February 2026 06:07:40 +0000 (0:00:00.715) 0:13:13.071 *******
fatal: [instance]: FAILED! => {"changed": false, "cmd": ["/usr/bin/python3", "-m", "pip.main", "install", "openstacksdk==0.61.0"], "msg": "stdout: Collecting openstacksdk==0.61.0\n Downloading openstacksdk-0.61.0-py3-none-any.whl (1.4 MB)\n ━╸ 0.1/1.4 MB 2.1 MB/s eta 0:00:01\n\n:stderr: ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.\n openstacksdk==0.61.0 from https://files.pythonhosted.org/packages/c2/31/a3501e87efc4ad83ab998502d681dde5fefbfe7d75225cabe268f815dad6/openstacksdk-0.61.0-py3-none-any.whl#sha256=9894d3d510563dcfc50c4755287dbfbf98def1f37caf2cfc15e9d0e1fd5d9a41:\n Expected sha256 9894d3d510563dcfc50c4755287dbfbf98def1f37caf2cfc15e9d0e1fd5d9a41\n Got 46bcf2cefd2fb293cb033f99da785d2f5bf6af28e83cf0edf6526e3e75ffb73c\n\n"}


We need to figure out the root cause of this and why that fails sometimes and how to not make it kil the whole job.</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: mnaser <435815+mnaser@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix jobs failing with PyPI error on openstacksdk installation fix(pip): add retry logic for hash mismatch errors Feb 9, 2026
Copilot AI requested a review from mnaser February 9, 2026 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jobs fail with odd PyPI error

2 participants