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

Wheel (package) upload fails with '' is not a valid url. #15629

Closed
reivilibre opened this issue Mar 19, 2024 · 2 comments
Closed

Wheel (package) upload fails with '' is not a valid url. #15629

reivilibre opened this issue Mar 19, 2024 · 2 comments
Labels
bug 🐛 requires triaging maintainers need to do initial inspection of issue

Comments

@reivilibre
Copy link

Describe the bug

I am trying to upload a wheel.

When I try to upload the wheel, I get a 400 Bad Request error and am told that '' is not a valid url..

In verbose mode, this is what I see:

INFO     Response from https://upload.pypi.org/legacy/:                                                                                                                                                      
         400 '' is not a valid url. See https://packaging.python.org/specifications/core-metadata for more information.                                                                                      
INFO     <html>                                                                                                                                                                                              
          <head>                                                                                                                                                                                             
           <title>400 '' is not a valid url. See https://packaging.python.org/specifications/core-metadata for more information.</title>                                                                     
          </head>                                                                                                                                                                                            
          <body>                                                                                                                                                                                             
           <h1>400 '' is not a valid url. See https://packaging.python.org/specifications/core-metadata for more information.</h1>                                                                           
           The server could not comply with the request since it is either malformed or otherwise incorrect.<br/><br/>                                                                                       
         &#x27;&#x27; is not a valid url. See https://packaging.python.org/specifications/core-metadata for more information.                                                                                
                                                                                                                                                                                                             
                                                                                                                                                                                                             
          </body>                                                                                                                                                                                            
         </html>                                                                                                                                                                                             
ERROR    HTTPError: 400 Bad Request from https://upload.pypi.org/legacy/                                                                                                                                     
         '' is not a valid url. See https://packaging.python.org/specifications/core-metadata for more information.

I have read the linked page and checked the wheel and can't see how it's relevant. It would be really nice if the error message gave some context about which URL/field it was referring to — obviously I know that empty string is not a valid URL but it should tell me where it found that information.

Expected behavior

I would expect this wheel to upload. Or failing that, the error message should say what the significance of this empty string is, e.g. Metadata field wombatinwheel/MANIFEST is invalid: '' is not a valid url

We uploaded a similar wheel last week and the difference between this one and that one is very minimal, I can't see anything suspicious:

rei@lithium:/tmp$ diff -U5 matrix_synapse-1.103.0rc1-cp38-abi3-macosx_10_16_x86_64 matrix_synapse-1.103.0-cp38-abi3-macosx_10_16_x86_64
Only in matrix_synapse-1.103.0-cp38-abi3-macosx_10_16_x86_64: matrix_synapse-1.103.0.dist-info
Only in matrix_synapse-1.103.0rc1-cp38-abi3-macosx_10_16_x86_64: matrix_synapse-1.103.0rc1.dist-info
Common subdirectories: matrix_synapse-1.103.0rc1-cp38-abi3-macosx_10_16_x86_64/synapse and matrix_synapse-1.103.0-cp38-abi3-macosx_10_16_x86_64/synapse


rei@lithium:/tmp$ diff -U5 matrix_synapse-1.103.0rc1-cp38-abi3-macosx_10_16_x86_64/matrix_synapse-1.103.0rc1.dist-info/ matrix_synapse-1.103.0-cp38-abi3-macosx_10_16_x86_64/matrix_synapse-1.103.0.dist-info/
diff -U5 matrix_synapse-1.103.0rc1-cp38-abi3-macosx_10_16_x86_64/matrix_synapse-1.103.0rc1.dist-info/METADATA matrix_synapse-1.103.0-cp38-abi3-macosx_10_16_x86_64/matrix_synapse-1.103.0.dist-info/METADATA
--- matrix_synapse-1.103.0rc1-cp38-abi3-macosx_10_16_x86_64/matrix_synapse-1.103.0rc1.dist-info/METADATA        1980-01-01 00:00:00.000000000 +0000
+++ matrix_synapse-1.103.0-cp38-abi3-macosx_10_16_x86_64/matrix_synapse-1.103.0.dist-info/METADATA      1980-01-01 00:00:00.000000000 +0000
@@ -1,8 +1,8 @@
 Metadata-Version: 2.1
 Name: matrix-synapse
-Version: 1.103.0rc1
+Version: 1.103.0
 Summary: Homeserver for the Matrix decentralised comms protocol
 Home-page: https://github.com/element-hq/synapse
 License: AGPL-3.0-or-later
 Author: Matrix.org Team and Contributors
 Author-email: packages@matrix.org
diff -U5 matrix_synapse-1.103.0rc1-cp38-abi3-macosx_10_16_x86_64/matrix_synapse-1.103.0rc1.dist-info/RECORD matrix_synapse-1.103.0-cp38-abi3-macosx_10_16_x86_64/matrix_synapse-1.103.0.dist-info/RECORD
--- matrix_synapse-1.103.0rc1-cp38-abi3-macosx_10_16_x86_64/matrix_synapse-1.103.0rc1.dist-info/RECORD  2024-03-12 15:32:26.000000000 +0000
+++ matrix_synapse-1.103.0-cp38-abi3-macosx_10_16_x86_64/matrix_synapse-1.103.0.dist-info/RECORD        2024-03-19 12:33:56.000000000 +0000
@@ -1,10 +1,10 @@
-matrix_synapse-1.103.0rc1.dist-info/RECORD,,
-matrix_synapse-1.103.0rc1.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
-matrix_synapse-1.103.0rc1.dist-info/WHEEL,sha256=YJ27Xdr0ramHyEzHQOmQYIdi1H3IskNCNKNGpUcW4jo,105
-matrix_synapse-1.103.0rc1.dist-info/entry_points.txt,sha256=Xf4Z-Sp4lk8P9pbRhSD40XrhhkooqYWm1OtxUlPwPgs,709
-matrix_synapse-1.103.0rc1.dist-info/METADATA,sha256=WrFkDL6Ti7hc98qZbGCtScBoJsX69ht1IuZBFTd6RO4,15129
+matrix_synapse-1.103.0.dist-info/RECORD,,
+matrix_synapse-1.103.0.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
+matrix_synapse-1.103.0.dist-info/WHEEL,sha256=YJ27Xdr0ramHyEzHQOmQYIdi1H3IskNCNKNGpUcW4jo,105
+matrix_synapse-1.103.0.dist-info/entry_points.txt,sha256=Xf4Z-Sp4lk8P9pbRhSD40XrhhkooqYWm1OtxUlPwPgs,709
+matrix_synapse-1.103.0.dist-info/METADATA,sha256=AWExLqa_FJkP4SqffAR6BkgNj_2r1srs9J86jImmVBg,15126
 synapse/server.py,sha256=uQzQRTRZGUkvB035OtnmH-mhOZw7bEy_Oh3OOd2TNQ0,32616
 synapse/synapse_rust.abi3.so,sha256=K9lZ5u6TCsCYN5oThS6garoCWu2tv90KH700552Fbmg,3254024
 synapse/event_auth.py,sha256=RLVogo3FQIinmlhcEHH8EcM7M_sNnZvJmjBX4--uqMg,42106
 synapse/notifier.py,sha256=_3PcluvpjFHgmst-vNL1qvI8SWMzA3YsqAtHGVnkp8o,31931
 synapse/__init__.py,sha256=r_wlTMMZt1nGXkbo23BPfCbiqRFgdGt2eeNZr4BKV_g,3372

To Reproduce

Last week's wheel that uploaded without issue: https://files.pythonhosted.org/packages/f2/17/c6a49f049611df40020c4bc5456d21312066b0506cf9da219411eb7301e9/matrix_synapse-1.103.0rc1-cp38-abi3-macosx_10_16_x86_64.whl

Today's wheel that won't upload:
matrix_synapse-1.103.0-cp38-abi3-macosx_10_16_x86_64.zip
(it has been rename from whl to zip; you can't upload whls on github).

My Platform

$ twine --version
twine version 4.0.2 (importlib-metadata: 6.7.0, keyring: 23.13.1, pkginfo: 1.9.6, requests: 2.31.0, requests-toolbelt: 1.0.0, urllib3: 2.0.7)

Additional context

@reivilibre reivilibre added bug 🐛 requires triaging maintainers need to do initial inspection of issue labels Mar 19, 2024
@anoadragon453
Copy link

anoadragon453 commented Mar 19, 2024

#15503 may be relevant here.

Edit: #14718 even more so.

@di
Copy link
Member

di commented Mar 19, 2024

Duplicate of #15628.

@di di closed this as completed Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 requires triaging maintainers need to do initial inspection of issue
Projects
None yet
Development

No branches or pull requests

3 participants