AstrBot icon indicating copy to clipboard operation
AstrBot copied to clipboard

[Bug] 当应用内部访问多次 github api 时会提示 API rate limit exceeded

Open shaoLian-LH opened this issue 8 months ago • 6 comments

What happened / 发生了什么

现象

当多次利用“从链接安装插件”能力时,在达到未知的次数后在 astrbot 中日志会产生 “API rate limit exceeded” 报错。但不会影响主流程的使用。

相关 issue

[Feat] 支持配置GitHub令牌以绕过部分限制

Reproduce / 如何复现?

在单个容器/ip 下的 astrbot 系统中尽可能多次触发 github api 请求相关操作,在平台日志可看到相关 error log

AstrBot version, deployment method (e.g., Windows Docker Desktop deployment), provider used, and messaging platform used. / AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器

  • astrbot: v4.22.0
  • orbstack: v2.0.5
  • docker: v28.5.2
  • macos: v26.3.1

OS

macOS

Logs / 报错日志

// 其中 ip 部分用 * 号处理了

2026-03-24 08:49:09.059] [Core] [INFO] [routes.plugin:511]: 正在安装插件 https://github.com/shaoLian-LH/astrbot_plugin_article_summary
[2026-03-24 08:49:09.060] [Core] [INFO] [core.zip_updator:157]: 正在下载更新 astrbot_plugin_article_summary ...
[2026-03-24 08:49:09.546] [Core] [ERRO] [v4.22.0] [core.zip_updator:61]: 请求 https://api.github.com/repos/shaoLian-LH/astrbot_plugin_article_summary/releases 失败,状态码: 403, 内容: {"message":"API rate limit exceeded for *.*.*.* (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}
[2026-03-24 08:49:09.547] [Core] [ERRO] [v4.22.0] [core.zip_updator:84]: 解析版本信息时发生异常: 请求失败,状态码: 403
[2026-03-24 08:49:09.548] [Core] [WARN] [v4.22.0] [core.zip_updator:169]: 获取 shaoLian-LH/astrbot_plugin_article_summary 的 GitHub Releases 失败: 解析版本信息失败,将尝试下载默认分支
[2026-03-24 08:49:09.549] [Core] [INFO] [core.zip_updator:175]: 正在从默认分支下载 shaoLian-LH/astrbot_plugin_article_summary
[2026-03-24 08:49:12.268] [Core] [INFO] [star.updator:58]: 正在解压压缩包: /AstrBot/data/plugins/astrbot_plugin_article_summary.zip

Are you willing to submit a PR? / 你愿意提交 PR 吗?

  • [ ] Yes!

Code of Conduct

shaoLian-LH avatar Mar 24 '26 01:03 shaoLian-LH

Hi @shaoLian-LH! I'm Dosu and I’m helping the AstrBot team.

感谢你提交这个 Bug 报告!

根据调研,AstrBot 目前确实不支持配置 GitHub 个人访问令牌,所有 GitHub API 请求都是未经身份验证的,这导致了你遇到的 rate limit 问题。

这个问题已经在之前的 Issue #1277 和你引用的 Issue #2555 中被讨论过。相关的代码位于:

临时解决方案:如日志所示,当 API 请求失败时,系统会自动回退到从默认分支下载,所以插件安装通常还是能够成功的。

这是一个已知的功能缺失,需要添加 GitHub token 配置支持来根本解决。

To reply, just mention @dosu.


Share context across your team and agents. Try Dosu.

Leave Feedback Learn about AstrBot with Dosu Add Dosu to your team

dosubot[bot] avatar Mar 24 '26 01:03 dosubot[bot]

Investigating this GitHub API rate limit issue — will submit a fix.

BillionClaw avatar Mar 24 '26 02:03 BillionClaw

Investigating this GitHub API rate limit issue — will submit a fix.

BillionClaw avatar Mar 24 '26 03:03 BillionClaw

Investigating this GitHub API rate limit issue — will submit a fix.

BillionClaw avatar Mar 24 '26 06:03 BillionClaw

Investigating this GitHub API rate limit issue — will submit a fix.

BillionClaw avatar Mar 24 '26 06:03 BillionClaw

可以考虑更换api节点或者过一会再重试。

Soulter avatar Jun 27 '26 07:06 Soulter