gh-action-pypi-publish: HTTPError: 400 Bad Request from https://test.pypi.org/legacy/ (with no additional information)
Hello team!
I’ve implemented this action into my workflow here, but for nearly every build (I’m unsure of why it sometimes passes) I am getting a failure on this job (e.g. this instance) with only the following showing in the logs:
Transparency log entry created with index: 148295038
Uploading distributions to https://test.pypi.org/legacy/
Uploading rat_king_parser-3.1.5-py3-none-any.whl
WARNING Error during upload. Retry with the --verbose option for more details.
ERROR HTTPError: 400 Bad Request from https://test.pypi.org/legacy/
Bad Request
I’m unsure of how to increase the verbosity via Actions to learn more about the request, and strangely, the package still ends up deployed on test.pypi.org even with the failure. But the pipeline on GitHub shows it as a failure all the same.
I was wondering if you all had any insight into what can cause this issue - Please let me know if I can provide additional logging in order to help triage.
Thank you for your hard work!
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (6 by maintainers)
Commits related to this issue
- Using config from: https://github.com/pypa/gh-action-pypi-publish/issues/303 — committed to RX-Run3/rx_selection by deleted user 2 years ago
- Stop trying to publish to test pypi for now https://github.com/pypa/gh-action-pypi-publish/issues/303 Signed-off-by: Nick Diego Yamane <nickdiego@igalia.com> — committed to nickdiego/compiledb by nickdiego 2 years ago
@webknjaz Might be nice to include the full error message at the lowest level of verbosity to avoid situations like this in the future.
Hi @jeFF0Falltrades,
I have the same problem, see this. How do you specify that you want to publish to master? I have this in my publishing section:
@di well, we can’t control individual messages Twine prints out. We call Twine via CLI since there’s no public API (https://github.com/pypa/twine/issues/194 / https://github.com/pypa/twine/pull/361).
We can only flip the default value of the verbose input but that would generate a lot of output confusing people…
Closing, since the mysteries reported above seem to have been solved by now…
Thank you for the great conversation here!
For my part, I was able to resolve this issue, and it turned out to be a user error: I had not restricted my publishing actions to the master branch, so every time a new tag was pushed to the repo, the workflow was triggered twice - Once for the master branch, and once for the new tag.
Adding
verbose: trueto my workflow YAML did indeed help, as it alerted me to the true source of the 400 error code:The package was being uploaded twice: Successful on the first push to master, unsuccessful on the push to the tag as the release already existed after the push to master.
All of that said, I appreciate the work done in the repos referenced above that seek to emit the root error of the 400 response so that even if
verboseis not set, the user can see what the true cause of the issue is.Unless you want to address any other Issues raised here, please feel free to close this Issue at your discretion.