-
Notifications
You must be signed in to change notification settings - Fork 468
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
SNOW-810810: AttributeError when using SOCKS5 Proxy #1550
Comments
thanks for the feedback and the pull request! we will take a look! |
Hey everyone, I'm facing the same issue with the missing attribute. Is there any reason why this is not merged, I couldn't find any other resolution for this issue. |
We will review this PR next week. FYI @sfc-gh-aling |
Thank you |
Is there anything I can do to help to move this further |
@sfc-gh-aling , any updates on this? thank you |
Running into this as well, would be great if this could be merged soon 👍 |
As a temporary workaround using PySocks works: import socks
import socket
socks.set_default_proxy(**{
"proxy_type": socks.SOCKS5,
"addr": os.environ["PROXY_ADDR"],
"username": os.environ["PROXY_USERNAME"],
"password": os.environ["PROXY_PASSWORD"],
})
socket.socket = socks.socksocket
with snowflake.connector.connect(...) as con:
cursor = con.cursor() But this is no fix for other solutions that rely on the environment variables. |
@sfc-gh-aling I would like to know if there are any changes needed to promote this issue, thanks. |
We just merged the PR which shall fix the issue and it will be carried in our next release |
Please answer these questions before submitting your issue. Thanks!
What are the component versions in the environment (
pip freeze
)?Replace with the output of
python -m pip freeze
What did you do?
Attempt to connect to Snowflake through a SOCKS5 proxy:
Use a minimal SOCKS5 proxy. From a second computer (
computer2
), open a SOCKS5 proxy oncomputer1
On
computer1
:The above test results in:
This is because the SOCKSProxyManager is a subclass of PoolManager Which does not have the property
proxy_headers
. It does have a propertyheaders
.I modified the code to not set the header when using a SOCKS5 proxy, which seems to work. The connection succeeds over the SOCKS5 proxy. It also works if I set the
headers
property instead of theproxy_headers
property.I offer a pull request for the first solution (not setting the
proxy_headers
when using a SOCKS5 proxy), but I leave it up to someone more knowledgable to decide whether this is the desired solution to this.The text was updated successfully, but these errors were encountered: