Bazel shutdown

Posted

Ever change proxy settings or install new root certificates, and bazel just won’t pick up the changes? Run bazel shutdown and then your bazel command again, it should work this time.

Details

The Bazel client uses a long-lived server process to cache information needed to make certain commands, such as bazel query, fast. The server is launched the first time bazel is run for a given output base (which by default is determined by the path of the base workspace directory and your userid) and it shuts down after a period of inactivity (which defaults to 3 hours).

The server is the process that actually makes network requests, not the bazel frontend process. Since it captures certain configuration state at launch that doesn’t refresh until it’s relaunched (such as HTTP proxy settings or the JVM Truststore), you’ll need to run bazel shutdown to force it to shutdown and re-capture that configuration state.