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

# Troubleshooting

> Match a bqto tunnel error to its cause and fix, get debug output for a bug report, and fix common install and license key problems.

When a check or the tunnel fails, bqto prints the cause and a `Fix:` line. The fix is a command or
a change that you can make, such as the permission to ask for, the quota to raise, or the command to
run. First, read the `error:` line on stderr and the `Fix:` line under it.

## Tunnel errors

When the tunnel fails, bqto recognizes these errors, and prints the cause and the fix:

| What you see | Cause | Fix |
| - | - | - |
| `4033` | IAP refused the tunnel | Check `roles/iap.tunnelResourceAccessor`, and that the bastion is still running |
| `4003` | IAP cannot reach port 22 on the bastion | Allow ingress on tcp:22 from `35.235.240.0/20` to the bastion |
| `… API has not been used in project … or it is disabled` under `last stderr:` | gcloud needs an API that is off | Enable the API that the line names, for example `gcloud services enable oslogin.googleapis.com`. [Permissions](https://docs.bqto.dev/reference/permissions.md#apis) lists the APIs |
| `4047` | IAP cannot find the bastion | It is still starting or was stopped. Run `bqto connect` again |
| `Permission denied (publickey)` | OS Login refused the SSH certificate. A new bastion can refuse it while it boots, so bqto retries for up to a minute before it reports this | Grant `roles/compute.osLogin` on the project |
| `SSH using certificates is not yet generally available` | gcloud is older than 550.0.0 | Run `gcloud components update`, or use your package manager (`apt`, `dnf`, `brew`) if you installed gcloud with one |
| `Address already in use`, `Cannot bind port` | Another program took the port of the tunnel while the tunnel started | Run `bqto connect` again |
| `ADC account (…) does not match the active gcloud account (…)` | The two logins use different accounts | Run the command that bqto prints. Both logins must be the same account |
| `x509: certificate signed by unknown authority` | This machine has no CA certificates (common in slim containers), or a TLS-inspecting proxy shows its own certificate | Install the CA certificates (`apt-get install ca-certificates` on Debian or Ubuntu), or add the CA of the proxy |

## Other common problems

| Problem | Fix |
| - | - |
| You have `roles/editor`, and the tunnel fails | `roles/editor` does not include the IAP permission. Add `roles/iap.tunnelResourceAccessor` |
| A local port that you asked for with `-p` is taken | bqto stops before it creates the bastion. Free the port, or leave out `-p` |
| An organization policy rejects the bastion | bqto prints the constraint and where it is set. Pass both to your platform team. See [Bastion settings](https://docs.bqto.dev/guides/bastion-settings.md#organizations-that-restrict-what-a-vm-may-be) |
| `Permission denied (publickey)` with `--image` (bqto Pro) | The image must support OS Login certificates, which needs OpenSSH 7.4 or later |
| A Cloud Run service answers 403 in the browser (bqto Pro) | Use `--web`, and check `roles/run.invoker` on the service. See [Cloud Run](https://docs.bqto.dev/services/cloud-run.md) |
| bqto refuses a bqto Pro flag, service, or command | You run the free bqto, or bqto Pro has no valid key. Run `bqto version` and `bqto license status` |
| `bqto version` prints `bqto`, not `bqto Pro` | Another `bqto` comes first on your `PATH`. Run `command -v bqto`. See [Install](https://docs.bqto.dev/install.md#if-you-already-have-the-free-bqto) |
| bqto Pro runs as the free bqto behind a company proxy | A proxy that inspects HTTPS counts as no answer from Polar. Let `api.polar.sh` through it. See [License key](https://docs.bqto.dev/pro/license-key.md#proxies-that-inspect-https) |

## Debug output

If the `Fix:` line is not enough, run the same command with `--debug`. Put the flag after `connect`
or before it, as in `bqto connect --debug ...` or `bqto --debug connect ...`. For the wizard, run
`bqto --debug`. You can also set `BQTO_DEBUG=1`.

bqto then writes these lines to stderr. Each line starts with `debug:`:

* The Google API calls, and how long they took.
* Each retry.
* Each `gcloud` command.
* The bastion that bqto creates and deletes.
* Each new attempt to open the tunnel, with its number and the last lines of gcloud from the
  attempt before.
* Each tunnel reconnect, with the last output of gcloud.

The debug output leaves out tokens and the arguments of the command after `--`, which can hold
passwords. It does show project, instance, network, and bastion names. Read it before you paste it
into a public bug report.

## Still stuck

[Support](https://docs.bqto.dev/reference/support.md) says how to open an issue.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.