inspector port is used
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:
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. 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.
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 inTUNA_INSPECT_ADDRis invalid.
What to doโ
- If another tuna tunnel holds the port, the message names its command, PID, and address. Stop it or pick another port.
- Set a free port:
tuna http 8080 --inspect-port=4101. - If the port doesn't matter, remove
--inspect-portand theTUNA_INSPECT_PORTvariable โ tuna will pick a free one itself. - If you run several tunnels with
tuna start, give each its own port, see Several tunnels.