-
Notifications
You must be signed in to change notification settings - Fork 79
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
🐛 [BUG] - Failed to release v2.6.0
#432
Comments
The logs of the 2.5.2 release have expired so I am unable to compare them to this failed run. https://github.com/google/slo-generator/actions/runs/6826860828/job/18567693525 |
For the record, here is the output for the 2.6.0 release that failed:
|
I managed to reproduce the error locally on my dev machine with:
The output: Uploading distributions to https://test.pypi.org/legacy/
Uploading slo_generator-2.6.0-py2.py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 116.5/116.5 kB • 00:00 • 50.2 MB/s
WARNING Error during upload. Retry with the --verbose option for more details.
ERROR HTTPError: 403 Forbidden from https://test.pypi.org/legacy/
Invalid or non-existent authentication information. See https://test.pypi.org/help/#invalid-auth for more information. The $ twine upload -r testpypi dist/* --verbose
Uploading distributions to https://test.pypi.org/legacy/
INFO dist/slo_generator-2.6.0-py2.py3-none-any.whl (91.2 KB)
INFO dist/slo-generator-2.6.0.tar.gz (66.4 KB)
INFO password set by command options
INFO username: __token__
INFO password: <hidden>
Uploading slo_generator-2.6.0-py2.py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 116.5/116.5 kB • 00:00 • 44.5 MB/s
INFO Response from https://test.pypi.org/legacy/:
403 Invalid or non-existent authentication information. See https://test.pypi.org/help/#invalid-auth for more information.
INFO <html>
<head>
<title>403 Invalid or non-existent authentication information. See https://test.pypi.org/help/#invalid-auth for more
information.</title>
</head>
<body>
<h1>403 Invalid or non-existent authentication information. See https://test.pypi.org/help/#invalid-auth for more
information.</h1>
Access was denied to this resource.<br/><br/>
Invalid or non-existent authentication information. See https://test.pypi.org/help/#invalid-auth for more information.
</body>
</html>
ERROR HTTPError: 403 Forbidden from https://test.pypi.org/legacy/
Invalid or non-existent authentication information. See https://test.pypi.org/help/#invalid-auth for more information. Notice how the /legacy endpoint seems linked to the Test PyPI instance, even without the
I tried to log in to Test PyPI with the credentials above. I get the following error: So there might an authentication issue indeed. But then I am not sure how the previous releases (up to 2.5.2) landed on the real instance of PyPI, while the upload URL explicitly points to the test instance. |
Every blog article about Twine and releasing to PyPI recommends using an access token instead of the usual username/password pair. For example: https://dev.to/arnu515/create-a-pypi-pip-package-test-it-and-publish-it-using-github-actions-part-1-3cp8 |
When this issue is solved, it would make sense to use OpenID Connect (OIDC) to create a passwordless connection between PyPI and GitHub Actions, as described in: https://pypi.org/manage/project/slo-generator/settings/publishing/ |
Running the deployment code against release $ git checkout v2.6.0
$ make clean install_twine build
$ twine upload dist/*
twine upload dist/*
Uploading distributions to https://upload.pypi.org/legacy/
Uploading slo_generator-2.6.0-py2.py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 116.5/116.5 kB • 00:00 • 975.0 kB/s
WARNING Error during upload. Retry with the --verbose option for more details.
ERROR HTTPError: 403 Forbidden from https://upload.pypi.org/legacy/
Invalid or non-existent authentication information. See https://pypi.org/help/#invalid-auth for more information. Not sure how to interpret that. The username and password match the real instance of PyPI. |
Got it. PyPI enforces 2FA since Jan 1, 2024: https://blog.pypi.org/posts/2023-12-13-2fa-enforcement/ As a result, an API Token or Trusted Publisher must be used to upload packages. A username/password pair can no longer be used. Release Actions: set up Trusted Publisher for a credential-free experience. |
I needed to confirm whether 2FA was actually the source of the issue. As the fix for this bug did not trigger a new |
For the record, I'm now using As a nice plus, this allowed me also to get rid of the |
I expect Twine to run smoothly now that we have switched to a passwordless authentication. I do remember a couple of warnings though regarding the deprecation of |
To be fair, In the end it's just a matter of preference, I personally prefer having a single file for the entire package definition ... |
SLO Generator Version
v2.6.0
Python Version
3.9
What happened?
The
release/release-pipy
anddeploy/cloudrun
jobs of the v2.6.0 release pipeline failed:https://github.com/google/slo-generator/actions/runs/7960838943 (
release/release-pipy
)https://github.com/google/slo-generator/actions/runs/7960838947 (
deploy/cloudrun
)Note that the
deploy/cloudrun
failure might be a consequence of therelease/release-pipy
failure.What did you expect?
Release pipeline completes successfully.
Screenshots
No response
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: