Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyring auth stopped working since 21.1 #9870

Closed
1 task done
ffissore opened this issue Apr 26, 2021 · 11 comments
Closed
1 task done

Keyring auth stopped working since 21.1 #9870

ffissore opened this issue Apr 26, 2021 · 11 comments
Labels
C: keyring Related to pip's keyring integration resolution: no action When the resolution is to not do anything

Comments

@ffissore
Copy link

Description

PR #8687 fixed issue #8090 by changing the default value of allow_keyring from True to False
This change, combined with google "artifact registry" returning 403 when calling it without proper headers, resulted in breaking our CI pipeline

Please consider adding 403 as another accepted "auth error" HTTP status code

Expected behavior

No response

pip version

21.1

Python version

3.7.9

OS

linux

How to Reproduce

  1. Get package from a private google artifact registry repo
  2. Then run pip install package-name
  3. Despite having everything properly configured, pip is unable to download the package

Output

No response

Code of Conduct

@ffissore ffissore added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Apr 26, 2021
@sbidoul sbidoul added this to the 21.1.1 milestone Apr 26, 2021
@sbidoul
Copy link
Member

sbidoul commented Apr 26, 2021

I'm tentatively adding this to 21.1.1 as this might be a regression.

@sbidoul sbidoul removed this from the 21.1.1 milestone Apr 30, 2021
@sbidoul
Copy link
Member

sbidoul commented Apr 30, 2021

Removing from 21.1.1 as the problem and the potential fix are not obvious and we need to get a bugfix release out soon.

@ffissore have you got feedback from Google ?

@ffissore
Copy link
Author

Yes, they acknowledged the issue and will discuss how to handle this change in pip

@sjprice
Copy link

sjprice commented May 3, 2021

@ffissore & @sbidoul - as of today, this has bitten my team and I. We're keen to see resolved (either GAR or pip)!

@sjprice
Copy link

sjprice commented May 6, 2021

I got an update from Google, and it was marked as fixed last week:

Google has changed status code from 403 to 401 in case authentication fails which should make pip use keyring.

I would expect it to be available next week - day may vary depending on Google Cloud regions.

@looztra
Copy link

looztra commented May 14, 2021

not sure it is enough. Now when I have a GAR declared in my pip.conf I get an auth prompt from the GAR.
So the keyrings.google-artifactregistry-auth has to be installed before declaring a GAR in pip.conf.
It worked previously :(

This is problematic in CI workflows, because when tox creates a new venv, if the pip.conf refers to a GAR, it cannot install dependencies as it does not have the keyrings.google-artifactregistry-auth yet.

@sjprice how did you contact "google"? By "google", do you mean the maintainers of the keyrings.google-artifactregistry-auth?

@looztra
Copy link

looztra commented May 14, 2021

For the record, I found a workaround to make tox work but I think I should not have to use it:

  • use a custom install_command:
[testenv]
install_command = {toxinidir}/path/to/tox_custom_install_command.sh {opts} {packages}
  • tox_custom_install_command.sh content:
#!/usr/bin/env bash

PIP_CONFIG_FILE=/dev/null pip install --upgrade pip==21.1.1
PIP_CONFIG_FILE=/dev/null pip install 'keyring>=23.0.1'
PIP_CONFIG_FILE=/dev/null pip install 'keyrings.google-artifactregistry-auth>=0.0.2'
pip install "$@"

@ffissore
Copy link
Author

I just got an update from google. They rolled out the change that makes their Artifact Registry return a 401 rather than a 403.
I tested it with the latest pip 21.1.1 and I confirm it works

@sbidoul
Copy link
Member

sbidoul commented May 17, 2021

Excellent news. Thanks for the follow-up, @ffissore.

Shall we then close this issue and associated PR ?

@sbidoul sbidoul added C: keyring Related to pip's keyring integration resolution: no action When the resolution is to not do anything and removed S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels May 17, 2021
@ffissore
Copy link
Author

At this point, I am good, but I don't know if other indexes are affected. You know more about the pip ecosystem: feel free to close both issue and PR

@sbidoul
Copy link
Member

sbidoul commented May 17, 2021

As we have not heard issues with other indexes, I'm going to close it, then.

@sbidoul sbidoul closed this as completed May 17, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C: keyring Related to pip's keyring integration resolution: no action When the resolution is to not do anything
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants