从本地迁移至JIRA Cloud后Python连接超时问题求助
刚完成从本地JIRA部署到JIRA Cloud的迁移,使用Python连接新实例时出现超时错误,推测存在连接阻塞,但尚未找到有效解决方案。
目前通过浏览器、VBA、Excel Power Query、Postman均可正常调用JIRA Cloud API,说明连接信息(域名、邮箱)及API Token均无误。Python代码基于Atlassian官方示例编写,未收到服务器返回的错误码,报错为重试次数超限仍未获得响应,具体错误信息如下:
HTTPSConnectionPool(host='abc.atlassian.net', port=443): Max retries exceeded with url: /rest/api/3/issue/ABC-123 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x000001F684CF8580>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))
怀疑问题出在Python环境缺少证书或SSL相关配置,附上使用的Python代码:
# This code sample uses the 'requests' library: # http://docs.python-requests.org import requests from requests.auth import HTTPBasicAuth import json url = "https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}" auth = HTTPBasicAuth("email@example.com", "<api_token>") headers = { "Accept": "application/json" } response = requests.request( "GET", url, headers=headers, auth=auth ) print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))
内容的提问来源于stack exchange,提问作者reddwarfcrew

