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

Twine upload fails with unhelpful error #897

Closed
jaraco opened this issue May 10, 2022 · 2 comments
Closed

Twine upload fails with unhelpful error #897

jaraco opened this issue May 10, 2022 · 2 comments

Comments

@jaraco
Copy link
Member

jaraco commented May 10, 2022

Attempting to upload a release, I get a "warning" error.

setuptools main $ .tox/release/bin/python -m twine upload dist/*
Uploading distributions to https://upload.pypi.org/legacy/
Uploading setuptools-62.1.0-py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB • 00:00 • 6.8 MB/s
WARNING  Error during upload. Retry with the --verbose option for more details.                                                                

Is it an error or a warning? Why make me retry to get some useful information? Retry with verbose does reveal the cause:

setuptools main $ .tox/release/bin/python -m twine upload dist/* --verbose
Uploading distributions to https://upload.pypi.org/legacy/
INFO     dist/setuptools-62.1.0-py3-none-any.whl (1.1 MB)                                                                                      
INFO     dist/setuptools-62.1.0.tar.gz (2.4 MB)                                                                                                
INFO     username set by command options                                                                                                       
INFO     Querying keyring for password                                                                                                         
INFO     password set from keyring                                                                                                             
INFO     username: __token__                                                                                                                   
INFO     password: <hidden>                                                                                                                    
Uploading setuptools-62.1.0-py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB • 00:00 • 5.2 MB/s
INFO     Response from https://upload.pypi.org/legacy/:                                                                                        
         400 File already exists. See https://pypi.org/help/#file-name-reuse for more information.                                             
INFO     <html>                                                                                                                                
          <head>                                                                                                                               
           <title>400 File already exists. See https://pypi.org/help/#file-name-reuse for more information.</title>                            
          </head>                                                                                                                              
          <body>                                                                                                                               
           <h1>400 File already exists. See https://pypi.org/help/#file-name-reuse for more information.</h1>                                  
           The server could not comply with the request since it is either malformed or otherwise incorrect.<br/><br/>                         
         File already exists. See https://pypi.org/help/#file-name-reuse for more information.                                                 
                                                                                                                                               
                                                                                                                                               
          </body>                                                                                                                              
         </html>                   

It seems to me twine should provide more useful details on a failed upload during the initial attempt. If the issue was transient, I wouldn't be able to recreate it in a second attempt. Especially for known failure cases, Twine should detect them and report useful information during the initial attempt.

@bhrutledge
Copy link
Contributor

@jaraco At first glance, this is a duplicate of #895, which has a fix pending in #896.

@jaraco
Copy link
Member Author

jaraco commented May 10, 2022

I think you’re right. I’ll follow that issue (and maybe even find time to review the PR).

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

No branches or pull requests

2 participants