pypi / warehouse

The Python Package Index
https://pypi.org
Apache License 2.0
3.59k stars 965 forks source link

Upload failed (403): Invalid or non-existent authentication information. #4192

Closed muditjai closed 6 years ago

muditjai commented 6 years ago

I am getting

> Upload failed (403): Invalid or non-existent authentication information.
> error: Upload failed (403): Invalid or non-existent authentication information.

error while trying to upload my first package.

My .pypirc looks like this

[distutils]
index-servers =
pypi

[pypi]
repository: https://upload.pypi.org/legacy/
username: 
password: 

I tried with both putting username, password in .pypirc and without it, but it always asks for password and then fails. I'm on windows.

di commented 6 years ago

Hi @muditjai, sorry you're having problems. Can you confirm that you can log into https://pypi.org with the username/password you're attempting to use?

di commented 6 years ago

Closing this due to lack of response. Feel free to reopen if this is still a problem for you.

dyspop commented 6 years ago

I've been having this issue today. I tried a number of suggestions with using a ~/.pypirc in various formats. Currently my .pypirc looks like this:

[pypi]
repository: https://upload.pypi.org/legacy/
username: dyspop

[pypitest]
repository: https://test.pypi.org/legacy/
username: dyspop

and i've tried to run

twine upload --repository-url https://test.pypi.org/legacy/ dist/*

as well as

python setup.py register sdist upload

The output looks about the same either way with different levels of trace:

python setup.py register sdist upload
running register
running egg_info
writing responsysrest.egg-info/PKG-INFO
writing dependency_links to responsysrest.egg-info/dependency_links.txt
writing requirements to responsysrest.egg-info/requires.txt
writing top-level names to responsysrest.egg-info/top_level.txt
reading manifest file 'responsysrest.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: manifest_maker: MANIFEST.in, line 1: unknown action '*/tests*/*'

warning: manifest_maker: MANIFEST.in, line 2: unknown action 'config.json'

warning: manifest_maker: MANIFEST.in, line 3: unknown action 'README.*'

writing manifest file 'responsysrest.egg-info/SOURCES.txt'
running check
We need to know who you are, so please choose either:
 1. use your existing login,
 2. register as a new user,
 3. have the server generate a new password for you (and email it to you), or
 4. quit
Your selection [default 1]: 
1
Username: dyspop
Password: 
Registering responsysrest to https://upload.pypi.org/legacy/
Server response (410): Project pre-registration is no longer required or supported, upload your files instead.
running sdist
creating responsysrest-0.1.8
creating responsysrest-0.1.8/responsysrest
creating responsysrest-0.1.8/responsysrest.egg-info
copying files to responsysrest-0.1.8...
copying MANIFEST.in -> responsysrest-0.1.8
copying README.md -> responsysrest-0.1.8
copying setup.py -> responsysrest-0.1.8
copying responsysrest/__init__.py -> responsysrest-0.1.8/responsysrest
copying responsysrest/client.py -> responsysrest-0.1.8/responsysrest
copying responsysrest/configuration.py -> responsysrest-0.1.8/responsysrest
copying responsysrest/containers.py -> responsysrest-0.1.8/responsysrest
copying responsysrest/credentials.py -> responsysrest-0.1.8/responsysrest
copying responsysrest/objects.py -> responsysrest-0.1.8/responsysrest
copying responsysrest.egg-info/PKG-INFO -> responsysrest-0.1.8/responsysrest.egg-info
copying responsysrest.egg-info/SOURCES.txt -> responsysrest-0.1.8/responsysrest.egg-info
copying responsysrest.egg-info/dependency_links.txt -> responsysrest-0.1.8/responsysrest.egg-info
copying responsysrest.egg-info/requires.txt -> responsysrest-0.1.8/responsysrest.egg-info
copying responsysrest.egg-info/top_level.txt -> responsysrest-0.1.8/responsysrest.egg-info
Writing responsysrest-0.1.8/setup.cfg
Creating tar archive
removing 'responsysrest-0.1.8' (and everything under it)
running upload
Password: 
Submitting dist/responsysrest-0.1.8.tar.gz to https://upload.pypi.org/legacy/
Upload failed (403): Invalid or non-existent authentication information.
error: Upload failed (403): Invalid or non-existent authentication information.

Any help appreciated... Thanks!

di commented 6 years ago

@dyspop I'm not seeing a dyspop user on https://test.pypi.org. You need to create a separate account there as well, it shares no data with https://pypi.org.

matthagy commented 5 years ago

I've been having this issue today. Everything worked fine yesterday. Verified that could login to pypi after logging out. Also, verified that I could upload to test.pypi. Haven't changed any configurations recently.

Thanks for any help! Big fan of PyPA!

Commands and outputs:

# Failure on production, which worked for me yesterday
$ python3 -m twine upload dist/*
Uploading distributions to https://upload.pypi.org/legacy/
Uploading scalaps-0.0.1-py3-none-any.whl
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████| 8.11k/8.11k [00:01<00:00, 5.77kB/s]
NOTE: Try --verbose to see response content.
HTTPError: 403 Client Error: Invalid or non-existent authentication information. for url: https://upload.pypi.org/legacy/

# Verifying that things works on test
$ python3 -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
Enter your username: matthagy
Enter your password: 
Uploading distributions to https://test.pypi.org/legacy/
Uploading scalaps-0.0.1-py3-none-any.whl
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████| 8.11k/8.11k [00:02<00:00, 3.80kB/s]
Uploading scalaps-0.0.2-py3-none-any.whl
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9.83k/9.83k [00:01<00:00, 7.25kB/s]
Uploading scalaps-0.0.1.tar.gz
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7.08k/7.08k [00:01<00:00, 6.71kB/s]
Uploading scalaps-0.0.2.tar.gz
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████| 8.77k/8.77k [00:01<00:00, 7.90kB/s]
di commented 5 years ago

@matthagy Looks like twine is not prompting you for credentials. Do you have a .pypirc file in your home directory? Do the credentials there match what you can log into https://pypi.org with?

matthagy commented 5 years ago

@di, you're right! My password manager had changed the password and I forgot to update that file. Fixed. Thanks for the help and sorry for my silly mistake that I should've been able to fix on my own.

yindongxu1 commented 5 months ago

The.pypirc has been configured, but it still keeps showing this error. 9165a3f40c6d983d4626afa58aaf0e4f4418aadba8c790f992429232a314995cQzpcVXNlcnNcbWVjaC1taW5kXEFwcERhdGFcUm9hbWluZ1xEaW5nVGFsa1wyOTkwNjE5ODIxX3YyXEltYWdlRmlsZXNcMTcxNjQ0NjQ4MjIzNF9CQzdDQzZDRi0zREQwLTRkODgtOUIyQy03RDM4QkNDMTM5MDEucG5n ![Uploading fc54058667d5c1771285f69fed72f7a18ce4ebbe6391bee1610712c0c6789377QzpcVXNlcnNcbWVjaC1taW5kXEFwcERhdGFcUm9hbWluZ1xEaW5nVGFsa1wyOTkwNjE5ODIxX3YyXEltYWdlRmlsZXNcMTcxNjQ0NjU0NDA2MF8zRkU5QzkyQS05NzU2LTQzODUtOEYyOC04RDkzNERCNUFDODEucG5n.png…]()