EpicWink/proxpi

Cannot find package when add extra index

Closed this issue · 1 comments

A paragraph or two of the bug.

Reproduction

Steps to reproduce the behavior:

  1. Run docker with PROXPI_EXTRA_INDEX_URLS
  2. Install as usual: pip install --index-url http://127.0.0.1:5000/index/ numpy
  3. See error

Expected behaviour

Install successfully from simple pip

Actual behaviour

proxpi  | 2023-10-11 09:23:23 [   ERROR] proxpi: Exception on /index/numpy/ [GET]
proxpi  | Traceback (most recent call last):
proxpi  |   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2525, in wsgi_app
proxpi  |     response = self.full_dispatch_request()
proxpi  |   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1822, in full_dispatch_request
proxpi  |     rv = self.handle_user_exception(e)
proxpi  |   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1820, in full_dispatch_request
proxpi  |     rv = self.dispatch_request()
proxpi  |   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1796, in dispatch_request
proxpi  |     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
proxpi  |   File "/usr/local/lib/python3.10/site-packages/proxpi/server.py", line 172, in list_files
proxpi  |     files = cache.list_files(package_name)
proxpi  |   File "/usr/local/lib/python3.10/site-packages/proxpi/_cache.py", line 810, in list_files
proxpi  |     root_files = self.root_cache.list_files(package_name)
proxpi  |   File "/usr/local/lib/python3.10/site-packages/proxpi/_cache.py", line 462, in list_files
proxpi  |     self._list_files(package_name)
proxpi  |   File "/usr/local/lib/python3.10/site-packages/proxpi/_cache.py", line 416, in _list_files
proxpi  |     response = self.session.get(url, headers=self._headers)
proxpi  |   File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 600, in get
proxpi  |     return self.request("GET", url, **kwargs)
proxpi  |   File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
proxpi  |     resp = self.send(prep, **send_kwargs)
proxpi  |   File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 695, in send
proxpi  |     adapter = self.get_adapter(url=request.url)
proxpi  |   File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 792, in get_adapter
proxpi  |     raise InvalidSchema(f"No connection adapters were found for {url!r}")
proxpi  | requests.exceptions.InvalidSchema: No connection adapters were found for '"https:/pypi.org/numpy'

Environment

Done, my bad since I added the double quote at extra urls: PROXPI_EXTRA_INDEX_URLS="https://download.pytorch.org/whl/cu102,https://download.pytorch.org/whl/cu113,https://download.pytorch.org/whl/cu116,https://download.pytorch.org/whl/cu117,https://download.pytorch.org/whl/cu118,https://download.pytorch.org/whl/cpu"
Fixed by remove it: PROXPI_EXTRA_INDEX_URLS=https://download.pytorch.org/whl/cu102,https://download.pytorch.org/whl/cu113,https://download.pytorch.org/whl/cu116,https://download.pytorch.org/whl/cu117,https://download.pytorch.org/whl/cu118,https://download.pytorch.org/whl/cpu