snowpark-python icon indicating copy to clipboard operation
snowpark-python copied to clipboard

SNOW-698642: ExternalBrowser authentication spins when launched via. WSL

Open lawrence-vo opened this issue 2 years ago • 7 comments

Please answer these questions before submitting your issue. Thanks!

  1. What version of Python are you using?

    3.8.14

  2. What operating system and processor architecture are you using?

    Linux-5.15.74.2-microsoft-standard-WSL2-x86_64-with-glibc2.35

  3. What are the component versions in the environment (pip freeze)?

asn1crypto==1.5.1 certifi==2022.9.24 cffi==1.15.1 charset-normalizer==2.1.1 cloudpickle==2.0.0 cryptography==38.0.3 filelock==3.8.0 idna==3.4 networkx==2.8.8 numpy==1.23.5 oscrypto==1.3.0 pandas==1.5.1 pycparser==2.21 pycryptodomex==3.15.0 PyJWT==2.6.0 pyOpenSSL==22.1.0 python-dateutil==2.8.2 pytz==2022.6 requests==2.28.1 scipy==1.9.3 six==1.16.0 snowflake-connector-python==2.8.2 snowflake-snowpark-python==1.0.0 sql-metadata==2.6.0 sqlparse==0.4.3 typing_extensions==4.4.0 urllib3==1.26.12

  1. What did you do?

Running WSL2 with Ubuntu 22.04.01 with Windows 11. I created a session and set authenticator to externalbrowser. I have installed wslu and set BROWSER=wslview. I have confirmed that I can launch Chrome (my default browser) via WSL. The webpage is launched in chrome but I am stuck with a webpage that stays on Redirecting to Snowflake client in 1 seconds.... I do see an error message that says tcgetpgrp failed: Not a tty. After a while, I get the error message: Failed to connect to DB: <my-account>.snowflakecomputing.com:443, Invalid HTTP request from web browser. Idp authentication could have failed.

  1. What did you expect to see?

To be authenticated as if I was running a Windows machine

  1. Can you set logging to DEBUG and collect the logs?

I don't suspect that it has to do with the code itself.

Thanks!

lawrence-vo avatar Nov 22 '22 18:11 lawrence-vo

If this helps at all, whenever I click Enter on the webpage launched via snowpark, this pops up:

image

lawrence-vo avatar Nov 22 '22 18:11 lawrence-vo

It seems to be getting stuck here:data = socket_client.recv(BUF_SIZE).decode("utf-8").split("\r\n")

lawrence-vo avatar Nov 22 '22 19:11 lawrence-vo

@lawrence-vo this still happening?

sfc-gh-achandrasekaran avatar Apr 13 '23 16:04 sfc-gh-achandrasekaran

@sfc-gh-achandrasekaran it is still failing.

Thanks!

lawrence-vo avatar Apr 13 '23 16:04 lawrence-vo

@sfc-gh-hchaturvedi Do you happen to know anything about this?

sfc-gh-yixie avatar May 11 '23 05:05 sfc-gh-yixie

This looks like a general webbrowser/WSL issue. Could it be https://stackoverflow.com/questions/73480501/error-tcgetpgrp-failed-not-a-tty-using-python3-to-open-web-browser?

sfc-gh-stan avatar Oct 02 '23 15:10 sfc-gh-stan

That's what I initially thought but other browser based authentication services (like AWS SSO authentication) work while I am on WSL.

lawrence-vo avatar Oct 02 '23 16:10 lawrence-vo