bazel
Bazel Exit Codes
Exit codes returned by Bazel (and Blaze) build commands. They distinguish build success, test failures, command-line errors, and internal tool failures, making them useful for scripting CI pipelines.
15 codes
references bazel.build/run/scripts
· All codes 15 codes
- 0 Success The build (or test, or query) completed successfully.
- 1 Build Failed The build failed. One or more build actions did not complete successfully. Check the build output for the failing target and action.
- 2 Command Line Problem A command-line usage error: bad or illegal flags, an unrecognized command, or an invalid environment variable. No build was attempted.
- 3 Tests Failed or Timed Out The build succeeded, but one or more test targets failed or timed out. Only returned by `bazel test`.
- 4 No Tests Found The build succeeded, but no test targets were found even though testing was requested (e.g. all targets were filtered out by `--test_tag_filters`).
- 7 Query Command Failure A `bazel query` invocation failed outright (as opposed to completing with partial results). Check the query expression and target patterns for errors.
- 8 Build Interrupted The build was interrupted (for example by Ctrl-C) but Bazel still managed to terminate with an orderly shutdown.
- 9 Lock Held, No Block Another Bazel command already holds the server lock and `--noblock_for_lock` was passed, so this invocation exited immediately instead of waiting for the lock to be released.
- 32 External Environment Failure The build failed because of a problem that is not local to this machine, such as a failure in a remote service Bazel depends on.
- 33 Out of Memory Bazel ran out of memory and crashed. Consider increasing the JVM heap size with `--host_jvm_args=-Xmx<size>` or reducing build parallelism.
- 36 Local Environmental Issue A local environmental problem was detected that is suspected to be permanent, such as a misconfigured toolchain or missing system dependency.
- 37 Internal Bazel Error An internal Bazel error occurred that is not a build failure. This indicates a bug in Bazel itself or an unhandled condition. File an issue with the full output.
- 38 Transient Build Event Service Error Bazel encountered a transient error while publishing build results to the Build Event Service (BES). Retrying the invocation may succeed.
- 39 Remote Cache Blobs Evicted Blobs that Bazel required were evicted from the remote cache before the build could read them. Re-running the build will typically repopulate the cache.
- 45 Persistent Build Event Service Error Bazel encountered a persistent error while publishing build results to the Build Event Service (BES) and gave up retrying. Check the BES endpoint configuration and connectivity.