Skip to content

fix(http): send a PlatformIO-compatible User-Agent so cold registry downloads stop 403ing (#1783) - #1784

Merged
zackees merged 1 commit into
mainfrom
agent/registry-user-agent
Oct 29, 2026
Merged

zackees merged 1 commit into
mainfrom
agent/registry-user-agent

Conversation

@zackees

@zackees zackees commented Oct 29, 2026

Copy link
Copy Markdown
Member

Problem

main cannot build any board whose toolchain/framework archive is not already cached:

build error: package error: package error: download failed for
https://dl.registry.platformio.org/download/platformio/tool/framework-arduino-avr/5.4.0/framework-arduino-avr-5.4.0.tar.gz:
HTTP 403 Forbidden (gave up after 1 attempts at byte offset 0; error is not retryable)

Reproduced in ci-minimal run 40862560392 at 339e4baf:
Arduino Uno / build and Teensy 4.1 / build failed in ~15 s, before compiling, and
CI selected coverage (a merge-queue-required context) went red with them. The same boards
passed two hours earlier in run 40847963620 only because their archives were in the cache.

dl.registry.platformio.org now gates archive downloads on the User-Agent prefix:

UA Answer
none / reqwest default 403
fbuild/2.5.47 403
pio/6.1.16, Mozilla/5.0 403
PlatformIO/5.0.0, PlatformIO/6.1.0, PlatformIO/6.2.0, PlatformIO/6.2.0 (fbuild/2.5.47) 302 → signed mirror (200)

Accept / X-Requested-With do not satisfy it. fbuild_core::http is the single shared
reqwest client every fbuild download goes through, and it set no UA — so any new board,
cache reset or cold canary is red. Tracked as #1783.

Change

One function plus three .user_agent(...) builder calls in crates/fbuild-core/src/http.rs:

pub fn registry_user_agent() -> String {
    format!("PlatformIO/6.2.0 (fbuild/{})", env!("CARGO_PKG_VERSION"))
}

Applied to client(), client_with_timeout() and blocking_client(). Only the
PlatformIO/ prefix is gated, and the comment part keeps fbuild identifiable in
registry-side logs. Callers that set their own UA per request (the update check) still win.

Verification

Live, through the fixed shared client, against the exact URL from the failure:

soldr cargo test -p fbuild-core --test it zz_live_registry_probe -- --nocapture
status=206 Partial Content bytes=1024 content-type=binary/octet-stream
test result: ok. 1 passed; 0 failed      # temp probe, not committed

Before the change the same GET returned 403 (curl evidence above).

Gates (Linux, soldr only):

soldr cargo test -p fbuild-core --lib http::      -> 4 passed; 0 failed
soldr cargo fmt --all -- --check                  -> clean (rc=0)
soldr cargo clippy --workspace --all-targets -- -D warnings -> clean (rc=0)
uv run -m ci.run_dylint --package fbuild-core     -> rc=0
ci/enforce_platform_boundary.py --print-totals    -> rows=44; dylint_rows=43, rc=0
ci/check_test_layout.py, ci/check_dylint_allowlists.py -> ok / current

No new module, no new dependency, no production behaviour change other than the header.

…nts (#1783)

dl.registry.platformio.org now refuses archive downloads whose User-Agent
does not start with `PlatformIO/`:

  {"message":"This download method is not supported. Please use
   PlatformIO Core to install packages."}  (HTTP 403)

fbuild_core::http builds the one reqwest client every download uses and set
no UA, so every cold toolchain/framework fetch failed with
"download failed ... HTTP 403 Forbidden ... error is not retryable".
`ci-minimal` run 40862560392 went red on Arduino Uno and Teensy 4.1 in ~15 s
before compiling; the same boards had passed two hours earlier purely
because their archives were cached.

Send `PlatformIO/6.2.0 (fbuild/<version>)` from client(),
client_with_timeout() and blocking_client(). Only the `PlatformIO/` prefix is
gated; the comment part keeps fbuild visible to registry logs. Accept /
X-Requested-With headers do not satisfy the gate.

Live proof through the real shared client against the exact failing URL:
status=206 Partial Content bytes=1024 content-type=binary/octet-stream
(before: 403).
@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zackees
zackees added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit c179779 Oct 29, 2026
29 checks passed
@zackees
zackees deleted the agent/registry-user-agent branch October 29, 2026 12:29
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant