0
私は次のようにリモート・データベースに接続しようとしているに接続中:socket.gaierrorリモートサーバー
with SSHTunnelForwarder(
ssh_address=('10.160.1.24', 22),
ssh_username='Administrator',
ssh_password=ssh_password,
remote_bind_address=('127.0.0.1', 5432)) as server:
print("test")
しかし、私はこのエラーに遭遇しています:
remote_bind_address=('127.0.0.1', 5432)) as server:
File "/Library/Python/2.7/site-packages/sshtunnel.py", line 879, in __init__
self._local_interfaces = self._get_local_interfaces()
File "/Library/Python/2.7/site-packages/sshtunnel.py", line 1378, in _get_local_interfaces
local_if = socket.gethostbyname_ex(socket.gethostname())[-1]
socket.gaierror: [Errno 8] nodename nor servname provided, or not known
私にも分かりません。 Errno 8は 'ENOEXEC'です。 'errnoで' gethostbyname_ex'または 'gethostname'が失敗するという明白な理由はありません。どのようなOSですか?もしそれがLinuxならば、私は 'strace <あなたのプログラム>'を実行し、どのシステムコールが実際にそのerrnoを生成しているかを調べようとします。 –
私はMacを使用しています。残念ながら、私はmacのstraceレプリカを認識していません。 –
私は多くのプログラミングをMacでやっていませんが、 'dtruss'は同等です。 –