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

opi doesn't validate thru HTTP proxy #84

Open
RafaelLinux opened this issue Sep 12, 2024 · 0 comments
Open

opi doesn't validate thru HTTP proxy #84

RafaelLinux opened this issue Sep 12, 2024 · 0 comments

Comments

@RafaelLinux
Copy link

I'm on a network that requires to go thru a HTTP proxy with user validation to access Internet. Proxy configuration and proxy user credentials are stored in openSUSE proxy configuration (Yast Proxy), so when installing , upgrading or any other operation that requires access to internet, user doesn't need to enter credentials. Web browsers, ask for proxy user credentials when trying to access Internet.

However, some applications (even Plasma applications like Themes) simply are not able to access proxy user credential and doesn't ask about them (a long long term issue).

"opi" seems to have same issues, like when trying to install "Firefox":

>opi firefox
Searching repos for: firefox
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/urllib3/connectionpool.py", line 776, in urlopen
    self._prepare_proxy(conn)
  File "/usr/lib/python3.11/site-packages/urllib3/connectionpool.py", line 1045, in _prepare_proxy
    conn.connect()
  File "/usr/lib/python3.11/site-packages/urllib3/connection.py", line 625, in connect
    self._tunnel()  # type: ignore[attr-defined]
    ^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/http/client.py", line 943, in _tunnel
    raise OSError(f"Tunnel connection failed: {code} {message.strip()}")
OSError: Tunnel connection failed: 407 Proxy Authentication Required

The above exception was the direct cause of the following exception:

urllib3.exceptions.ProxyError: ('Unable to connect to proxy', OSError('Tunnel connection failed: 407 Proxy Authentication Required'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/requests/adapters.py", line 667, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/urllib3/connectionpool.py", line 844, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/urllib3/util/retry.py", line 517, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='opi-proxy.opensuse.org', port=443): Max retries exceeded with url: /?obs_api_link=https%3A%2F%2Fapi.opensuse.org%2Fsearch%2Fpublished%2Fbinary%2Fid%3Fmatch%3Dcontains-ic%2528%2540name%252C%2B%2527firefox%2527%2529%2Band%2Bpath%252Fproject%253D%2527openSUSE%253AFactory%2527%26limit%3D0&obs_instance=openSUSE (Caused by ProxyError('Unable to connect to proxy', OSError('Tunnel connection failed: 407 Proxy Authentication Required')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/opi", line 146, in <module>
    repo_query(args.query)
  File "/usr/bin/opi", line 72, in repo_query
    packages.extend(opi.search_published_packages('openSUSE', query))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/opi/__init__.py", line 514, in search_published_packages
    r = requests.get(PROXY_URL, params={'obs_api_link': url, 'obs_instance': obs_instance})
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/requests/api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/requests/adapters.py", line 694, in send
    raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='opi-proxy.opensuse.org', port=443): Max retries exceeded with url: /?obs_api_link=https%3A%2F%2Fapi.opensuse.org%2Fsearch%2Fpublished%2Fbinary%2Fid%3Fmatch%3Dcontains-ic%2528%2540name%252C%2B%2527firefox%2527%2529%2Band%2Bpath%252Fproject%253D%2527openSUSE%253AFactory%2527%26limit%3D0&obs_instance=openSUSE (Caused by ProxyError('Unable to connect to pro
```xy', OSError('Tunnel connection failed: 407 Proxy Authentication Required')))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant