英文:
Connecting to snowflake in django using proxy
问题
I have deployed my Django app on Heroku and want to connect to Snowflake. However, when I redeploy, my IP changes, causing connection issues due to IP whitelisting. I've attempted to use fixie
as a proxy, but my app still connects using my network IP, not the proxy.
MY IMPORTS:
from sqlalchemy import create_engine
from sqlalchemy import text
import requests
import snowflake
import snowflake.connector
Snippet 1:
engine = create_engine(
'snowflake://{user}:{password}@{account}/{database}/{schema}'.format(
user=connection_details["user"],
password=connection_details["pw"],
account=connection_details["account"],
database=connection_details["database"],
schema=connection_details["schema"],
),
connect_args={
'proxy': 'http://fixie:kT8kuyNpPbrbdx@velodroll.usefixie.com:80'
}
)
Snippet 2:
engine = snowflake.connector.connect(
user=connection_details["user"],
password=connection_details["pw"],
account=connection_details["account"],
database=connection_details["database"],
schema=connection_details["schema"],
connect_args={'proxy': 'http://fixie:kT8djczxc14@velodsad.usefixie.com:80'}
)
Error message I keep receiving:
snowflake.connector.errors.DatabaseError: 250001 (08001): Failed to connect to DB: pv40812.east-us-2.azure.snowflakecomputing.com:443. IP address 169.169.169.69 is not allowed to access Snowflake. Contact your account administrator. For more information about this error, go to https://community.snowflake.com/s/ip-xxxxxxxxxxxx-is-not-allowed-to-access.
I've attempted to connect to Snowflake through the Fixie proxy, but it's being ignored.
英文:
I have deployed my django app on heroku and I want to connect to snowflake. But whenever I redeploy, IP changes and my app is not able to connect to snowflake(IP whitelisting issue). I have tried to use fixie
as a proxy so that when I connect to snowflake, my IP doesnt change and I don't need to get it whitelisted. Below are two code snippets I have been using to connect to snowflake
. But my app keeps trying to connect using my network IP and not the proxy.
MY IMPORTS:
from sqlalchemy import create_engine
from sqlalchemy import text
import requests
import snowflake
import snowflake.connector
snippet 1:
engine = create_engine(
'snowflake://{user}:{password}@{account}/{database}/{schema}'.format(
user=connection_details["user"],
password=connection_details["pw"],
account=connection_details["account"],
database=connection_details["database"],
schema=connection_details["schema"],
),
connect_args={
'proxy': 'http://fixie:kT8kuyNpPbrbdx@velodroll.usefixie.com:80'
})
snippet 2:
engine = snowflake.connector.connect(user=connection_details["user"],password=connection_details["pw"],account=connection_details["account"],database=connection_details["database"],schema=connection_details["schema"],connect_args={'proxy': 'http://fixie:kT8djczxc14@velodsad.usefixie.com:80'})
and the error i keep getting :
> snowflake.connector.errors.DatabaseError: 250001 (08001): Failed to connect to DB: pv40812.east-us-2.azure.snowflakecomputing.com:443. IP address 169.169.169.69 is not allowed to access Snowflake. Contact your account administrator. For more information about this error, go to https://community.snowflake.com/s/ip-xxxxxxxxxxxx-is-not-allowed-to-access.
I tried to connect to snowflake through fixie proxy but it keeps ignoring it
答案1
得分: 1
代理服务器参数不受支持。请使用支持的环境变量配置代理服务器。
Linux或macOS:
export HTTP_PROXY='http://username:password@proxyserver.company.com:80'
export HTTPS_PROXY='http://username:password@proxyserver.company.com:80'
Windows:
set HTTP_PROXY=http://username:password@proxyserver.company.com:80
set HTTPS_PROXY=http://username:password@proxyserver.company.com:80
英文:
Proxy server parameters are not supported. Instead, use the supported environment variables to configure a proxy server.
Linux or macOS:
export HTTP_PROXY='http://username:password@proxyserver.company.com:80'
export HTTPS_PROXY='http://username:password@proxyserver.company.com:80'
Windows:
set HTTP_PROXY=http://username:password@proxyserver.company.com:80
set HTTPS_PROXY=http://username:password@proxyserver.company.com:80
For more information, have a look here
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论