---
title: "Errores de conexión y de ejecución | Wantastic Docs"
description: "Soluciona fallos al iniciar el servicio, errores de configuración, problemas de TUN, handshakes ausentes y advertencias de DNS."
url: "https://wantastic.app/es/docs/errors-connect-runtime"
category: "Troubleshooting"
reading_time: "7 min"
---

# Errores de conexión y de ejecución

Soluciona fallos al iniciar el servicio, errores de configuración, problemas de TUN, handshakes ausentes y advertencias de DNS.

> **Outcome:** wantasticd status muestra Connected y el dispositivo está Online.

## Before you start

- Root o administrador en el dispositivo.
- Los logs del servicio (consulta Solución de problemas: empieza aquí → Recopila logs).

## Cómo leer los logs

- Las líneas que empiezan por "Failed to load configuration:" o "Failed to start agent:" detienen el servicio. El gestor de servicios lo reinicia entonces cada 5 segundos.
- Un arranque correcto termina con "Wantastic agent started successfully".
- "Device health check failed" cada 30 segundos significa que el agente se ejecuta, pero el túnel no transmite tráfico.
- Los avisos de P2P, mapeo de puertos y DNS son mayormente informativos.

## Qué comprobar

1. El servicio se reinicia en bucle: lee la primera línea "Failed to …" y búscala abajo. Una configuración vacía es la causa más común.
2. El servicio se ejecuta pero no hay handshake: permite UDP 51820 saliente y revisa el reloj.
3. El handshake funciona pero un peer es inalcanzable: revisa los enlaces de grupo en Topology.

*Falla: dispositivo no reclamado: El servicio arranca con una configuración vacía y se reinicia en bucle.*

```
$ $ sudo journalctl -u wantasticd -n 3 --no-pager
wantasticd[812]: Failed to load configuration: validate config: private key required
systemd[1]: wantasticd.service: Scheduled restart job, restart counter is at 14.
```

*Solucionado: reclama y reinicia: Reclama el dispositivo con genkey, pulsa Ctrl+C y reinicia el servicio.*

```
$ $ sudo wantasticd genkey
Device claimed. Configuration saved to /etc/wantastic/config.conf
$ $ sudo systemctl restart wantasticd
wantasticd[901]: Wantastic agent started successfully
```

## Tabla rápida

| Error | Solución más sencilla |
| --- | --- |
| Config not found at … / private key required | Reclama con genkey y reinicia. |
| server public key … / server endpoint required | Elimina la configuración y reclama de nuevo. |
| failed to resolve endpoint <host> | Corrige el DNS; el servicio reintenta. |
| /dev/net/tun does not exist | Instala kmod-tun o carga tun. |
| operation not permitted | Ejecútalo como root o añade NET_ADMIN. |
| Device health check failed | Permite UDP 51820; corrige el reloj. |
| the running daemon is older than this CLI… | Reinicia el servicio. |
| DNS: tunnel DNS not written (…) | Define WANTASTIC_DNS_MODE=off. |

## Verify the result

- wantasticd status muestra Connected.
- wantasticd peers muestra (server) con un handshake de hace unos segundos.

## Common issues

### connect no encuentra una configuración.

```
Config not found at <cfg>. Run `wantasticd genkey --out <key>` to create a claim key and wait for claim, or pass --wait-claim with an existing key.
```

- **Where:** wantasticd connect
- **Likely cause:** El dispositivo nunca se reclamó, o la configuración está en otro lugar.
- **Fix:** Reclama el dispositivo con genkey y reinicia el servicio.

Shell:

```bash
sudo wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
sudo systemctl restart wantasticd
```

- **Verify:** "Wantastic agent started successfully" en los logs.

### El servicio falla justo después de instalarlo.

```
Failed to load configuration: validate config: private key required
```

- **Where:** logs de wantasticd
- **Likely cause:** La configuración está vacía porque el dispositivo aún no está reclamado.
- **Fix:** Reclama el dispositivo con genkey, pulsa Ctrl+C y reinicia el servicio.

Shell:

```bash
sudo wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
sudo systemctl restart wantasticd
```

- **Verify:** wantasticd status muestra Connected.

### Falta la clave del hub en la configuración.

```
Failed to load configuration: validate config: server public key required
```

- **Where:** logs de wantasticd
- **Likely cause:** La configuración está incompleta o se editó a mano.
- **Fix:** Mueve la configuración dañada a otro sitio y vuelve a reclamar el dispositivo.

Shell:

```bash
sudo mv /etc/wantastic/config.conf /etc/wantastic/config.conf.bad
sudo wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
sudo systemctl restart wantasticd
```

- **Verify:** El servicio arranca.

### La clave del hub no es válida.

```
Failed to load configuration: validate config: server public key must be a base64-encoded 32-byte WireGuard key
```

- **Where:** logs de wantasticd
- **Likely cause:** La configuración es un marcador de posición (por ejemplo, tras un inicio de sesión fallido en Windows), o la clave se dañó al copiarla y pegarla.
- **Fix:** Mueve la configuración dañada a otro sitio y regístralo de nuevo. En Windows, inicia sesión con un token nuevo.

Shell:

```bash
sudo mv /etc/wantastic/config.conf /etc/wantastic/config.conf.bad
sudo wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
sudo systemctl restart wantasticd
```

- **Verify:** El servicio arranca.

### La configuración no tiene endpoint.

```
Failed to load configuration: validate config: server endpoint required
```

- **Where:** logs de wantasticd
- **Likely cause:** La configuración está incompleta.
- **Fix:** Mueve la configuración dañada a otro sitio y vuelve a reclamar el dispositivo.

Shell:

```bash
sudo mv /etc/wantastic/config.conf /etc/wantastic/config.conf.bad
sudo wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
sudo systemctl restart wantasticd
```

- **Verify:** El servicio arranca.

### El nombre del hub no se resuelve al arrancar.

```
Failed to load configuration: validate config: failed to resolve endpoint <host>: …
```

- **Where:** logs de wantasticd
- **Likely cause:** El DNS no está listo al arrancar, o el resolvedor no funciona ("no IP addresses found for hostname").
- **Fix:** Revisa el DNS. El servicio reintenta por sí solo.

Shell:

```bash
nslookup wg.wantastic.app
sudo systemctl restart wantasticd
```

- **Verify:** "WireGuard device up. Peer endpoint: …" en los logs.

### No se puede crear la interfaz del túnel.

```
Failed to start agent: create device: create tun: CreateTUN("wantastic0") failed; /dev/net/tun does not exist
```

- **Where:** logs de wantasticd
- **Likely cause:** Falta el módulo del kernel TUN (OpenWrt sin kmod-tun), o un contenedor no tiene /dev/net/tun.
- **Fix:** Instala o carga TUN y reinicia el servicio.

Shell:

```bash
opkg update && opkg install kmod-tun   # OpenWrt
sudo modprobe tun                       # Linux
docker run --device /dev/net/tun --cap-add NET_ADMIN …   # Docker
```

- **Verify:** "Created TUN interface: wantastic0" en los logs.

### Errores de permisos en interfaces o rutas.

```
operation not permitted
```

- **Where:** logs de wantasticd
- **Likely cause:** wantasticd no se ejecuta como root, o el contenedor no tiene el permiso NET_ADMIN.
- **Fix:** Usa el servicio instalado (se ejecuta como root), o añade --cap-add NET_ADMIN al contenedor.

Shell:

```bash
sudo systemctl restart wantasticd
```

- **Verify:** El servicio arranca.

### Se agotaron los reintentos de arranque.

```
failed to start agent after 10 attempts: …
```

- **Where:** logs de wantasticd
- **Likely cause:** Se repite otro error. El texto después de los dos puntos es la causa real.
- **Fix:** Busca en esta lista el texto después de los dos puntos, corrígelo y reinicia el servicio.

- **Verify:** El servicio arranca.

### Puerto de escucha ocupado.

```
Port N in use, using random port
```

- **Where:** logs de wantasticd
- **Likely cause:** Otro programa usa el puerto. "Port %d in use, retrying with port %d..." significa lo mismo. Es informativo.
- **Fix:** No hay nada que hacer.

- **Verify:** El handshake funciona.

### No hay peers en el túnel.

```
WARNING: No peers configured in WireGuard device!
```

- **Where:** logs de wantasticd
- **Likely cause:** La configuración no tiene sección [Peer].
- **Fix:** Mueve la configuración a otro sitio y vuelve a reclamar el dispositivo.

Shell:

```bash
sudo mv /etc/wantastic/config.conf /etc/wantastic/config.conf.bad
sudo wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
sudo systemctl restart wantasticd
```

- **Verify:** wantasticd peers lista (server).

### La comprobación de estado sigue fallando.

```
Device health check failed: …
```

- **Where:** logs de wantasticd (cada 30 segundos)
- **Likely cause:** No hay handshake con el hub: UDP 51820 saliente está bloqueado, el reloj está mal o la MTU es demasiado grande.
- **Fix:** Permite UDP 51820 saliente en el firewall de salida y ajusta el reloj.

Shell:

```bash
sudo timedatectl set-ntp true
wantasticd peers
```

- **Verify:** wantasticd peers muestra un handshake de hace unos segundos.

### Falla el puerto de control local.

```
IPC API Error: failed to find open port
```

- **Where:** logs de wantasticd
- **Likely cause:** El puerto 127.0.0.1:9034 y los siguientes están ocupados. "Warning: failed to start local IPC API" e "IPC API Error binding to …, trying next port..." están relacionados.
- **Fix:** Detén el programa que usa el puerto, o define otro puerto con WTC_IPC_PORT.

Shell:

```bash
sudo ss -ltnp | grep 9034
```

- **Verify:** wantasticd status funciona.

### La CLI es más reciente que el servicio.

```
the running daemon is older than this CLI and has no /api/…; restart it to load the installed version (sudo systemctl restart wantasticd)
```

- **Where:** wantasticd status / peers / ping
- **Likely cause:** El binario se actualizó, pero el servicio sigue ejecutando el antiguo.
- **Fix:** Reinicia el servicio.

Shell:

```bash
sudo systemctl restart wantasticd
```

- **Verify:** wantasticd status muestra la nueva versión.

### La CLI no puede comunicarse con el servicio.

```
daemon returned HTTP N: …
```

- **Where:** CLI de wantasticd
- **Likely cause:** Falló la API de control local. "decode daemon response" es similar.
- **Fix:** Reinicia el servicio y vuelve a intentarlo.

Shell:

```bash
sudo systemctl restart wantasticd
```

- **Verify:** wantasticd status funciona.

### Los peers siguen por relay.

```
direct handshake timeout
```

- **Where:** logs de wantasticd
- **Likely cause:** El NAT bloquea una ruta directa. "promotion queue full", "gateway does not answer NAT-PMP", "no UPnP internet gateway found" y "router's external address is not public (CGNAT)" también son inofensivos.
- **Fix:** No hay nada que hacer. El relay funciona. Para rutas directas, habilita UPnP o NAT-PMP en el router.

- **Verify:** El tráfico fluye.

### El acceso local no encuentra una LAN.

```
enable local access: no directly connected private IPv4 LAN subnet found
```

- **Where:** wantasticd (--allow-local-access)
- **Likely cause:** El dispositivo no tiene una LAN IPv4 privada.
- **Fix:** Desactiva la opción en este dispositivo con --allow-local-access=false.

- **Verify:** No hay error después de reiniciar.

### Acceso local en macOS o Windows.

```
automatic local-access subnet routing is not supported on macOS yet
```

- **Where:** wantasticd (--allow-local-access)
- **Likely cause:** Esta función solo funciona en Linux y OpenWrt (Windows muestra "… on Windows yet").
- **Fix:** Usa un dispositivo Linux u OpenWrt como puerta de enlace de la LAN.

- **Verify:** El acceso local funciona a través del dispositivo Linux u OpenWrt.

### Falló la regla de masquerade.

```
iptables masquerade on <if>: …
```

- **Where:** wantasticd (--allow-local-access)
- **Likely cause:** Falta iptables.
- **Fix:** Instala iptables.

Shell:

```bash
sudo apt-get install -y iptables
opkg install iptables-nft   # OpenWrt
```

- **Verify:** El acceso local funciona.

### No se puede habilitar el reenvío.

```
enable forwarding: …
```

- **Where:** wantasticd (--allow-local-access)
- **Likely cause:** La configuración del sistema es de solo lectura (por ejemplo, en un contenedor).
- **Fix:** Habilita el reenvío IP en el host.

Shell:

```bash
sudo sysctl -w net.ipv4.ip_forward=1
```

- **Verify:** El acceso local funciona.

### Demasiados dispositivos con acceso local.

```
too many tenant local-access advertisers
```

- **Where:** wantasticd (--allow-local-access)
- **Likely cause:** Demasiados dispositivos de tu cuenta comparten su LAN.
- **Fix:** Desactiva --allow-local-access en los dispositivos que no lo necesiten.

- **Verify:** El error desaparece.

### No se puede escribir el DNS.

```
DNS: tunnel DNS not written (…)
```

- **Where:** logs de wantasticd
- **Likely cause:** Otro programa gestiona el DNS. Mensajes relacionados: "write <f>: read-only filesystem; remount it read-write or manage DNS through the platform resolver", "<x> owns /etc/resolv.conf; DNS cannot be changed safely", "<if> is not managed by NetworkManager".
- **Fix:** Deja que el sistema gestione el DNS: define WANTASTIC_DNS_MODE=off para el servicio.

Shell:

```bash
sudo mkdir -p /etc/systemd/system/wantasticd.service.d
printf '[Service]\nEnvironment=WANTASTIC_DNS_MODE=off\n' | sudo tee /etc/systemd/system/wantasticd.service.d/dns.conf
sudo systemctl daemon-reload && sudo systemctl restart wantasticd
```

- **Verify:** No hay advertencia de DNS después de reiniciar.

### Advertencia de comprobación de actualizaciones.

```
Update check failed; will retry in an hour: …
```

- **Where:** logs de wantasticd
- **Likely cause:** El dispositivo no puede llegar a get.wantastic.app. El túnel sigue funcionando.
- **Fix:** Permite HTTPS hacia get.wantastic.app.

Shell:

```bash
curl -I https://get.wantastic.app/latest
```

- **Verify:** No hay advertencia en la siguiente comprobación horaria.

### Dos túneles, o aparece una interfaz wantastic1.

- **Where:** ip link / logs de wantasticd
- **Likely cause:** genkey o login sigue ejecutándose en primer plano junto al servicio.
- **Fix:** Pulsa Ctrl+C en la ventana de genkey y reinicia el servicio.

Shell:

```bash
pgrep -a wantasticd
sudo systemctl restart wantasticd
```

- **Verify:** Solo un proceso wantasticd y una interfaz wantastic0.

## Continue with

- [Troubleshooting: start here](https://wantastic.app/es/docs/troubleshooting): Fix most problems in 3 steps. If that does not work, find your exact error in the table and open the matching guide.
- [wantasticd CLI reference and operations](https://wantastic.app/es/docs/wantasticd): The most used wantasticd commands first, then every command and flag, environment variables, config and state paths per OS, log lines, local access, exit node, and the claim flow (genkey / --wait-claim).
- [Login, token and claim errors](https://wantastic.app/es/docs/errors-login-claim): Fix claim problems (genkey, QR code, Claim Device), "Login failed: …" messages and token errors.
- [OpenWrt and embedded device errors](https://wantastic.app/es/docs/errors-openwrt-embedded): kmod-tun, read-only flash, procd, full flash, wrong clocks and BusyBox issues on routers and modules.
- [macOS and Windows errors](https://wantastic.app/es/docs/errors-macos-windows): launchd, Gatekeeper, tray, sc.exe and Windows service errors with the easiest fixes.
- [Run in Docker (community pattern)](https://wantastic.app/es/docs/install-docker): Run wantasticd in a Docker container built from the official release: build a small image, claim it once with genkey, then run it detached. Not an official image.
