bazelbuild / bazel-central-registry

The central registry of Bazel modules for the Bzlmod external dependency system.

Home Page:https://registry.bazel.build

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: GET returned 403 Forbidden from bcr.bazel.build

prestonvanloon opened this issue · comments

What happened?

ERROR: /opt/actions-runner/_work/eth-client-docker-image-builder/eth-client-docker-image-builder/source/cmd/validator/BUILD.bazel:38:10: While resolving toolchains for target //cmd/validator:validator (64afcc3): invalid registered toolchain '//toolchains:all': while parsing '//toolchains:all': no such package '@@rules_cc~//cc': java.io.IOException: Error downloading [https://bcr.bazel.build/modules/rules_cc/0.0.9/patches/module_dot_bazel_version.patch] to /data/gh-home/.cache/bazel/_bazel_root/e06669d813ee8962af5ff3fbbdf856de/external/rules_cc~/.tmp_remote_patches/module_dot_bazel_version.patch: GET returned 403 Forbidden

Version

Development (host) and target OS/architectures:

Output of bazel --version: bazel 7.1.0

Version of relevant rules from the WORKSPACE or MODULE.bazel file: https://github.com/prysmaticlabs/prysm

Language(s) and/or frameworks involved: go

How to reproduce

Not sure, but our build runners were hitting this issue until we disabled bzlmod.

Any other information?

What causes a 403? How can it be prevented?

How exactly do I setup a registry mirrior? Can it be done with a simple GCP bucket or does a server need to be online to serve requests.

What causes a 403? How can it be prevented?

Do you maybe have proxies set up?

How exactly do I setup a registry mirrior? Can it be done with a simple GCP bucket or does a server need to be online to serve requests.

A simple GCS bucket is enough. You can simply clone the registry contents (i.e. this Git repo) and serve it from GCS. Use the --registry flag to point Bazel at your own registry URL. (see https://github.com/bazelbuild/bazel-central-registry?tab=readme-ov-file#depending-on-the-bcr-infrastructure-and-how-not-to)