[b"get_gzh_message or save articles error in func run HTTPSConnectionPool(host='api.leancloud.cn', port=443): Max retries exceeded with url: /1.1/batch (Caused by NewConnectionError(': Failed to establish a new connection: [Errno -5] No address associated with hostname',))"]
具体报错这个。
1. 我在我本地机上上跑脚本是没有问题。
2. 我部署到VPS上就有这个问题。 目前部署了VPS 一个是美国的 一个是 新加坡的
我Google到这个帖子
trace route api.leancloud.cn
本地
traceroute: Warning: api.leancloud.cn has multiple addresses; using 123.59.41.31
traceroute to api.leancloud.cn (123.59.41.31), 64 hops max, 52 byte packets
1 10.10.5.254 (10.10.5.254) 2.147 ms 1.874 ms 2.157 ms
2 10.10.0.254 (10.10.0.254) 0.523 ms 0.436 ms 0.467 ms
3 * * *
4 * * *
5 * * *
6 * * *
7 * * *
8 * * *
9 * * *
10 * * *
11 * * *
12 * * *
13 * * *
14 * * *
15 * * *
16 * * *
17 * * *
18 * * *
19 * * *
20 * * *
21 * * *
22 * * *
23 * * *
24 * * *
25 * * *
26 * * *
27 * * *
28 * * *
29 * * *
30 * * *
31 * * *
32 * * *
33 * * *
34 * * *
35 * * *
36 * * *
37 * * *
38 * * *
39 * * *
40 * * *
41 * * *
42 * * *
43 * * *
44 * * *
45 * * *
46 * * *
47 * * *
48 * * *
49 * * *
美国 VPS
traceroute to api.leancloud.cn (120.132.49.251), 30 hops max, 60 byte packets
1 v416.sioru.com (45.78.0.201) 0.048 ms 0.078 ms 0.028 ms
2 dialup-ae2.1.lax-3.it7.net (96.44.185.161) 0.950 ms 0.919 ms 0.894 ms
3 colo-lax13.as8100.net (96.44.180.97) 0.253 ms 0.229 ms 0.268 ms
4 218.30.44.117 (218.30.44.117) 0.930 ms 0.907 ms 0.882 ms
5 203.14.186.121 (203.14.186.121) 0.951 ms 203.14.186.17 (203.14.186.17) 1.126 ms 203.14.186.125 (203.14.186.125) 3.701 ms
6 202.97.52.165 (202.97.52.165) 152.046 ms 154.822 ms 154.078 ms
7 202.97.52.165 (202.97.52.165) 153.932 ms 153.905 ms 202.97.53.233 (202.97.53.233) 159.475 ms
8 202.97.53.233 (202.97.53.233) 159.321 ms 159.310 ms 159.246 ms
9 * 202.97.53.173 (202.97.53.173) 169.847 ms 169.836 ms
10 * * *
11 * 220.181.162.82 (220.181.162.82) 184.118 ms 172.197 ms
12 * * *
13 * * *
14 * * *
15 180.150.176.58 (180.150.176.58) 178.114 ms * *
16 * * *
17 * * *
18 * * *
19 * * *
20 * * *
21 * * *
22 * * *
23 * * *
24 * * *
25 * * *
26 * * *
27 * * *
28 * * *
29 * * *
30 * * *
新加坡 VPS
traceroute to api.leancloud.cn (120.132.53.161), 30 hops max, 60 byte packets
1 * * *
2 45.32.96.97 (45.32.96.97) 1.046 ms 1.641 ms 2.443 ms
3 45.32.96.33 (45.32.96.33) 0.250 ms 0.408 ms 0.564 ms
4 116.51.18.133 (116.51.18.133) 1.543 ms 1.592 ms 1.648 ms
5 ae-10.r20.sngpsi05.sg.bb.gin.ntt.net (129.250.7.18) 1.036 ms 0.998 ms 1.093 ms
6 ae-8.r22.osakjp02.jp.bb.gin.ntt.net (129.250.3.109) 75.031 ms 71.805 ms 74.989 ms
7 ae-8.r21.osakjp02.jp.bb.gin.ntt.net (129.250.6.193) 73.251 ms 74.302 ms 74.221 ms
8 219.158.34.153 (219.158.34.153) 277.759 ms 277.708 ms 281.181 ms
9 219.158.97.225 (219.158.97.225) 276.627 ms 276.671 ms 276.635 ms
10 219.158.112.193 (219.158.112.193) 283.248 ms * 283.093 ms
11 124.65.194.38 (124.65.194.38) 277.333 ms 281.306 ms 281.214 ms
12 * * 61.148.157.166 (61.148.157.166) 282.653 ms
13 * * *
14 * * *
15 * * *
16 180.150.176.166 (180.150.176.166) 183.011 ms 172.856 ms 160.918 ms
17 * * *
18 * * *
19 * * *
20 * * *
21 * * *
22 * * *
23 * * *
24 * * *
25 * * *
26 * * *
27 * * *
28 * * *
29 * * *
30 * * *
curl -v https://api.leancloud.cn/1.1/ping
本地
- Trying 120.132.53.161...
- Connected to api.leancloud.cn (120.132.53.161) port 443 (#0)
- TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
- Server certificate: *.leancloud.cn
- Server certificate: GeoTrust SSL CA - G3
- Server certificate: GeoTrust Global CA
GET /1.1/ping HTTP/1.1
Host: api.leancloud.cn
User-Agent: curl/7.43.0
Accept: /
>
< HTTP/1.1 200 OK
< Server: Tengine
< Date: Fri, 14 Oct 2016 07:54:20 GMT
< Content-Type: application/json;charset=utf-8
< Content-Length: 17
< Connection: keep-alive
< Cache-Control: no-cache,no-store
< Pragma: no-cache
< Strict-Transport-Security: max-age=31536000
<- Connection #0 to host api.leancloud.cn left intact
{"result":"pong"}%
美国 VPS
* About to connect() to api.leancloud.cn port 443 (#0)
- Trying 120.132.53.161... connected
- Connected to api.leancloud.cn (120.132.53.161) port 443 (#0)
- Initializing NSS with certpath: sql:/etc/pki/nssdb
- CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none- SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
- Server certificate:
- subject: CN=*.leancloud.cn,OU=OPS,O="Mei Wei Shu Qian ( Beijing ) IT Co., Ltd.",L=Beijing,ST=Beijing,C=CN
- start date: Aug 30 00:00:00 2016 GMT
- expire date: Oct 25 23:59:59 2018 GMT
- common name: *.leancloud.cn
- issuer: CN=GeoTrust SSL CA - G3,O=GeoTrust Inc.,C=US
GET /1.1/ping HTTP/1.1
User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.21 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
Host: api.leancloud.cn
Accept: /
>
< HTTP/1.1 200 OK
< Server: Tengine
< Date: Fri, 14 Oct 2016 07:54:02 GMT
< Content-Type: application/json;charset=utf-8
< Content-Length: 17
< Connection: keep-alive
< Cache-Control: no-cache,no-store
< Pragma: no-cache
< Strict-Transport-Security: max-age=31536000
<- Connection #0 to host api.leancloud.cn left intact
- Closing connection #0
{"result":"pong"}#
新加坡 VPS
- About to connect() to api.leancloud.cn port 443 (#0)
- Trying 120.132.49.251...
- Connected to api.leancloud.cn (120.132.49.251) port 443 (#0)
- Initializing NSS with certpath: sql:/etc/pki/nssdb
- CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none- SSL connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
- Server certificate:
- subject: CN=*.leancloud.cn,OU=OPS,O="Mei Wei Shu Qian ( Beijing ) IT Co., Ltd.",L=Beijing,ST=Beijing,C=CN
- start date: Aug 30 00:00:00 2016 GMT
- expire date: Oct 25 23:59:59 2018 GMT
- common name: *.leancloud.cn
- issuer: CN=GeoTrust SSL CA - G3,O=GeoTrust Inc.,C=US
GET /1.1/ping HTTP/1.1
User-Agent: curl/7.29.0
Host: api.leancloud.cn
Accept: /
>
< HTTP/1.1 200 OK
< Server: Tengine
< Date: Fri, 14 Oct 2016 07:54:38 GMT
< Content-Type: application/json;charset=utf-8
< Content-Length: 17
< Connection: keep-alive
< Cache-Control: no-cache,no-store
< Pragma: no-cache
< Strict-Transport-Security: max-age=31536000
<- Connection #0 to host api.leancloud.cn left intact
{"result":"pong"}#
我现在并不知道 我需要怎么来解决这个问题
-
创建时间
16年10月14日
-
最后回复
16年10月14日
-
1
回复
-
1.9K
浏览
-
2
用户
-
2
链接