MacOS およびLinuxのトラブルシューティングステップ¶
以下の手順に従って、プロキシがあるかどうかを識別して確認し、さらにトラブルシューティングを行うために必要なプロキシホストとポート番号を収集します。
新しい
Terminal
ウィンドウを開きます。次のコマンドを実行して、ネットワーク固有のプロキシ設定の詳細を取得します。
example.com
をテストする実際のホスト名に置き換えます。networksetup -getsecurewebproxy "$(networksetup -listnetworkserviceorder | grep $(route get example.com | grep interface | awk -F: '{print $2}') | awk -FPort: '{print $2}' | awk -F, '{print $1}' | sed 's/^ //g')"
プロキシ設定ありのサンプル出力
Enabled: Yes Server: 192.168.21.12 Port: 3128 Authenticated Proxy Enabled: 1
プロキシ設定なしのサンプル出力
Enabled: No Server: Port: 0 Authenticated Proxy Enabled: 0
さらに、以下のコマンドを使用して、プロキシ設定に使用される一般的な環境変数をテストできます。
env | grep -i proxy
このコマンドは以下のような出力を返します。
http_proxy=http://my.pro.xy:123 HTTP_PROXY=http://my.pro.xy:123 HTTPS_PROXY=http://my.pro.xy:123 https_proxy=http://my.pro.xy:123 NO_PROXY=localhost,.company.com,.amazonaws.com
プロキシが見つかりました: これらの環境変数の設定に基づいて、 追加のテスト に必要なプロキシホストとポートを収集できます。
プロキシが見つかりません: 出力が空の場合は、プロキシ設定用の環境変数が設定されていない可能性があり、 テストを進める必要があります。
NO_PROXY
は、クライアントがプロキシサーバーを通さずに直接接続するために使用できるホストを定義します。
プロキシがある場合¶
接続の問題が発生している URL を特定できます。Snowflakeの許可リストに記載されているすべての URLs をテストすることは有益ですが、セットアップで直接問題を引き起こしている URL に焦点を当てることをお勧めします。
export http_proxy=http://<PROXY_HOST:PROXY_PORT> && export HTTP_PROXY=$http_proxy && export HTTPS_PROXY=$http_proxy && export https_proxy=$http_proxy
curl -v https://URL 2>&1 | tee | grep "Trying\|Connected\|Establish\|CONNECT\|subject\|issuer\|HTTP\|curl"
あるいは、以下のようにプロキシ設定を(最初に環境変数を設定せずに) curl
に渡すこともできます。
未認証のプロキシ
curl --proxy “<PROTOCOL>://<HOST>:<PORT>” ..rest of the arguments..
認証済みプロキシ
curl --proxy “<PROTOCOL>://<HOST>:<PORT>” --proxy-user user:pass ..rest of the arguments..
Terminal
で、以下のコマンドを実行します。問題を引き起こしている URL でコマンドを更新します。 <URL>
を問題のある URL に置き換えます。さらに、 <PROXY_URL>
をプロキシ情報に置き換えます。
export http_proxy=http://<PROXY_URL> && export HTTP_PROXY=$http_proxy && export HTTPS_PROXY=$http_proxy && export https_proxy=$http_proxy
curl -v https://<URL> 2>&1 | tee | grep "Trying\|Connected\|Establish\|CONNECT\|subject\|issuer\|HTTP\|curl"
これらのコマンドは、 HTTP および HTTPS リクエストにプロキシを使用するように環境を設定し、指定されたSnowflake URL への接続を試行します。また、成功した接続や発生したエラーなど、接続試行に関する詳細情報も出力します。
接続成功例の出力:
➜ curl -v https://<account>.snowflakecomputing.com 2>&1 | tee | grep "Trying\|Connected\|Establish\|CONNECT\|subject\|issuer\|HTTP\|curl"
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying <IP ADDRESS>...
* Connected to <IP ADDRESS> (<IP ADDRESS>) port <PORT> (#0)
* Establish HTTP proxy tunnel to <account>.snowflakecomputing.com:443
> CONNECT <account>.snowflakecomputing.com:443 HTTP/1.1
> User-Agent: curl/7.79.1
< HTTP/1.1 200 Connection established
* Proxy replied 200 to CONNECT request
* CONNECT phase completed!
* subject: CN=*.us-east-1.snowflakecomputing.com
* subjectAltName: host "<account>.snowflakecomputing.com" matched cert's "*.us-east-1.snowflakecomputing.com"
* issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
> GET / HTTP/1.1
> User-Agent: curl/7.79.1
< HTTP/1.1 302 Found
出力の分析:
「Connected to...」は、プロキシ(<IP ADDRESS>)への接続が成功し、Snowflakeへの HTTP トンネルが確立されたことを示します。
HTTP/1.1 200 Connection established
およびHTTP/1.1 302 Found
のような HTTP ステータスコードは、正常にログインできたことを示します。
これらの手順を完了したら、 フォローアップアクション を続行します。
プロキシがない場合¶
Terminal
で、以下のコマンドを実行します。コマンド内の URL を、テストする Snowflake URL と一致するように更新してください。
curl -v https://<URL> 2>&1 | tee | grep "Trying\|Connected\|Establish\|CONNECT\|subject\|issuer\|HTTP\|curl"
接続成功例の出力:
➜ curl -v https://<account>.snowflakecomputing.com 2>&1 | tee | grep "Trying\|Connected\|Establish\|CONNECT\|subject\|issuer\|HTTP\|curl"
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 52.22.29.117:443...
* Connected to <account>.snowflakecomputing.com (52.22.29.117) port 443 (#0)
* subject: CN=*.us-east-1.snowflakecomputing.com
* subjectAltName: host "<account>.snowflakecomputing.com" matched cert's "*.us-east-1.snowflakecomputing.com"
* issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0> GET / HTTP/1.1
< HTTP/1.1 302 Found
この出力は接続が成功したことを示し、システムがSnowflakeサーバーにアクセスして通信できることを示しています。
接続失敗の例:
➜ curl -v https://<account>.snowflakecomputing.com 2>&1 | tee | grep "Trying\|Connected\|Establish\|CONNECT\|subject\|issuer\|HTTP\|curl"
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 52.22.29.117:443...
* Trying 3.222.247.13:443...
* Trying 54.81.51.170:443...
curl: (7) Failed to connect to <account>.us-east-1.snowflakecomputing.com port 443 after 3139 ms: Connection refused
これらの手順を完了したら、 フォローアップアクション を続行します。