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

[V2.13.0] Artifact Registry PyPI Keyring: No credentials could be found. #1166

Open
lcasassa opened this issue Oct 18, 2022 · 1 comment
Open
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@lcasassa
Copy link

Hi,

I wanted to report that when I upgraded to 2.13.0 from 2.12.0 I see an error. I'm running on google cloud build and error occurs when pulling from a private artifacts registry in GCP using keyrings (keyrings.google-artifactregistry-auth). It should find the default service account through the metadata endpoint.

Step #1 - "Build":   Exception
Step #1 - "Build": 
Step #1 - "Build":   Failed to find credentials, Please run: `gcloud auth application-default login or export GOOGLE_APPLICATION_CREDENTIALS=<path/to/service/account/key>`
Step #1 - "Build": 
Step #1 - "Build":   at /usr/local/lib/python3.8/site-packages/keyrings/gauth.py:59 in get_password
Step #1 - "Build":        55│     except Exception as e:
Step #1 - "Build":        56│       logging.warning("Failed to retrieve credentials from gcloud: {0}".format(e))
Step #1 - "Build":        57│ 
Step #1 - "Build":        58│     logging.warning("Artifact Registry PyPI Keyring: No credentials could be found.")
Step #1 - "Build":     →  59│     raise Exception("Failed to find credentials, Please run: `gcloud auth application-default login or export GOOGLE_APPLICATION_CREDENTIALS=<path/to/service/account/key>`")
Step #1 - "Build":        60│ 
Step #1 - "Build":        61│   def set_password(self,service,username,password):
Step #1 - "Build":        62│     raise NotImplementedError()
Step #1 - "Build":        63│ 
Step #1 - "Build": 

I downgraded to 2.12.0 and the build works again.

In case you want some context, I am using poetry and the pyproject.toml file looks something like this:

[tool.poetry]
name = "my-other-package"
version = "0.0.0"
description = ""
authors = [""]
readme = ""


[[tool.poetry.source]]
name = "my-package"
url = "https://us-central1-python.pkg.dev/my_project_ip/my-package/simple/"
secondary = true

[tool.poetry.dependencies]
python = "^3.8.13"
my_package = { version = "*", source = "my-package" }

[build-system]
requires = ["poetry_core>=1.0.0", "keyrings.google-artifactregistry-auth==1.0.0", "poetry-dynamic-versioning"]
build-backend = "poetry_dynamic_versioning.backend"
@clundin25 clundin25 added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Oct 20, 2022
@diegobatt
Copy link

We are experiencing the same for 2.23.1, downgrading to 2.23.0 solves the issues as described by the OP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants