---
title: "أخطاء الاتصال ووقت التشغيل | Wantastic Docs"
description: "أصلح حالات فشل بدء الخدمة، وأخطاء الإعدادات، ومشكلات TUN، وغياب المصافحة، وتحذيرات DNS."
url: "https://wantastic.app/ar/docs/errors-connect-runtime"
category: "Troubleshooting"
reading_time: "7 دقائق"
---

# أخطاء الاتصال ووقت التشغيل

أصلح حالات فشل بدء الخدمة، وأخطاء الإعدادات، ومشكلات TUN، وغياب المصافحة، وتحذيرات DNS.

> **Outcome:** يعرض wantasticd status الحالة Connected والجهاز في حالة "Online".

## Before you start

- صلاحيات root أو Administrator على الجهاز.
- سجلات الخدمة (انظر استكشاف الأخطاء وإصلاحها: ابدأ من هنا → اجمع السجلات).

## كيف تقرأ السجلات

- الأسطر التي تبدأ بـ "Failed to load configuration:" أو "Failed to start agent:" توقف الخدمة. ثم يعيد مدير الخدمات تشغيلها كل 5 ثوانٍ.
- ينتهي البدء السليم بالرسالة "Wantastic agent started successfully".
- ظهور "Device health check failed" كل 30 ثانية يعني أن الوكيل يعمل، لكن النفق لا يمرر أي حركة مرور.
- إشعارات P2P وتعيين المنافذ وDNS معلوماتية في الغالب.

## ما يجب التحقق منه

1. الخدمة تُعاد تشغيلها في حلقة: اقرأ أول سطر "Failed to …" وابحث عنه أدناه. ملف الإعدادات الفارغ هو السبب الأكثر شيوعًا.
2. الخدمة تعمل لكن لا توجد مصافحة: اسمح بحركة UDP الصادرة على المنفذ 51820، ثم تحقّق من الساعة.
3. المصافحة تعمل لكن يتعذّر الوصول إلى نظير: تحقّق من روابط المجموعات في Topology.

*فشل: لم تتم المطالبة بالجهاز: تبدأ الخدمة بملف إعدادات فارغ وتُعاد تشغيلها في حلقة.*

```
$ $ 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.
```

*الحل: طالب بالجهاز، ثم أعد التشغيل: طالب بالجهاز باستخدام genkey، واضغط Ctrl+C، ثم أعد تشغيل الخدمة.*

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

## جدول سريع

| الخطأ | أسهل حل |
| --- | --- |
| Config not found at … / private key required | طالب بالجهاز باستخدام genkey، ثم أعد التشغيل. |
| server public key … / server endpoint required | أزل ملف الإعدادات، وطالب بالجهاز مجددًا. |
| failed to resolve endpoint <host> | أصلح DNS؛ الخدمة تعيد المحاولة. |
| /dev/net/tun does not exist | ثبّت kmod-tun أو حمّل tun. |
| operation not permitted | شغّل بصلاحيات root أو أضف NET_ADMIN. |
| Device health check failed | اسمح بـ UDP 51820؛ وأصلح الساعة. |
| the running daemon is older than this CLI… | أعد تشغيل الخدمة. |
| DNS: tunnel DNS not written (…) | اضبط WANTASTIC_DNS_MODE=off. |

## Verify the result

- يعرض wantasticd status القيمة Connected.
- يعرض wantasticd peers النظير (server) مع مصافحة قبل بضع ثوانٍ.

## Common issues

### لا يجد connect ملف إعدادات.

```
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:** لم تتم المطالبة بالجهاز أبدًا، أو أن ملف الإعدادات في مكان آخر.
- **Fix:** طالب بالجهاز باستخدام genkey، ثم أعد تشغيل الخدمة.

Shell:

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

- **Verify:** تظهر "Wantastic agent started successfully" في السجلات.

### تفشل الخدمة مباشرة بعد التثبيت.

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

- **Where:** سجلات wantasticd
- **Likely cause:** ملف الإعدادات فارغ لأنه لم تتم المطالبة بالجهاز بعد.
- **Fix:** طالب بالجهاز باستخدام genkey، واضغط Ctrl+C، ثم أعد تشغيل الخدمة.

Shell:

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

- **Verify:** يعرض wantasticd status القيمة Connected.

### ملف الإعدادات يفتقد مفتاح المحور (hub).

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

- **Where:** سجلات wantasticd
- **Likely cause:** ملف الإعدادات غير مكتمل أو عُدّل يدويًا.
- **Fix:** انقل ملف الإعدادات التالف بعيدًا وطالب بالجهاز مجددًا.

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:** تبدأ الخدمة.

### مفتاح المحور غير صالح.

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

- **Where:** سجلات wantasticd
- **Likely cause:** ملف الإعدادات مجرد عنصر نائب (مثلًا بعد فشل تسجيل الدخول على Windows)، أو أن المفتاح تلف عند النسخ واللصق.
- **Fix:** انقل ملف الإعدادات التالف بعيدًا وسجّل الجهاز مجددًا. على Windows، سجّل الدخول برمز مميز جديد.

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:** تبدأ الخدمة.

### ملف الإعدادات لا يحتوي على نقطة نهاية.

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

- **Where:** سجلات wantasticd
- **Likely cause:** ملف الإعدادات غير مكتمل.
- **Fix:** انقل ملف الإعدادات التالف بعيدًا وطالب بالجهاز مجددًا.

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:** تبدأ الخدمة.

### لا يُحَل اسم المحور عند الإقلاع.

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

- **Where:** سجلات wantasticd
- **Likely cause:** DNS غير جاهز عند الإقلاع، أو أن المحلّل معطّل ("no IP addresses found for hostname").
- **Fix:** تحقّق من DNS. الخدمة تعيد المحاولة تلقائيًا.

Shell:

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

- **Verify:** تظهر "WireGuard device up. Peer endpoint: …" في السجلات.

### تعذّر إنشاء واجهة النفق.

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

- **Where:** سجلات wantasticd
- **Likely cause:** وحدة النواة TUN مفقودة (OpenWrt بدون kmod-tun)، أو أن الحاوية لا تحتوي على /dev/net/tun.
- **Fix:** ثبّت TUN أو حمّلها، ثم أعد تشغيل الخدمة.

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" في السجلات.

### أخطاء صلاحيات على الواجهات أو المسارات.

```
operation not permitted
```

- **Where:** سجلات wantasticd
- **Likely cause:** لا يعمل wantasticd بصلاحيات root، أو أن الحاوية لا تملك صلاحية NET_ADMIN.
- **Fix:** استخدم الخدمة المثبّتة (تعمل بصلاحيات root)، أو أضف --cap-add NET_ADMIN إلى الحاوية.

Shell:

```bash
sudo systemctl restart wantasticd
```

- **Verify:** تبدأ الخدمة.

### استُنفدت محاولات البدء.

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

- **Where:** سجلات wantasticd
- **Likely cause:** يتكرر خطأ آخر. النص بعد النقطتين هو السبب الحقيقي.
- **Fix:** ابحث عن النص الذي بعد النقطتين في هذه القائمة، وأصلحه، ثم أعد تشغيل الخدمة.

- **Verify:** تبدأ الخدمة.

### منفذ الاستماع مشغول.

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

- **Where:** سجلات wantasticd
- **Likely cause:** برنامج آخر يستخدم المنفذ. الرسالة "Port %d in use, retrying with port %d..." تعني الشيء نفسه. هذه معلوماتية.
- **Fix:** لا شيء مطلوب.

- **Verify:** المصافحة تعمل.

### لا يوجد نظراء في النفق.

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

- **Where:** سجلات wantasticd
- **Likely cause:** لا يحتوي ملف الإعدادات على قسم [Peer].
- **Fix:** انقل ملف الإعدادات بعيدًا وطالب بالجهاز مجددًا.

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 النظير (server).

### يستمر فشل فحص السلامة.

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

- **Where:** سجلات wantasticd (كل 30 ثانية)
- **Likely cause:** لا توجد مصافحة مع المحور: حركة UDP الصادرة على 51820 محظورة، أو الساعة خاطئة، أو أن MTU كبير جدًا.
- **Fix:** اسمح بحركة UDP الصادرة على 51820 في جدار الحماية الأعلى، واضبط الساعة.

Shell:

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

- **Verify:** يعرض wantasticd peers مصافحة قبل بضع ثوانٍ.

### يفشل منفذ التحكم المحلي.

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

- **Where:** سجلات wantasticd
- **Likely cause:** المنفذ 127.0.0.1:9034 والمنافذ التالية مشغولة. الرسالتان "Warning: failed to start local IPC API" و"IPC API Error binding to …, trying next port..." مرتبطتان بذلك.
- **Fix:** أوقف البرنامج الذي يستخدم المنفذ، أو اضبط منفذًا آخر باستخدام WTC_IPC_PORT.

Shell:

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

- **Verify:** يعمل wantasticd status.

### واجهة CLI أحدث من الخدمة.

```
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:** تم تحديث الملف التنفيذي، لكن الخدمة لا تزال تشغّل الإصدار القديم.
- **Fix:** أعد تشغيل الخدمة.

Shell:

```bash
sudo systemctl restart wantasticd
```

- **Verify:** يعرض wantasticd status الإصدار الجديد.

### لا تستطيع واجهة CLI التواصل مع الخدمة.

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

- **Where:** wantasticd CLI
- **Likely cause:** فشلت واجهة API للتحكم المحلي. الرسالة "decode daemon response" مشابهة.
- **Fix:** أعد تشغيل الخدمة وحاول مجددًا.

Shell:

```bash
sudo systemctl restart wantasticd
```

- **Verify:** يعمل wantasticd status.

### يبقى النظراء على الترحيل (relay).

```
direct handshake timeout
```

- **Where:** سجلات wantasticd
- **Likely cause:** يحظر NAT المسار المباشر. الرسائل "promotion queue full" و"gateway does not answer NAT-PMP" و"no UPnP internet gateway found" و"router's external address is not public (CGNAT)" غير ضارة أيضًا.
- **Fix:** لا شيء مطلوب. الترحيل يعمل. للحصول على مسارات مباشرة، فعّل UPnP أو NAT-PMP على الموجّه.

- **Verify:** تتدفق حركة المرور.

### لا يجد الوصول المحلي شبكة LAN.

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

- **Where:** wantasticd (--allow-local-access)
- **Likely cause:** لا يحتوي الجهاز على شبكة LAN خاصة بعناوين IPv4.
- **Fix:** أوقف الخيار على هذا الجهاز باستخدام --allow-local-access=false.

- **Verify:** لا يوجد خطأ بعد إعادة التشغيل.

### الوصول المحلي على macOS أو Windows.

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

- **Where:** wantasticd (--allow-local-access)
- **Likely cause:** تعمل هذه الميزة على Linux وOpenWrt فقط (يعرض Windows الرسالة "… on Windows yet").
- **Fix:** استخدم جهاز Linux أو OpenWrt كبوابة LAN.

- **Verify:** يعمل الوصول المحلي عبر جهاز Linux أو OpenWrt.

### فشلت قاعدة التنكّر (masquerade).

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

- **Where:** wantasticd (--allow-local-access)
- **Likely cause:** iptables مفقود.
- **Fix:** ثبّت iptables.

Shell:

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

- **Verify:** يعمل الوصول المحلي.

### تعذّر تفعيل إعادة التوجيه.

```
enable forwarding: …
```

- **Where:** wantasticd (--allow-local-access)
- **Likely cause:** إعدادات النظام للقراءة فقط (مثلًا داخل حاوية).
- **Fix:** فعّل إعادة توجيه IP على المضيف.

Shell:

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

- **Verify:** يعمل الوصول المحلي.

### عدد كبير جدًا من أجهزة الوصول المحلي.

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

- **Where:** wantasticd (--allow-local-access)
- **Likely cause:** عدد كبير جدًا من الأجهزة في حسابك تشارك شبكة LAN الخاصة بها.
- **Fix:** أوقف --allow-local-access على الأجهزة التي لا تحتاجه.

- **Verify:** اختفى الخطأ.

### تعذّرت كتابة DNS.

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

- **Where:** سجلات wantasticd
- **Likely cause:** برنامج آخر يدير DNS. رسائل ذات صلة: "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:** دع النظام يدير DNS: اضبط WANTASTIC_DNS_MODE=off للخدمة.

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:** لا يوجد تحذير DNS بعد إعادة التشغيل.

### تحذير فحص التحديثات.

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

- **Where:** سجلات wantasticd
- **Likely cause:** لا يستطيع الجهاز الوصول إلى get.wantastic.app. النفق لا يزال يعمل.
- **Fix:** اسمح بحركة HTTPS إلى get.wantastic.app.

Shell:

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

- **Verify:** لا يوجد تحذير في الفحص التالي كل ساعة.

### نفقان، أو تظهر واجهة wantastic1.

- **Where:** ip link / سجلات wantasticd
- **Likely cause:** لا يزال genkey أو login يعمل في الواجهة الأمامية بجانب الخدمة.
- **Fix:** اضغط Ctrl+C في نافذة genkey، ثم أعد تشغيل الخدمة.

Shell:

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

- **Verify:** عملية wantasticd واحدة فقط وواجهة wantastic0 واحدة.

## Continue with

- [Troubleshooting: start here](https://wantastic.app/ar/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/ar/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/ar/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/ar/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/ar/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/ar/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.
