开发者社区 问答 正文

日志服务python SDK 请求查询报错 Max retries exceeded with url

问题描述

阿里云日志服务  python SDK 请求日志查询 发生错误  Max retries exceeded with url         url超过最大重试次数

我是用任务 请求 查询日志的,但是经常发生 如下错误, 拉取到的数据 也比 阿里云里面少。

aliyun.log.logexception.LogException: {"errorCode": "LogRequestError", "errorMessage": "HTTPConnectionPool(host='offeradmin-log.cn-hongkong.log.aliyuncs.com', port=80): Max retries exceeded with url: /logstores/offer_admin-bi?from=1667354579&to=1667354640&type=log&line=1000&offset=0&reverse=true&powerSql=False&query=%2A%7CSELECT+offer_id%2Caff_id%2Cdsp_id%2Ccount_if%28type%3D%27click%27+AND+status+%3D+302%29+as+click%2Ccount_if%28type%3D%27click%27+AND+status+%3D+475%29+as+click_fail%2Ccount_if%28type%3D%27install%27+AND++status+%3D+200+and+%28blocked_reason+%3D%27%27+OR+blocked_reason+is+null%29%29+as+install%2Ccount_if%28type%3D%27install%27+AND+status+%3D+200+and+blocked_reason+is+NOT+null+and+blocked_reason+%21%3D%27%27%29+as+reject%2Ccount_if%28type%3D%27event%27%29+as+event%2Cdate_trunc%28%27minute%27%2C+__time__%29+as+ctime%2Cdate_format%28date_trunc%28%27minute%27%2C+__time__%29%2C+%27%25H%27%29+AS+h+WHERE+offer_id+IS+NOT+null+and+aff_id+is+not+null+GROUP+by+offer_id%2Cctime%2Caff_id%2Cdsp_id+LIMIT+0%2C10000 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fc36758dac0>: Failed to establish a new connection: [Errno -2] Name or service not known'))", "requestId": ""}

www/wwwroot/offeradmin/a6b6692a7fc1687025bf3b1b1d59d9ee_venv/lib/python3.9/site-packages/apscheduler/util.py:436: PytzUsageWarning: The localize method is no longer necessary, as this time zone supports the fold attribute (PEP 495). For more details on migrating to a PEP 495-compliant implementation, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html

  return tzinfo.localize(dt)

期望结果

日志请求 发生错,是什么原因?是请求次数限制还是 网络问题

已尝试的方法

展开
收起
1980999268505864 2022-11-02 11:24:51 482 分享 版权
2 条回答
写回答
取消 提交回答
  • 全栈JAVA领域创作者

    上面那个哥们的方法你试一下行不行

    2022-11-26 10:14:32
    赞同 展开评论
  • 这个是网络不通,你可以先在机器上, curl 一下域名是否能联通:offeradmin-log.cn-hongkong.log.aliyuncs.com

    2022-11-02 14:39:12
    赞同 展开评论