Rust cargo 使用 sparse 索引更新仓库时,会触发反爬虫机制

31 views
Skip to first unread message

last first

unread,
May 28, 2023, 3:06:27 AM5/28/23
to USTC_LUG
我在编译项目时,cargo 会首先更新并下载软件包,但由于我的项目依赖的 crates 太多,导致触发了反爬机制,报 429 错误:
    Updating `crates-io` index
error: failed to get `unic-langid-macros-impl` as a dependency of package `unic-langid-macros v0.9.1`
    ... which satisfies dependency `unic-langid-macros = "^0.9"` (locked to 0.9.1) of package `unic-langid v0.9.1`
    ... which satisfies dependency `unic-langid = "^0.9"` (locked to 0.9.1) of package `fluent v0.16.0`
    ... which satisfies dependency `fluent = "^0.16"` (locked to 0.16.0) of package `fluent-templates v0.8.0`
    ... which satisfies dependency `fluent-templates = "^0.8.0"` (locked to 0.8.0) of package `ruffle_core v0.1.0 (E:\t\ruffle-nightly-2023-05-28\core)`
    ... which satisfies path dependency `ruffle_core` (locked to 0.1.0) of package `exporter v0.1.0 (E:\t\ruffle-nightly-2023-05-28\exporter)`

Caused by:
  failed to query replaced source registry `crates-io`

Caused by:
  download of un/ic/unic-langid-macros-impl failed

Caused by:
  failed to get successful HTTP response from `https://mirrors.ustc.edu.cn/crates.io-index/un/ic/unic-langid-macros-impl`, got 429
  body:
  <html>
  <head><title>429 Too Many Requests</title></head>
  <body>
  <center><h1>429 Too Many Requests</h1></center>
  <hr><center>openresty</center>
  </body>
  </html>

上述错误只在启用 sparse(稀疏)索引时出现。
config

Keyu Tao on behalf of USTC LUG

unread,
May 28, 2023, 3:35:24 AM5/28/23
to ustc...@googlegroups.com, qq3119...@gmail.com, l...@ustc.edu.cn
推测是和
https://github.com/ustclug/discussions/issues/294#issuecomment-1138804581
类似的问题。我目前将 http2_max_concurrent_streams 的值降低到了
40,还没有在校外测试,但是应该能够缓解。
> --
> 您收到此邮件是因为您订阅了Google网上论坛上的“USTC_LUG”群组。
> 要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到
> ustc_lug+u...@googlegroups.com
> <mailto:ustc_lug+u...@googlegroups.com>。
> 要在网络上查看此讨论,请访问https://groups.google.com/d/msgid/ustc_lug
> /84c90078-b211-47fa-954c-483ed10ba4c4n%40googlegroups.com
> <https://groups.google.com/d/msgid/ustc_lug/84c90078-b211-47fa-954c-
> 483ed10ba4c4n%40googlegroups.com?utm_medium=email&utm_source=footer>。

--
Linux User Group
University of Science and Technology of China
Homepage: https://lug.ustc.edu.cn/
E-Mail: l...@ustc.edu.cn
Keyu Tao (陶柯宇) <ta...@ustclug.org>
Reply all
Reply to author
Forward
0 new messages