gh-action-pypi-publish: Attestation error: "Verification failed: subject does not match distribution name"

I’m getting an error about invalid attestations trying to publish my project to PyPI. I use a pretty typical workflow: cibuildwheel to create wheels, and upload-artifact/download-artifact actions to collect all the wheels into one directory for this pypi upload action.

It looks like something is mangling a wheel name in the attestation subject in the process, as the upload fails on one of the wheels with this error:

Uploading spt3g-1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
WARNING  Error during upload. Retry with the --verbose option for more details. 
ERROR    HTTPError: 400 Bad Request from https://upload.pypi.org/legacy/        
         Invalid attestations supplied during upload: Could not verify the      
         uploaded artifact using the included attestation: Verification failed: 
         subject does not match distribution name:                              
         spt3g-1.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl !=
         spt3g-1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl   

This is my workflow, and this is the failed action run.

I’ve disabled attestations for now, but am reporting this so that it can be resolved for future releases.

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 1
  • Comments: 19 (18 by maintainers)

Commits related to this issue

Most upvoted comments

I’ve opened a PR in warehouse to bump the version: pypi/warehouse#18221

This has been merged and deployed.

We just released cibuildwheel 3.0, so I expect you’ll find out pretty soon if it’s not. 😃

The fix for this has been merged and included in a new release of pypi-attestations: v0.0.27

I’ve opened a PR in warehouse to bump the version: https://github.com/pypi/warehouse/pull/18221

Thanks for the ping. That Warehouse PR seems like the likely culprit, although I don’t understand the “why” of it yet – that bump should make wheel tag comparisons more permissive, not less. I’ll be able to diagnose more when I’m in front of a computer.