与官网API授权是出现requests.exceptions.ConnectionError

请教下,在与官网的表格api通讯时,会是不是出现这种问题requests.exceptions.ConnectionError

导致报错失效无法通讯,能否解释下为什么会出现,避免自动化程序总出现问题,谢谢。

或者有没有一些建议,好让在程序中加入一些判断,让程序更健壮,谢谢。

urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f839055e670>: Failed to establish a new connection: [Errno -2] Name or service not known

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='cloud.seatable.cn', port=443): Max retries exceeded with url: /api/v2.1/dtable/app-access-token/ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f839055e670>: Failed to establish a new connection: [Errno -2] Name or service not known'))

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='cloud.seatable.cn', port=443): Max retries exceeded with url: /api/v2.1/dtable/app-access-token/ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f839055e670>: Failed to establish a new connection: [Errno -2] Name or service not known'))

你的配置是什么,这里连接失败,报错写的是名称或者服务器未知

配置就只有table name、api token和server url,没有其他多余的参数,已经试了,会偶发,有时没问题
我是架设成flask服务器的
debug到的点在auth后,获取表格数据时出错的,读不到信息
baseInfo = self.base.get_metadata()

urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f839055e670>: Failed to establish a new connection: [Errno -2] Name or service not known

Name or service not known 错误是你的本地域名解析的问题。

很奇怪呀
我都还没到我本地吧,在与官网auth的过程出现的,我程序的作用的将官网的数据转移到内网,在获取官网数据时就得不到表头的数据,就报错,多试几次就可以,自动程序只是执行一次嘛,所以会有错

2023-02-27 15:00:00,360-app-ERROR:syncData:HTTPSConnectionPool(host=‘cloud.seatable.cn’, port=443): Max retries exceeded with url: /api/v2.1/dtable/app-access-token/ (Caused by NewConnectionError(’<urllib3.connection.HTTPSConnection object at 0x7f376c79d090>: Failed to establish a new connection: [Errno -2] Name or service not known’))