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

Trusted Publisher error message is confusing when project exists but user doesn't have ownership #17392

Open
unrealsolver opened this issue Jan 11, 2025 · 7 comments · May be fixed by #17405
Open

Comments

@unrealsolver
Copy link

Describe the bug

At 'Publishing', PyPI tells that "This project already exists: use the project's publishing settings here to create a Trusted Publisher for it." However, it can not find any projects by following that link.

Expected behavior

Publishing a new (non-existent) project should not raise an error that project already exists

To Reproduce

Actual steps to reproduce are unknown, however I did following:

  1. Considering you are logged in and account is ready to publish a package
  2. Go to Publish
  3. PyPI Project name: pyxlmapper
  4. Owner: unrealsolver
  5. Repository name: pyxlmapper
  6. Workflow name: python-pypi.yml
  7. Environment name: pypi
  8. Press Add button
  9. Observe an error (see Describe the bug section)

My Platform

Additional context

TestPyPI is working very well: https://test.pypi.org/project/pyxlmapper/

@unrealsolver unrealsolver added bug 🐛 requires triaging maintainers need to do initial inspection of issue labels Jan 11, 2025
@unrealsolver
Copy link
Author

Aslo, attaching the log from the publishing job just in case:
Job: https://github.com/unrealsolver/pyxlmapper/actions/runs/12727660052/job/35477433098

Error: Trusted publishing exchange failure: 
Token request failed: the server refused the request for the following reasons:

* `invalid-publisher`: valid token, but no corresponding publisher (All lookup strategies exhausted)

This generally indicates a trusted publisher configuration error, but could
also indicate an internal error on GitHub or PyPI's part.


The claims rendered below are **for debugging purposes only**. You should **not**
use them to configure a trusted publisher unless they already match your expectations.

If a claim is not present in the claim set, then it is rendered as `MISSING`.

* `sub`: `repo:unrealsolver/pyxlmapper:environment:pypi`
* `repository`: `unrealsolver/pyxlmapper`
* `repository_owner`: `unrealsolver`
* `repository_owner_id`: `1101771`
* `workflow_ref`: `unrealsolver/pyxlmapper/.github/workflows/python-pypi.yml@refs/tags/v0.0.2.4`
* `job_workflow_ref`: `unrealsolver/pyxlmapper/.github/workflows/python-pypi.yml@refs/tags/v0.0.2.4`
* `ref`: `refs/tags/v0.0.2.4`
* ```

@facutuesca
Copy link
Contributor

facutuesca commented Jan 13, 2025

Hi @unrealsolver ! Maybe the project already exists on PyPI.

The reason why the project page doesn't lead to anywhere might be because the owner of that project deleted all releases for it. For example, see this project which I own and deleted all releases of:

Image

The project page also looks like the project doesn't exist: https://test.pypi.org/project/empty-test-package-99/,

The link in the error message doesn't show you anything because it will only work if you're logged-in as the owner of the project, since it leads to the publishing settings for it.

@di
Copy link
Member

di commented Jan 13, 2025

Indeed, this project already exists and has no releases. @unrealsolver, a request to acquire the package name here should be straightforward if you would like to.

In the meantime, I think we can improve the error message to differentiate whether the user is actually able to create a publisher for the project or whether they are unable. I'll update the issue title accordingly.

@di di changed the title This project already exists error during publish Trusted Publisher error message is confusing when project exists but user doesn't have ownership Jan 13, 2025
@di di added trusted-publishing and removed requires triaging maintainers need to do initial inspection of issue labels Jan 13, 2025
@facutuesca
Copy link
Contributor

In the meantime, I think we can improve the error message to differentiate whether the user is actually able to create a publisher for the project or whether they are unable.

I'm working on this now

@facutuesca
Copy link
Contributor

PR open here: #17405

@unrealsolver
Copy link
Author

Thank you very much @di , @facutuesca for helping! I'll create a request and will try to claim the name. The issue could be closed (unless you want to keep it open before merging #17405)

@di
Copy link
Member

di commented Jan 14, 2025

We can keep it open until the error message is improved, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants