0

I am trying to connect to snowflake database using command line argument snowsql -c example but I am getting below error.

Failed to execute request: HTTPSConnectionPool(host='xyz.azure.snowflakecomputing.com', port=443): Max retries exceeded with url: /session/v1/login-request?request_id=90925166-6058-4526-bdc8-46b3710576c6&request_guid=ff7507a5-7368-46d6-89e5-155b00fb651a (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required',)))

Ali Hasan
  • 512
  • 1
  • 4
  • 18
harshac
  • 11
  • 1
  • 3

2 Answers2

1

Try adding NO_PROXY="xyz.azure.snowflakecomputing.com" to the environment variables on your machine, e.g.

export NO_PROXY="xyz.azure.snowflakecomputing.com"
Arghya Sadhu
  • 41,002
  • 9
  • 78
  • 107
Romilly
  • 11
  • 1
0

Proxy Authentication Required

Looks like your connection is going through a proxy which requires authentication. Per the snowsql help:

 --proxy-host TEXT               (DEPRECATED. Use HTTPS_PROXY and HTTP_PROXY
                                 environment variables.) Proxy server
                                 hostname. Honors $SNOWSQL_PROXY_HOST.

thus I think you want to configure HTTPS_PROXY. You would do that as follows:

HTTPS_PROXY=http://user:password@proxy:port/ 

eg

export HTTPS_PROXY=http://user:password@proxy:port/
snowsql

or

env HTTPS_PROXY=http://user:password@proxy:port/  snowsql
Brock Noland
  • 136
  • 4
  • Thanks for your answer! I was able to connect to snowflake database successfully using the same proxy from my local machine without setting up any environment variables. Now, I am trying to do the same on a remote server and I am having this issue. I have already set up the environment variables but without username and password. This proxy is a company provided one. I am not aware that a proxy can have a username and password. I am not sure what the username and pwd could be, need to figure out. – harshac Aug 03 '20 at 21:03
  • They might not require auth from your local machine because you are the only user logged in but on the remote server, it could be anyone so they require a username/password for auditing. – Brock Noland Aug 04 '20 at 01:22
  • Tried updating the env variables with username and password, still getting same error. – harshac Aug 11 '20 at 17:31