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

URLSchemeUnknown: Not supported URL scheme http+unix #50

Closed
aleksei-udalov opened this issue Nov 1, 2024 · 6 comments
Closed

URLSchemeUnknown: Not supported URL scheme http+unix #50

aleksei-udalov opened this issue Nov 1, 2024 · 6 comments

Comments

@aleksei-udalov
Copy link

aleksei-udalov commented Nov 1, 2024

It seems requests 2.32.3 broke compatibility with requests-unixsocket when fixing some security issue.

Expicit declaration "requests==2.31.0" in setup.py can be fast workaround.

UPD: debian 12, python 3.11.2, ccomb/buttervolume affected both 3.11 and HEAD

@thomas-profitt
Copy link

I have the old 3.10 set up on one Debian 12 server, and 3.11 set up on another the same way.
Here's the traceback:

admin@some-debian-12-box:~$ sudo buttervolume scheduled
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/requests-2.32.3-py3.9.egg/requests/adapters.py", line 633, in send
    conn = self.get_connection_with_tls_context(
  File "/usr/local/lib/python3.9/dist-packages/requests-2.32.3-py3.9.egg/requests/adapters.py", line 489, in get_connection_with_tls_context
    conn = self.poolmanager.connection_from_host(
  File "/usr/local/lib/python3.9/dist-packages/urllib3-1.26.20-py3.9.egg/urllib3/poolmanager.py", line 246, in connection_from_host
    return self.connection_from_context(request_context)
  File "/usr/local/lib/python3.9/dist-packages/urllib3-1.26.20-py3.9.egg/urllib3/poolmanager.py", line 258, in connection_from_context
    raise URLSchemeUnknown(scheme)
urllib3.exceptions.URLSchemeUnknown: Not supported URL scheme http+unix

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/buttervolume", line 33, in <module>
    sys.exit(load_entry_point('buttervolume==3.11', 'console_scripts', 'buttervolume')())
  File "/usr/local/lib/python3.9/dist-packages/buttervolume-3.11-py3.9.egg/buttervolume/cli.py", line 544, in main
    if args.func(args) is False:
  File "/usr/local/lib/python3.9/dist-packages/buttervolume-3.11-py3.9.egg/buttervolume/cli.py", line 103, in scheduled
    resp = Session().get(
  File "/usr/local/lib/python3.9/dist-packages/buttervolume-3.11-py3.9.egg/buttervolume/cli.py", line 47, in get
    return self.session.get(*a, **kw)
  File "/usr/local/lib/python3.9/dist-packages/requests-2.32.3-py3.9.egg/requests/sessions.py", line 602, in get
    return self.request("GET", url, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/requests-2.32.3-py3.9.egg/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.9/dist-packages/requests-2.32.3-py3.9.egg/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/requests-2.32.3-py3.9.egg/requests/adapters.py", line 637, in send
    raise InvalidURL(e, request=request)
requests.exceptions.InvalidURL: Not supported URL scheme http+unix

@ccomb
Copy link
Owner

ccomb commented Nov 5, 2024

Thanks for reporting!
I'm a bit reluctant to revert to an earlier version but I'm not sure about the right solution yet. I'll try first to reproduce on Debian. (I'm using it in Flatcar for now.)

@ccomb
Copy link
Owner

ccomb commented Nov 5, 2024

The fix is here : msabramo/requests-unixsocket#72

@ccomb
Copy link
Owner

ccomb commented Nov 5, 2024

There is another project that aimed to be maintained : https://pypi.org/project/requests-unixsocket2/
Changing to it

@ccomb
Copy link
Owner

ccomb commented Nov 5, 2024

Published version 3.12! Let me know if that solves for you ! Reopen if not

@ccomb ccomb closed this as completed Nov 5, 2024
@aleksei-udalov
Copy link
Author

3.12 works, thank you

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

3 participants