Skip to main content

Token limit reached: active tunnels

FATA[12:00:00] Failed to get connection settings: Token limit reached: active tunnels
Code: BadRequest
Request ID: 7a2e9c05f4b1d863e0a7c2f95b4d1e38

Variants of the message:

Token limit reached: created tunnels
TCP tunnels are not allowed for this token
HTTP tunnels are not allowed for this token

tuna CLI and Tuna Desktop show this error when you start a tunnel. The client doesn't reconnect and exits right away.

Causeโ€‹

The tunnel was started with an API key that got restrictions when it was created. These are limits of the key, not of your plan:

  • Token limit reached: active tunnels means the key is already running as many tunnels at once as it's allowed;
  • Token limit reached: created tunnels means the key has already created as many tunnels as it's allowed over its lifetime. Stopping tunnels doesn't decrease this counter;
  • TCP tunnels are not allowed for this token and HTTP tunnels are not allowed for this token mean the key isn't allowed to start this type of tunnel.

Such restrictions apply to API keys created with limits, temporal tokens from Terraform, background service keys, and Kubernetes operator tokens. A service key and an operator token start tunnels of one type only: HTTP or TCP.

What to doโ€‹

  1. Check which key started the tunnel: the --api-key flag, the TUNA_API_KEY variable, or a key saved with tuna login --with-api-key.
  2. For active tunnels, stop the tunnels started with this key. The list of active tunnels is in the dashboard.
  3. For created tunnels, issue a new key: the counter of created tunnels doesn't reset.
  4. For a blocked protocol, start the tunnel with a key that allows this type, or issue a new key. For a background service of a different type, create a separate service.