Bazel "--config=ci" Not Found / Bad .bazelrc in CI
Bazel’s --config=ci expands to a named group of flags defined in .bazelrc (lines like build:ci --flag). If no such group exists - or the .bazelrc is not present on the runner - Bazel errors that the config value is undefined.
What this error means
A CI invocation with --config=ci fails immediately with "Config value 'ci' is not defined". It is deterministic: either the build:ci lines are missing or the .bazelrc that defines them is not on the runner.
ERROR: Config value 'ci' is not defined in any .rc file
(did you mean to add "build:ci ..." lines to .bazelrc?)Common causes
No build:ci group in .bazelrc
The --config=ci shorthand needs matching build:ci/test:ci lines. Without them the config name is undefined.
.bazelrc not checked in or not at the root
If the .bazelrc defining the group is gitignored, lives elsewhere, or is in a separate import not loaded, the runner never sees the config.
How to fix it
Define the ci config group
Add build:ci/test:ci lines with the flags CI should use.
# .bazelrc
build:ci --noshow_progress --curses=no --color=no
build:ci --remote_cache=grpcs://cache.example:443
test:ci --test_output=errors --keep_goingEnsure the .bazelrc reaches the runner
- Confirm
.bazelrcis committed (git ls-files .bazelrc). - If you split config into
ci.bazelrc, import it:import %workspace%/ci.bazelrc. - Run
bazel build --config=ci --announce_rc //...to print which rc files loaded.
How to prevent it
- Define every
--configgroup in a committed.bazelrc. - Use
--announce_rcin CI to verify which rc files Bazel loaded. - Import split rc files explicitly rather than relying on discovery.