> Markdown version of https://tuna.am/en/docs/troubleshooting/errors/connection-lost-reconnecting/. 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.

# Connection lost, reconnecting

```text
WARN[12:00:00] Connection lost, reconnecting: https://myapp.a.2na.am
INFO[12:00:01] Attempting reconnect: https://myapp.a.2na.am
INFO[12:00:02] Connection restored: https://myapp.a.2na.am -> http://127.0.0.1:3000

```

These lines appear in the tuna CLI log; in the [terminal UI](https://tuna.am/en/docs/tunnels/tui.md), the tunnel status changes to `reconnecting`. The client doesn't exit: it reconnects on its own, and the pause between attempts grows up to 15 seconds. If the tunnel isn't up within 30 seconds, the client logs one more line and starts connecting from scratch:

```text
ERRO[12:00:30] Timed out, retrying in 1s

```

## Cause

The client lost its connection to a Tuna node or couldn't get connection settings. Most often it's the network: a Wi-Fi switch, a laptop going to sleep, a VPN, a firewall, IPv6 issues. Less often it's the server: a node is restarting or overloaded, as with [Server is busy](https://tuna.am/en/docs/troubleshooting/errors/server-is-busy.md) and [Node not found](https://tuna.am/en/docs/troubleshooting/errors/node-not-found.md).

The regular log doesn't show the underlying cause. Run with `--log-level=debug` to see it: the `error` field of the `Reconnect attempt details` line contains the original error.

## What to do

If the connection came back (`Connection restored`), do nothing: this is a routine drop. The tunnel keeps its address after reconnecting.

If the client keeps reconnecting in a loop:

1. Run `tuna diagnose`: [self-diagnosis](https://tuna.am/en/docs/troubleshooting.md#self-diagnose) shows whether the client can reach the API and the nodes.
2. On a corporate network, allow Tuna's addresses in the firewall using the [list](https://tuna.am/en/docs/guides/corporate-network.md#firewall-addresses).
3. If the host has IPv6, try `TUNA_FORCE_IPV4=1` — see [Tunnel fails to connect because of IPv6](https://tuna.am/en/docs/troubleshooting/ipv6.md).
4. Update the client to the latest version by following the [instructions](https://tuna.am/en/docs/guides/update.md).
5. Start the tunnel with `--log-level=debug` and check the `error` field: if it holds an error from the [catalog](https://tuna.am/en/docs/troubleshooting/errors.md), follow that error's page.
