mosquito / pypi-server

Tornado based server like pypi.python.org. With caching from pypi.
MIT License
120 stars 38 forks source link

405 Method Not allowed #17

Closed adepretis closed 6 years ago

adepretis commented 6 years ago

When uploading a package using python setup.py sdist upload -r mypypi I get:

Submitting dist/mydist-1.0.3.dev0.tar.gz to http://my.pypi.domain/
Upload failed (405): Method Not Allowed

The server log shows:

[W 171106 16:05:26 httputil:774] multipart/form-data missing headers
[W 171106 16:05:26 web:2063] 405 POST / (10.10.10.10) 2.77ms

I tried this with several packages, even official ones, just to be sure - not a single one passes :-(

mosquito commented 6 years ago

I guess you have wrong url in your .pypirc. Please pay attention to this article.

adepretis commented 6 years ago

@mosquito I tried http://my.pypi.domain (405 Method Not Allowed), http://my.pypi.domain/ (405 Method Not Allowed) and http://my.pypi.domain/pypi (404 Not Found) as mentioned in the README. What would be the correct URL?

One thing that might be of relevance: for various reasons we are currently accessing the pypi-server through port 9003 ... so it is actually: http://my.pypi.domain:9003 (405), http://my.pypi.domain:9003/ (405) or http://my.pypi.domain:9003/pypi (404).

The .pypirc looks like this:

[distutils]
index-servers =
    mypypi

[mypypi]
repository=http://my.pypi.domain:9003/pypi
username=myuser
password=mypassword

Right now there is no reverse proxy (Apache, nginx, HAproxy) involved - we are accessing the pypi-server directly.

What am I missing?

adepretis commented 6 years ago

Sorry, my bad: when playing around (and initially missing the /pypi in the repository URL) somehow the register action got lost along the way. Without having the package registered, a HTTP error code 404 is returned.