Skip to content
Latchkey

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.

Bazel output
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
# .bazelrc
build:ci --noshow_progress --curses=no --color=no
build:ci --remote_cache=grpcs://cache.example:443
test:ci --test_output=errors --keep_going

Ensure the .bazelrc reaches the runner

  1. Confirm .bazelrc is committed (git ls-files .bazelrc).
  2. If you split config into ci.bazelrc, import it: import %workspace%/ci.bazelrc.
  3. Run bazel build --config=ci --announce_rc //... to print which rc files loaded.

How to prevent it

  • Define every --config group in a committed .bazelrc.
  • Use --announce_rc in CI to verify which rc files Bazel loaded.
  • Import split rc files explicitly rather than relying on discovery.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →