pip install with flag "--index-url" and "--extra-index-url" from GitLab results in "ERROR: HTTP error 404 while getting"

Viewed 63

We are using a private GitLab Enterprise installation for storing Python modules as described in the article PyPI packages in the Package Registry
The following command was used inside containers to install the privately hosted packages:

pip install <package_name_01> <package_name_02> \
    --index-url https://<personal_access_token_name_package_01>:<personal_access_token_package_01>@gitlab.example.com/api/v4/projects/<project_id_package_01>/packages/pypi/simple \
    --extra-index-url https://<personal_access_token_name_package_02>:<personal_access_token_package_02>@gitlab.example.com/api/v4/projects/<project_id_package_02>/packages/pypi/simple 

As seen in the example, we use packages from different GitLab projects. Therefore, we had to specify each GitLab project as --index-url and --extra-index-url. The showed solution was working but since a few days, we receive the following error:

pip install <package_name_01> <package_name_02> \
> --index-url https://<personal_access_token_name_package_01>:<personal_access_token_package_01>@gitlab.example.com/api/v4/projects/<project_id_package_01>/packages/pypi/simple \
> --extra-index-url https://<personal_access_token_name_package_02>:<personal_access_token_package_02>@gitlab.example.com/api/v4/projects/<project_id_package_02>/packages/pypi/simple
Looking in indexes: https://<personal_access_token_name_package_01>:****@gitlab.example.com/api/v4/projects/<project_id_package_01>/packages/pypi/simple, https://<personal_access_token_name_package_02>:****@gitlab.example.com/api/v4/projects/<project_id_package_02>/packages/pypi/simple
Collecting <package_name_01>
  ERROR: HTTP error 404 while getting https://gitlab.example.com/api/v4/projects/<project_id_package_01>/packages/pypi/files/55a5d545c01aee6ef5488cb18f9d19eee9d79XXXXXXX/<package_name_01>-0.0.18-py3-none-any.whl#sha256=55a5d545c01aee6ef5488cb18f9d19eee9d79XXXXXXX (from https://gitlab.example.com/api/v4/projects/<project_id_package_01>/packages/pypi/simple/<package_name_01>/) (requires-python:>=3.6)
ERROR: Could not install requirement <package_name_01>==0.0.18 from https://gitlab.example.com/api/v4/projects/<project_id_package_01>/packages/pypi/files/55a5d545c01aee6ef5488cb18f9d19eee9d79XXXXXXX/<package_name_01>-0.0.18-py3-none-any.whl#sha256=55a5d545c01aee6ef5488cb18f9d19eee9d79XXXXXXX because of HTTP error 404 Client Error: Not Found for url: https://gitlab.example.com/api/v4/projects/<project_id_package_01>/packages/pypi/files/55a5d545c01aee6ef5488cb18f9d19eee9d79XXXXXXX/<package_name_01>-0.0.18-py3-none-any.whl for URL https://gitlab.example.com/api/v4/projects/<project_id_package_01>/packages/pypi/files/55a5d545c01aee6ef5488cb18f9d19eee9d79XXXXXXX/<package_name_01>-0.0.18-py3-none-any.whl#sha256=55a5d545c01aee6ef5488cb18f9d19eee9d79XXXXXXX (from https://gitlab.example.com/api/v4/projects/<project_id_package_01>/packages/pypi/simple/<package_name_01>/) (requires-python:>=3.6)

Installing the modules separately works however...

pip install <package_name_01> --index-url https://<personal_access_token_name_package_01>:<personal_access_token_package_01>@gitlab.example.com/api/v4/projects/<project_id_package_01>/packages/pypi/simple
pip install <package_name_02> --index-url https://<personal_access_token_name_package_02>:<personal_access_token_package_02>@gitlab.example.com/api/v4/projects/<project_id_package_02>/packages/pypi/simple

Does anyone have an idea what goes wrong here?

1 Answers
Related