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

"Username and/or password are wrong" When entering correct credentials using Maturin #12133

Closed
nednoodlehead opened this issue Aug 25, 2022 · 7 comments

Comments

@nednoodlehead
Copy link

Describe the bug
Using Maturin (Rust module) to upload to Pypi gives the error: "Username and/or password are wrong", when the credentials are correct. I'm coming from this issue, orignally opened for that Module: PyO3/maturin#999
They are saying the error is from here

Expected behavior
I use the "maturin publish" command to upload to Pypi. It should create the module and upload it or whatever. (It does not do this)

To Reproduce
1). Write rust module, a quick one to copy is: https://github.com/letsgetrusty/word_counter
2). Open in IDE of choice (For me Pycharm)
3). Go into the IDE terminal (accessing powershell in a venv essentially)
4). Type: maturin publish
5). Enter username & password
6). Error:
⛔ Username and/or password are wrong
💥 maturin failed
Caused by: Username and/or password are wrong

My Platform

Additional context
Again, I'm coming from this issue: PyO3/maturin#999 (Closed as completed by maintainer)
(Which I don't see the original poster made a report)
-My account on Pypi is recently made, and DOES have multi-factor auth & email verification

  • I haven't been able to get the package to work in any environment that isn't a virtual environment (It's own can of worms)
  • I entered my password in a few different fashions: Slowly typing 1 by 1, copy & paste, log into site with that password (successful)
@nednoodlehead nednoodlehead added bug 🐛 requires triaging maintainers need to do initial inspection of issue labels Aug 25, 2022
@di
Copy link
Member

di commented Aug 26, 2022

The issue here is almost certainly with the client:

  • if the file already exists, PyPI will respond with a 400 status code and a body "File already exists".
    HTTPBadRequest,
    # Note: Changing this error message to something that doesn't
    # start with "File already exists" will break the
    # --skip-existing functionality in twine
    # ref: https://github.com/pypi/warehouse/issues/3482
    # ref: https://github.com/pypa/twine/issues/332
    "File already exists. See "
    + request.help_url(_anchor="file-name-reuse")
    + " for more information.",
  • if the credentials are incorrect, PyPI will respnod with a 403 status code and a body "Invalid or non-existent authentication information."
    BasicAuthFailedPassword(),
    "Invalid or non-existent authentication information. "
    "See {projecthelp} for more information.".format(
    projecthelp=request.help_url(_anchor="invalid-auth")
    ),

The client should be able to distinguish between these two responses.

@di di added awaiting-response PRs and issues that are awaiting author response and removed requires triaging maintainers need to do initial inspection of issue bug 🐛 labels Aug 26, 2022
@nednoodlehead
Copy link
Author

Solved. Created new account with a different password. I won't gaslight myself into thinking that I typed the password wrong 20+ times.
Broken account I guess

@DilecPadovani
Copy link

Solved. Created new account with a different password. I won't gaslight myself into thinking that I typed the password wrong 20+ times. Broken account I guess

How did you solve the issue? I get this error using password or the token:

🚀 Uploading 1 packages
⛔ Username and/or password are wrong
💥 maturin failed
  Caused by: Username and/or password are wrong

@happy-machine
Copy link

Same problem here

@miketheman miketheman removed the awaiting-response PRs and issues that are awaiting author response label Dec 16, 2022
@marcandre259
Copy link

marcandre259 commented Apr 5, 2024

-Same issue here- Nevermind, had to use __token__ as username

@henselman-petrusek
Copy link

Same issue here. To be explicit, the solution was:

(1) create an API token on PyPI
(2) when prompted, enter __token__ as the username and the API token as the password.

@di
Copy link
Member

di commented Oct 15, 2024

PyPI no longer supports uploading with username/password authentication since our mandatory 2FA policy went into effect: https://blog.pypi.org/posts/2023-12-13-2fa-enforcement/

Similar to the original issue, Maturin seems unable to distinguish between the different types of authentication failures PyPI may produce here.

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

No branches or pull requests

7 participants