TechnitiumSoftware / DnsServer

Technitium DNS Server
https://technitium.com/dns/
GNU General Public License v3.0
3.84k stars 400 forks source link

Technitium crashes every few hours on Raspberry Pi 2B #806

Closed AlexFullmoon closed 6 months ago

AlexFullmoon commented 6 months ago

Installed on clean Debian along with Tailscale, lighttpd and nut. Upstream servers are DoH from blahdns.com. Technitium version 11.5.3.

Logs look like this. I tried running it with logging queries, but there doesn't seem to be any correlation of crashes with queries.

[2023-12-08 02:11:48 UTC] Logging started.
[2023-12-08 02:11:49 UTC] DNS Server auth config file was loaded: /etc/dns/auth.config
[2023-12-08 02:11:49 UTC] DNS Server config file was loaded: /etc/dns/dns.config
[2023-12-08 02:11:50 UTC] DNS Server successfully loaded zone file: /etc/dns/zones/moonlightwell.ru.zone
[2023-12-08 02:11:50 UTC] DNS Server successfully loaded zone file: /etc/dns/zones/ntp.org.zone
[2023-12-08 02:11:50 UTC] DNS Server is loading allowed zone file: /etc/dns/allowed.config
[2023-12-08 02:11:50 UTC] DNS Server is loading blocked zone file: /etc/dns/blocked.config
[2023-12-08 02:11:50 UTC] Loading DNS Cache from disk...
[2023-12-08 02:11:50 UTC] DNS Server successfully loaded DNS application: Split Horizon
[2023-12-08 02:11:50 UTC] DNS Cache was loaded from disk successfully.
[2023-12-08 02:11:50 UTC] DNS Server is reading block list from: https://big.oisd.nl/
[2023-12-08 02:11:52 UTC] [[::]:5380] [HTTP] Web Service was bound successfully.
[2023-12-08 02:11:52 UTC] [0.0.0.0:53] [UDP] DNS Server was bound successfully.
[2023-12-08 02:11:52 UTC] [0.0.0.0:53] [TCP] DNS Server was bound successfully.
[2023-12-08 02:11:52 UTC] [[::]:53] [UDP] DNS Server was bound successfully.
[2023-12-08 02:11:52 UTC] [[::]:53] [TCP] DNS Server was bound successfully.
[2023-12-08 02:11:53 UTC] DHCP Server successfully loaded scope: Default
[2023-12-08 02:11:53 UTC] DHCP Server successfully loaded scope file: /etc/dns/scopes/Default.scope
[2023-12-08 02:11:53 UTC] DNS Server (v11.5.3.0) was started successfully.
[2023-12-08 02:11:53 UTC] DNS Server read block list file (213827 domains) from: https://big.oisd.nl/
[2023-12-08 02:11:54 UTC] DNS Server block list zone was loaded successfully.
[2023-12-08 02:12:00 UTC] DNS Server has started automatic update check for DNS Apps.
[2023-12-08 02:12:00 UTC] DNS Server auth config file was saved: /etc/dns/auth.config
[2023-12-08 02:12:00 UTC] DNS Server successfully notified name server 'dns.moonlightwell.ru' for zone: moonlightwell.ru
[2023-12-08 02:12:00 UTC] DNS Server successfully notified name server '100.117.120.104' for zone: moonlightwell.ru
[2023-12-08 06:23:13 UTC] Logging started.
[2023-12-08 06:23:15 UTC] DNS Server auth config file was loaded: /etc/dns/auth.config
[2023-12-08 06:23:15 UTC] DNS Server config file was loaded: /etc/dns/dns.config
[2023-12-08 06:23:16 UTC] DNS Server successfully loaded zone file: /etc/dns/zones/moonlightwell.ru.zone
[2023-12-08 06:23:16 UTC] DNS Server successfully loaded zone file: /etc/dns/zones/ntp.org.zone
[2023-12-08 06:23:16 UTC] DNS Server is loading allowed zone file: /etc/dns/allowed.config
[2023-12-08 06:23:16 UTC] DNS Server is loading blocked zone file: /etc/dns/blocked.config
[2023-12-08 06:23:16 UTC] DNS Server successfully loaded DNS application: Split Horizon
[2023-12-08 06:23:16 UTC] Loading DNS Cache from disk...
[2023-12-08 06:23:16 UTC] DNS Cache was loaded from disk successfully.
[2023-12-08 06:23:16 UTC] DNS Server is reading block list from: https://big.oisd.nl/
[2023-12-08 06:23:17 UTC] [[::]:5380] [HTTP] Web Service was bound successfully.
[2023-12-08 06:23:18 UTC] [0.0.0.0:53] [UDP] DNS Server was bound successfully.
[2023-12-08 06:23:18 UTC] [0.0.0.0:53] [TCP] DNS Server was bound successfully.
[2023-12-08 06:23:18 UTC] [[::]:53] [UDP] DNS Server was bound successfully.
[2023-12-08 06:23:18 UTC] [[::]:53] [TCP] DNS Server was bound successfully.
[2023-12-08 06:23:18 UTC] DHCP Server successfully loaded scope: Default
[2023-12-08 06:23:18 UTC] DHCP Server successfully loaded scope file: /etc/dns/scopes/Default.scope
[2023-12-08 06:23:18 UTC] DNS Server (v11.5.3.0) was started successfully.
[2023-12-08 06:23:19 UTC] DNS Server read block list file (213827 domains) from: https://big.oisd.nl/
[2023-12-08 06:23:20 UTC] DNS Server block list zone was loaded successfully.
[2023-12-08 06:23:25 UTC] DNS Server has started automatic update check for DNS Apps.
[2023-12-08 06:23:26 UTC] DNS Server auth config file was saved: /etc/dns/auth.config
[2023-12-08 06:23:26 UTC] DNS Server successfully notified name server 'dns.moonlightwell.ru' for zone: moonlightwell.ru
[2023-12-08 06:23:26 UTC] DNS Server successfully notified name server '100.117.120.104' for zone: moonlightwell.ru
[2023-12-08 06:23:29 UTC] System.Net.Http.HttpRequestException: HttpClient could not resolve IP address for host: go.technitium.com
 ---> TechnitiumLibrary.Net.Dns.DnsClientNoResponseException: DnsClient failed to resolve the request 'go.technitium.com. A IN'. Received a response with RCODE: ServerFailure
   at TechnitiumLibrary.Net.Dns.DnsClient.ParseResponseA(DnsDatagram response) in Z:\Technitium\Projects\TechnitiumLibrary\TechnitiumLibrary.Net\Dns\DnsClient.cs:line 1952
   at TechnitiumLibrary.Net.Http.Client.HttpClientNetworkHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in Z:\Technitium\Projects\TechnitiumLibrary\TechnitiumLibrary.Net\Http\Client\HttpClientNetworkHandler.cs:line 210
   --- End of inner exception stack trace ---
   at TechnitiumLibrary.Net.Http.Client.HttpClientNetworkHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in Z:\Technitium\Projects\TechnitiumLibrary\TechnitiumLibrary.Net\Http\Client\HttpClientNetworkHandler.cs:line 220
   at System.Net.Http.HttpClient.GetStringAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
   at DnsServerCore.WebServiceAppsApi.GetStoreAppsJsonData(Boolean doRetry) in Z:\Technitium\Projects\DnsServer\DnsServerCore\WebServiceAppsApi.cs:line 183
   at DnsServerCore.WebServiceAppsApi.<StartAutomaticUpdate>b__11_0(Object state) in Z:\Technitium\Projects\DnsServer\DnsServerCore\WebServiceAppsApi.cs:line 96
[2023-12-08 08:25:48 UTC] Logging started.
...

There are several exceptions appearing in logs, most often about failing to resolve go.technitium.com, but apparently that's just check for updates at start. It seems to crash silently.

ShreyasZare commented 6 months ago

Thanks for the post. Since there are no error logs in the DNS logs, you need to check the OS level logs to see why it crashed.

Check the service status to see if there are any hints using sudo systemctl status dns command. You can also try journalctl --unit dns --follow and see if it shows any recent errors.

I would also suggest to check for available RAM using top or htop. It could be that there is low memory issue causing the kernel to kill DNS process to free memory.

AlexFullmoon commented 6 months ago

There are no errors or other messages in OS logs, just usual lines. Scratch that, got the crash

Dec 10 13:27:31 rpi dns-server[10435]: Technitium DNS Server was started successfully.
Dec 10 13:27:31 rpi dns-server[10435]: Using config folder: /etc/dns
Dec 10 13:27:31 rpi dns-server[10435]: Note: Open http://rpi:5380/ in web browser to access web console.
Dec 10 13:27:31 rpi dns-server[10435]: Press [CTRL + C] to stop...
Dec 10 14:47:37 rpi systemd[1]: dns.service: Main process exited, code=killed, status=11/SEGV
Dec 10 14:47:37 rpi systemd[1]: dns.service: Failed with result 'signal'.
Dec 10 14:47:37 rpi systemd[1]: dns.service: Consumed 5min 21.504s CPU time.
Dec 10 14:47:47 rpi systemd[1]: dns.service: Scheduled restart job, restart counter is at 1.
Dec 10 14:47:47 rpi systemd[1]: Stopped dns.service - Technitium DNS Server.
Dec 10 14:47:47 rpi systemd[1]: dns.service: Consumed 5min 21.504s CPU time.
Dec 10 14:47:47 rpi systemd[1]: Started dns.service - Technitium DNS Server.
Dec 10 14:47:53 rpi dns-server[11334]: Technitium DNS Server was started successfully.
Dec 10 14:47:53 rpi dns-server[11334]: Using config folder: /etc/dns
Dec 10 14:47:53 rpi dns-server[11334]: Note: Open http://rpi:5380/ in web browser to access web console.
Dec 10 14:47:53 rpi dns-server[11334]: Press [CTRL + C] to stop...

Will try logging RAM usage, though at fresh start there's 500Mb free out of 1Gb.

On a side note, is there an option in automatic installer to choose previous version? I didn't have this issue on version that I used until recently on same hardware (around v.11.2, I think).

ShreyasZare commented 6 months ago

The installer script does not any any option to select version. You can however download the previous version from archive and extract to overwrite the current files. But, note that older version may not be able to read config files that get updated by newer versions so you may lose your settings and need to configure settings again.

I am running Raspberry Pi 3B and 4 with Raspberry Pi OS and its running well 24x7 in production without any crashes. So not sure what can be the reason in your case.

AlexFullmoon commented 6 months ago

with Raspberry Pi OS

Hm. I guess I could try installing Raspberry Pi OS — IIRC that's Debian 11. As I've mentioned, I run Debian 12 RPi build.

Suchiman commented 6 months ago

I'm running this on a PI 2B, running Ubuntu Server 23.10 without problems either.

AlexFullmoon commented 6 months ago

Okay, can confirm no crashes on Raspberry Pi OS. Might be something with those Debian builds. Or me breaking something somehow. Sorry for taking your time.

ShreyasZare commented 6 months ago

Thanks for letting me know.