1.1.4 Inspecting Server State
extraSome Bazel server state survives on disk, while some exists only in the running
process. Knowing which kind you are looking for makes troubleshooting much less
mysterious: you can inspect files under output_base, but a server restart
discards its in-memory analysis state. 1.1.3 Server/Client Architecture explains why Bazel
uses the long-lived server in the first place.1,2,3
What Lives Under output_base
Bazel state is split across several surfaces. Under $(bazel info output_base) you can inspect durable directories such as server/, action_cache/, and execroot/.4,5 If 0.1.4 Output Root explained where Bazel stores outputs, this is the server-facing half of the same tree.
$(bazel info output_base)/
├── action_cache/ # persistent metadata on disk
├── server/ # logs, socket, server files
└── execroot/ # working tree for actions (bazel-out/ lives here)
The bazel-out/ symlink you see in the workspace root points into execroot/ under this tree. server/ holds server-side files such as logs and sockets, action_cache/ is persistent metadata on disk, and execroot/ is the working tree for actions.4
The In-Memory Analysis Cache
The analysis cache lives inside the running server process rather than in another directory under output_base. It keeps loaded BUILD files, dependency-graph analysis, and related incremental state.1,2,3 The loading phase caches parsed BUILD files. The analysis phase caches the dependency graph for the requested targets, so later commands can often skip most of that work when nothing relevant changed.3
What you can inspect from the CLI
You do not need a deep debugger to answer the first useful questions:
bazel info output_base
bazel info server_pid
bazel info server_log
bazel dump --skyframe=summary
bazel info output_base answers "where is the on-disk state?"5 server_pid and server_log answer "which process is serving me, and where is its log?"5 bazel dump --skyframe=summary goes one step further: it exposes a developer-facing dump of the dependency graph held in the server's analysis cache.5 dump is intended primarily for Bazel developers, and its output is not specified and may change.5
What You Need To Know For Troubleshooting
You do not need SkyKey, SkyValue, or the evaluator protocol to troubleshoot
ordinary server state. First decide whether you are looking for a file under
output_base or for in-memory state that vanished with the server.2,5
Later levels give names to the pieces of that cache. 2.4.1 Skyframe & Incrementality explains why Bazel can invalidate only the affected parts of the dependency graph, and 5.9 Skyframe explains the internal data model behind that behavior.
The Bazel server exposes two observable layers: inspectable directories under
output_base, and warm analysis state inside the running server process. Use
bazel info, server_pid, and server_log for the disk-backed layer. Treat
bazel dump --skyframe=summary as a narrow, unstable preview. 2.4.1 Skyframe & Incrementality
explains the mechanism behind the in-memory graph.
Check your understanding · 2 questions
1.Match each server-state surface to where it lives:
Drag each answer onto the matching prompt, or click an answer and then click a prompt
2.Which command is the stable operator-facing way to locate the active server log?
Select one answer
Footnotes
-
Client/server implementation — long-lived server, cached metadata across invocations, and the client/server split ↩1 ↩2
-
Optimize Iteration Speed — analysis cache lives in server memory and is lost when the server exits ↩1 ↩2 ↩3
-
Build programs with Bazel — loading caches
BUILDfiles and analysis caches the dependency graph across builds ↩1 ↩2 ↩3 -
Output Directory Layout —
outputBasecontents includingserver/,action_cache/, andexecroot/↩1 ↩2 -
Commands and Options —
bazel info output_base,server_pid,server_log, anddump --skyframe.dumpoutput is intended for Bazel developers and may change ↩1 ↩2 ↩3 ↩4 ↩5 ↩6