cockroach debug zip connects to your cluster and gathers information from each active node into a single .zip file (inactive nodes are not included). For details on the .zip contents, see Files.
You can use the command in conjunction with cockroach debug zip to merge the collected logs into one file, making them easier to parse.
The files produced by
cockroach debug zip can contain highly , such as usernames, hashed passwords, and possibly table data. Use the --redact flag to configure CockroachDB to redact sensitive data when generating the .zip file (excluding range keys) if intending to share it with Cockroach Labs.Details
Use cases
cockroach debug zip is an expensive operation and impacts cluster performance.Only use this command as an emergency measure under the guidance of Cockroach Labs.Particularly fetching stack traces for all goroutines is a “stop-the-world” operation, which can momentarily but significantly increase SQL service latency. Exclude these goroutine stacks by using the --include-goroutine-stacks=false flag.debug zip is useful:
- If you experience severe or difficult-to-reproduce issues with your cluster, Cockroach Labs might ask you to send us your cluster’s debugging information using
cockroach debug zip. We recommend reducing the*.zipfile size by only retrieving debugging information for the relevant time range of the issue by using the--files-from, and/or--files-untilflags. - To collect all of your nodes’ logs, which you can then parse to locate issues. You can optionally use the flags to retrieve only the log files. For more information about logs, see . Also note:
- Nodes that are currently cannot deliver their logs over the network. For these nodes, you must log on to the machine where the
cockroachprocess would otherwise be running, and gather the files manually. - Nodes that are currently up but disconnected from other nodes (e.g., because of a ) may not be able to respond to
debug ziprequests forwarded by other nodes, but can still respond to requests for data when asked directly. In such situations, we recommend using the--hostflag to pointdebug zipat each of the disconnected nodes until data has been gathered for the entire cluster.
- Nodes that are currently cannot deliver their logs over the network. For these nodes, you must log on to the machine where the
Files
cockroach debug zip collects log files, heap profiles, CPU profiles, and goroutine dumps from the last 48 hours, by default.
The following files collected by cockroach debug zip, which are found in the individual node directories, can be filtered using the --exclude-files, --include-files, --files-from, and/or --files-until flags:
The following information is also contained in the
.zip file, and cannot be filtered:
- System tables. The following system tables are not included:
system.userssystem.web_sessionssystem.join_tokenssystem.commentssystem.uisystem.zonessystem.statement_bundle_chunkssystem.statement_statisticssystem.transaction_statistics
- Cluster events
- Database details
- Schema change events
- Database, table, node, and range lists
- Node details
- Node liveness
- Gossip data
- Stack traces
- Range details
- Jobs
- CPU profiles
- A script (
hot-ranges.sh) that summarizes the hottest ranges (ranges receiving a high number of reads or writes)
Subcommands
While thecockroach debug command has a few subcommands, users are expected to use only the , , , , , and subcommands.
We recommend using the and subcommands only when directed by the .
The other debug subcommands are useful only to Cockroach Labs. Output of debug commands may contain sensitive or secret information.
Synopsis
The following flags must apply to an active CockroachDB node. If no nodes are live, you must .
Flags
Thedebug zip subcommand supports the following general-use, client connection, and logging flags.
General
Client connection
Logging
By default, this command logs messages tostderr. This includes events with WARNING and higher.
If you need to troubleshoot this command’s behavior, you can .
Examples
Generate a debug zip file
Generate the debug zip file for an insecure cluster:Secure examples assume you have the appropriate certificates in the default certificate directory,
${HOME}/.cockroach-certs/.Generate a debug zip file for a time range
Generate a debug zip file containing only debugging information for a specified time range:Generate a debug zip file with logs only
Generate a debug zip file containing only log files:Redact sensitive information
Log redaction
Example of a log string without--redact enabled:
Cluster settings redaction
Example cluster settings incrdb_internal.cluster_settings.txt without --redact enabled:
server.identity_map.configuration is always redacted, since sensitive equals true.
Enable log redaction:
crdb_internal.cluster_settings.txt with --redact enabled:
server.identity_map.configuration is still redacted. cluster.organization is now redacted since reportable equals false and the Cockroach Labs Testing value is not the default value (in this case, the empty string).
Hostname and IP address redaction
Example ofstatus.json without hostname and IP address redaction enabled:
nodes.json and gossip.json files are never redacted, even when debug.zip.redact_addresses.enabled is enabled.
Generate .zip with --redact enabled:
status.json with hostname and IP address redaction:

