- 报错:requests.post()
requests.exceptions.ConnectionError: HTTPConnectionPool(host='xxx', port=80): Max retries exceeded with url: /xx/api/v1/login (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f224f867b50>: Failed to establish a new connection: [Errno -5] No address associated with hostname'))
- 排查原因:
(排查了代码和卸载了requests之后,都无果)
应第一时间验证网络问题,看是否能ping通,具体查阅网络7层
- 做法:
1.在本地(windows)看是否能ping通,(可以)
2.在虚拟机看是否能ping通,(不能)
那就能定位问题了,在 /etc/hosts 添加 ip-域名 的映射,问题解决