> ## Documentation Index
> Fetch the complete documentation index at: https://www.cockroachlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# cockroach debug upload

export const InternalLink = ({version, path = "", children, ...props}) => {
  let detectedVersion = version || "stable";
  if (typeof window !== 'undefined' && !version) {
    const match = window.location.pathname.match(/\/docs\/([^/]+)/);
    if (match) {
      detectedVersion = match[1];
    }
  }
  const normalizedPath = path.startsWith("/") ? path.slice(1) : path;
  return <a href={`/docs/${detectedVersion}/${normalizedPath}`} {...props}>
      {children}
    </a>;
};

The `cockroach debug upload` <InternalLink path="cockroach-commands">command</InternalLink> uploads a `debug.zip` file generated by <InternalLink path="cockroach-debug-zip">`cockroach debug zip`</InternalLink> to <InternalLink path="support-resources">Cockroach Labs support</InternalLink>, directly from the machine where the file is stored. The command detects the file type automatically; only `debug.zip` files are supported.

Uploads are authenticated with an API key issued by Cockroach Labs for your cluster. To request an API key, open a ticket in the [Support Portal](https://support.cockroachlabs.com).

<Danger>
  The files produced by `cockroach debug zip` can contain highly <InternalLink path="configure-logs#redact-logs">sensitive, personally-identifiable information (PII)</InternalLink>, such as usernames, hashed passwords, and possibly table data. Generate the `.zip` file with the <InternalLink path="cockroach-debug-zip#redact">`--redact` flag</InternalLink> to redact sensitive data before uploading it.
</Danger>

The machine that runs the command must be able to reach:

* Cockroach Labs' upload endpoint: `crdb-diagnostics-endpoint.cockroachlabs.com`
* Google Cloud Storage: `storage.googleapis.com:443`

If outbound connections are restricted, either allow egress to these hosts or route the upload through a forward proxy with the [`--proxy` flag](#flags).

## Synopsis

```shell theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
$ cockroach debug upload {path to debug.zip} {flags}
```

## Subcommands

While the `cockroach debug` command has a few subcommands, users are expected to use only the <InternalLink path="cockroach-debug-zip">`zip`</InternalLink>, <InternalLink path="cockroach-debug-upload">`upload`</InternalLink>, <InternalLink path="cockroach-debug-encryption-active-key">`encryption-active-key`</InternalLink>, <InternalLink path="cockroach-debug-merge-logs">`merge-logs`</InternalLink>, <InternalLink path="cockroach-debug-list-files">`list-files`</InternalLink>, <InternalLink path="cockroach-debug-tsdump">`tsdump`</InternalLink>, and <InternalLink path="cockroach-debug-ballast">`ballast`</InternalLink> subcommands.

Cockroach Labs recommends using the <InternalLink path="cockroach-debug-encryption-decrypt">`encryption-decrypt`</InternalLink> and <InternalLink path="cockroach-debug-job-trace">`job-trace`</InternalLink> subcommands only when directed by the <InternalLink path="support-resources">Cockroach Labs support team</InternalLink>.

The other `debug` subcommands are useful only to Cockroach Labs. Output of `debug` commands may contain sensitive or secret information.

## Flags

The `debug upload` subcommand supports the following flags.

| Flag                      | Description                                                                                                                                                                                                                      |
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--crl-support-api-key`   | **Required.** The API key issued by Cockroach Labs that authenticates the upload. If both the flag and the environment variable are set, the flag takes precedence.<br /><br />**Env variable:** `COCKROACH_CRL_SUPPORT_API_KEY` |
| `--crl-support-ticket-id` | The support ticket ID to associate with the upload.                                                                                                                                                                              |
| `--proxy`                 | The forward proxy URL to use to reach Cockroach Labs' upload endpoint. If both the flag and the environment variable are set, the flag takes precedence.<br /><br />**Env variable:** `HTTPS_PROXY`                              |
| `--resume-session`        | Resume an interrupted upload. Set this flag to the upload session ID printed by the previous attempt.                                                                                                                            |

## Examples

### Upload a `debug.zip` file

Set the API key in the `COCKROACH_CRL_SUPPORT_API_KEY` environment variable or pass it with the `--crl-support-api-key` flag. To associate the upload with an existing support ticket, pass the ticket ID:

```shell theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
$ cockroach debug upload ./debug.zip --crl-support-ticket-id=12345
```

The command prints the upload session ID when the upload starts. When the upload completes, it prints the number of bytes uploaded and the transfer rate.

### Resume an interrupted upload

Failed transfers are retried automatically. If the upload still fails after the automatic retries, or is interrupted before it completes, the command output includes the upload session ID. Re-run the command with the `--resume-session` flag to continue the upload from where it stopped:

```shell theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
$ cockroach debug upload ./debug.zip --resume-session={session ID}
```

### Upload through a forward proxy

If the machine cannot reach the upload endpoint directly, pass the proxy URL with the `--proxy` flag or set the `HTTPS_PROXY` environment variable:

```shell theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
$ cockroach debug upload ./debug.zip --proxy=http://proxy.example.com:3128
```

## See also

* <InternalLink path="cockroach-debug-zip">`cockroach debug zip`</InternalLink>
* <InternalLink path="support-resources">Support Resources</InternalLink>
* <InternalLink path="cockroach-commands">`cockroach` Commands Overview</InternalLink>
* <InternalLink path="troubleshooting-overview">Troubleshooting Overview</InternalLink>
