# Troubleshooting

Here we have tried to collect all possible problems that our users have encountered and describe their solutions. Most problems are related to network issues or the user environment.

> **Tip.** Many errors and problems may already be solved in the latest version of the client, so before diagnosing or contacting [us](mailto:info@tuna.am) or the [community](https://telegram.me/+Kgbtt0_gJwI5ZmEy) for help, make sure you have the latest version of the client installed. Update instructions are available [here](https://tuna.am/en/docs/guides/update.md).

## Self-diagnosis of network availability

If you get errors when creating a tunnel, run the `tuna diagnose` command to get diagnostic information; the report will help you better understand where exactly the problem is.

```shell
Please wait, testing connectivity...

TLS connectivity:
  Google.com: ok [1.46189625s]
  Yandex.ru: ok [1.246520375s]
  tuna API: ok [1.484186875s]
DNS:
  api.tuna.am: alt-lb.tuna.am. → eu-lb.tuna.am. [147.45.149.16, 194.31.173.118]
  a.2na.am: edge-eu-a.2na.am. [2.28.136.177, 89.19.217.251]
TCP connectivity:
  tuna edge a 2.28.136.177:443: ok [41.53925ms]
  tuna edge a 89.19.217.251:443: ok [38.112708ms]
  tuna node DE node-1-de.2na.am:443: ok [52.81425ms]
  tuna node RU node-1-ru.2na.am:443: ok [34.079541ms]

```

As a rule, tuna uses port `443` to connect to nodes when creating a tunnel. If the `TCP connectivity` checks fail, check whether there is a firewall that may be restricting connections. The addresses for firewall rules are listed in [Using tuna in a corporate network](https://tuna.am/en/docs/guides/corporate-network.md#firewall-addresses).

## Common errors

### Subdomains unavailable for free plan

This error appears when starting with `--subdomain` on the free plan. Without a subscription only your [free permanent subdomain](https://tuna.am/en/docs/tunnels/http.md#free-subdomain) works: other names, including ones reserved earlier with a subscription, are unavailable. Check the subdomain name in the [dashboard](https://my.tuna.am/domains) and make sure the client is authorized with your token, not another account's.

### Domain unavailable for free plan

The same for `--domain`: without a subscription you can only specify your free subdomain in full, for example `--domain=brave-otter-4821.ru.tuna.am`. Custom domains and other users' subdomains are available only with a [subscription](https://tuna.am/#pricing).

### Tunnel limit reached

If you see the error `Tunnel limit reached`, although you know that this is not actually the case, it may also mean that there is a hung active tunnel. Delete the hung tunnel in the [tunnel management panel](https://my.tuna.am/tunnels) and update the tuna client.

### Tunnel already active

```shell
ERRO[09:01:09] Failed to get connection settings: Tunnel already active
  Code: BadRequest
  Request ID: 2008cc71bdf725853748bb91d69c4669, retrying in 1s
ERRO[09:01:10] Failed to get connection settings: Tunnel already active
  Code: BadRequest
  Request ID: 0118213a8f8d341f002ec30ee1499768, retrying in 2s
ERRO[09:01:12] Failed to get connection settings: Tunnel already active
  Code: BadRequest
  Request ID: 608d043eb16376a619b671eb0d33dc0b, retrying in 4s

```

This `Tunnel already active` error means that the tunnel already exists, possibly hung, or running somewhere in the background.

> **Tip.** The reconnect issue is fixed in the clients
>
> * tuna-cli v0.28.0
> * tuna-desktop v0.2.0

## Testing tunnel speed

If you need to estimate the throughput of a tunnel, the methods for testing HTTP and TCP tunnels are described below.

> **Info.** We do not impose any restrictions on the data transfer rate through tunnels. The resulting speed depends on the bandwidth of your internet channel and network latencies on the route: from the end user to the [node](https://tuna.am/en/docs/tunnels/guides/locations.md) through which the tunnel is built, and from the node to the Tuna client.

For testing, you will need a file of sufficient size. You can pre-download an ISO image from the Yandex mirror, for example [Ubuntu Server](https://mirror.yandex.ru/ubuntu-releases/24.04/ubuntu-24.04.2-live-server-amd64.iso):

**Windows**

```powershell
curl.exe -L -o ubuntu-server.iso https://mirror.yandex.ru/ubuntu-releases/24.04/ubuntu-24.04.2-live-server-amd64.iso

```

**Unix**

```shell
curl -L -o ubuntu-server.iso https://mirror.yandex.ru/ubuntu-releases/24.04/ubuntu-24.04.2-live-server-amd64.iso

```

### HTTP tunnels

#### Download speed (download from client)

Start the built-in file server, specifying the directory with the test file:

**Windows**

```powershell
tuna http -f C:\path\to\directory

```

**Unix**

```shell
tuna http -f /path/to/directory

```

Where the path is the directory containing the previously downloaded file. After starting the tunnel, download the file from the resulting link using `curl`:

**Windows**

```powershell
curl.exe -o NUL https://your-tunnel-url.tuna.am/ubuntu-server.iso

```

**Unix**

```shell
curl -o /dev/null https://your-tunnel-url.tuna.am/ubuntu-server.iso

```

`curl` will show the download speed — that is the data download speed through the tunnel.

#### Upload speed (upload to client)

Start the built-in WebDAV server:

```shell
tuna http --webdav

```

Then upload the file through the tunnel to the machine where the Tuna client is running:

**Windows**

```powershell
curl.exe -T ubuntu-server.iso https://your-tunnel-url.tuna.am/ubuntu-server.iso

```

**Unix**

```shell
curl -T ubuntu-server.iso https://your-tunnel-url.tuna.am/ubuntu-server.iso

```

The upload speed shown by `curl` reflects the bandwidth of the tunnel in the direction of the client.

### TCP tunnels

To test TCP tunnels, use the [iperf3](https://iperf.fr/) utility.

Start the iperf3 server on the machine with the Tuna client and forward the port through a TCP tunnel:

```shell
iperf3 -s -p 5201
tuna tcp -p 5201

```

From another machine, connect to the tunnel:

```shell
iperf3 -c your-tunnel-host -p your-tunnel-port

```

Install iperf3 from your OS repository or download a prebuilt binary from the [official site](https://iperf.fr/iperf-download.php):

```shell
# Windows (winget)
winget install ar51an.iPerf3

# macOS
brew install iperf3

# Debian / Ubuntu
sudo apt install iperf3

# RHEL / CentOS
sudo yum install iperf3

# Fedora
sudo dnf install iperf3

# openSUSE
sudo zypper install iperf3

# Arch Linux
sudo pacman -S iperf3

# ALT Linux
sudo apt-get install iperf3

# NixOS
nix-env -iA nixpkgs.iperf3

# FreeBSD
sudo pkg install iperf3

```
