Skip to content

[Bug] Bazel CI build fails due to Maven Central rate limiting (HTTP 429) #10341

@lizhimins

Description

@lizhimins

Problem

The Bazel CI workflow (bazel-compile) consistently fails during the maven_install dependency fetch phase. Maven Central returns HTTP 429 (Too Many Requests) for a large number of artifacts, causing the entire build to fail.

Error log excerpt:

ERROR: An error occurred during the fetch of repository 'maven':
Error while fetching artifact with coursier:
Error fetching artifacts:
https://repo1.maven.org/maven2/software/amazon/awssdk/utils/2.20.29/utils-2.20.29.jar: download error: 
  Caught java.io.IOException (Server returned HTTP response code: 429 ...)
... (3600+ download failures)

FAILED: Build did NOT complete successfully (88 packages loaded, 1561 targets configured)

Root Cause

  1. fetch_sources = True in WORKSPACE doubles the number of download requests by fetching -sources.jar for every dependency — unnecessary for CI builds.
  2. Single Maven repository configured with no fallback mirror.
  3. No dependency caching in the GitHub Actions workflow, so every run downloads all artifacts from scratch.

Proposed Fix

  1. Set fetch_sources = False to eliminate unnecessary source jar downloads.
  2. Add https://repo.maven.apache.org/maven2 as a fallback repository.
  3. Add actions/cache for ~/.cache/bazel in the workflow to avoid redundant downloads across runs.
  4. Upgrade actions/checkout from v2 to v4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions