pypa / gh-action-pypi-publish

The blessed :octocat: GitHub Action, for publishing your :package: distribution files to PyPI, the tokenless way: https://github.com/marketplace/actions/pypi-publish
https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
BSD 3-Clause "New" or "Revised" License
930 stars 87 forks source link

Token request failed: the index produced an unexpected 503 response #239

Closed tovrstra closed 5 months ago

tovrstra commented 5 months ago

I'm trying to use this action but occasionally, not always, run into the following error:

Error: Trusted publishing exchange failure: 
Token request failed: the index produced an unexpected
503 response.

An example can be found here: https://github.com/reproducible-reporting/stepup-core/actions/runs/9147062777/job/25148013663

My workflow file causing this issue:

https://github.com/reproducible-reporting/stepup-core/blob/ac0f071cde3dbb8bf18b7fa2ae7f96a3f8b14fc5/.github/workflows/release.yaml

This workflow is based on the Python Packaging User Guide:

https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/

(I've updated actions versions.)

webknjaz commented 5 months ago

@woodruffw @di is something up with PyPI?

webknjaz commented 5 months ago

@tovrstra https://status.python.org shows some error spikes. Perhaps, restarting the job will help.

tovrstra commented 5 months ago

Thanks for the link. I hadn't realized it could just be a server-side issue.

webknjaz commented 5 months ago

@woodruffw hey, this seems like an opportunity to update the error message to state that 5xx might be server errors and maybe even link the status page portal? WDYT?

woodruffw commented 5 months ago

@woodruffw hey, this seems like an opportunity to update the error message to state that 5xx might be server errors and maybe even link the status page portal? WDYT?

SGTM, although I won't get to this until after June 5. Taking some time off, but happy to do it after then 🙂

woodruffw commented 5 months ago

@woodruffw hey, this seems like an opportunity to update the error message to state that 5xx might be server errors and maybe even link the status page portal? WDYT?

Hmm, I checked and the full error message does emphasize that it might be a server error, it was just truncated above:

Token request failed: the index produced an unexpected
{status_code} response.

This strongly suggests a server configuration or downtime issue; wait
a few minutes and try again.

Agreed about the status page though, I'll send a PR for that.