> Markdown version of https://tuna.am/en/docs/troubleshooting/errors/inspector-port-is-used/. Documentation index: [llms.txt](https://tuna.am/en/llms.txt), full text in one file: [llms-full.txt](https://tuna.am/en/llms-full.txt). Any page is available as Markdown: append `.md` to its URL without the trailing slash.

# inspector port is used

```text
FATA[12:00:00] Failed to start Traffic Inspector: inspector port 4100 is used by tuna http (pid 81234, https://myapp.a.2na.am). Set another --inspect-port or unset TUNA_INSPECT_PORT

```

If the port is held by something other than tuna:

```text
FATA[12:00:00] Failed to start Traffic Inspector: inspector port 4100 is not available: listen tcp 127.0.0.1:4100: bind: address already in use. Set another --inspect-port or unset TUNA_INSPECT_PORT

```

tuna CLI prints this error when starting a tunnel with the [inspector](https://tuna.am/en/docs/tunnels/inspect.md). The tunnel doesn't start.

## Cause

The inspector port is set explicitly — with the `--inspect-port` flag or the `TUNA_INSPECT_PORT` variable — and it's taken by another tuna tunnel or another program. With an explicit port, tuna doesn't look for a free one; it exits so that the inspector address doesn't change without you noticing.

Without an explicit port, there's no error: the first tunnel takes 4040, the next ones 4041, 4042, and so on, see [Startup and port](https://tuna.am/en/docs/tunnels/inspect.md#port).

If the port is set incorrectly, the message is different:

* `invalid TUNA_INSPECT_PORT "abc"` — the variable isn't a number;
* `port 70000 is out of range 1-65535` — the port is outside the valid range;
* `failed to parse TUNA_INSPECT_ADDR: invalid port "abc"` — the port in `TUNA_INSPECT_ADDR` is invalid.

## What to do

1. If another tuna tunnel holds the port, the message names its command, PID, and address. Stop it or pick another port.
2. Set a free port: `tuna http 8080 --inspect-port=4101`.
3. If the port doesn't matter, remove `--inspect-port` and the `TUNA_INSPECT_PORT` variable — tuna will pick a free one itself.
4. If you run several tunnels with `tuna start`, give each its own port, see [Several tunnels](https://tuna.am/en/docs/tunnels/inspect.md#multi).
