-
-
Notifications
You must be signed in to change notification settings - Fork 562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding/Deleting multiple Custom DNS Records in a short amount of time triggers systemd service StartLimitBurst leading to disable pihole-FTL service #2606
Comments
Thanks for your detailed analysis, you included all relevant aspects. However, I'm not sure if this is really a bug or not. Pivot is the
This was added to prevent endless-start-stop cycles in case of an error. Adding a custom DNS record needs a full @DL6ER |
thanks for your quick reply! I initially thought that a However, as far as I can tell it is enough to issue a
So, just reloading the service with systemctl seems to be enough and doesn't seem to trigger any issues with the service:
|
Your analysis in not correct here:
When needed, Resulting in: |
you are correct, thanks for pointing that out! and sorry for the confusing! |
I think you are correct. The Jun 9 23:35:39 dnsmasq[3578109]: read /etc/hosts - 7 names
Jun 9 23:35:39 dnsmasq[3578109]: read /etc/pihole/custom.list - 22 names
Jun 9 23:35:39 dnsmasq[3578109]: read /etc/pihole/local.list - 0 names Note: this will only work for the custom DNS records, not custom CNAME records (as files in |
Please try if
|
not quite, but when I additionally add the reload to the thanks! |
Good catch. We did not plan to release any new v5 version and focus on v6 - however the changes necessary here are trivial after the bug was dissected. We'll discuss internally how to proceed. |
No. v6 tries to be "more clever" than many of the elements we have in v5. This involves trying to minimize restarting of FTL to as seldom as possible. Custom DNS records are a prime example. When I coded this part of the v6 interface, I very much disliked that the DNS cache is completely flushed by a |
After internal discussion we decided to not release a new v5 version. Reasons are
|
I have posted a workaround for v5 in this thread https://discourse.pi-hole.net/t/ftl-crashes-repeatedly-when-updating-dns-records-through-external-dns/66867 |
Versions
Platform
Expected behavior
Adding or Deleting custom DNS records through webadmin GUI or respectively directly through POST requests to the API endpoint at
/admin/scripts/pi-hole/php/customdns.php
causes pihole-FTL to just bereloaded
.Actual behavior / bug
repeatedly adding or deleting DNS records through the web interface (
/admin/scripts/pi-hole/php/customdns.php
) causes pihole-FTL to be restarted (not reloaded) with each and every DNS record added. This leads to systemd hitting theStartLimitBurst=5
configured in/etc/systemd/system/pihole-FTL.service
leading to consecutive restarts of the service to fail.systemctl status pihole-FTL:
Steps to reproduce
Steps to reproduce the behavior:
Shell
killed
and fail to start withFailed with result 'start-limit-hit'
Webadmin
killed
and fail to start withFailed with result 'start-limit-hit'
Debug Token
I don't think this should be necessary here.
Additional context
I am using the pihole provider from kubernetes-sigs/external-dns in combination with borchero/switchboard to automatically add DNS records for services in my cluster when they get exposed. This worked fine while setting everything up.
However, after exposing more services for external-dns to manage DNS for, pihole-FTL started to behave oddly/refused to start.
The way kubernetes-sigs/external-dns adds the dns records, is by just simply sending POST requests to the same endpoint the webadmin GUI uses (
/admin/scripts/pi-hole/php/customdns.php
). Due to this API endpoint not offering anyupdate
functionality and also the fact that noTXT
records are possible, this results in a little bit of a "spammy" behaviour from external-dns. As far as i understand the implementation of the pihole provider on external-dns, there are a couple workarounds in place, due to the API limitations of pihole-FTL. There might also be another bug in the pihole provider for external-dns, but I have not yet spent the time to dig into that side any deeper and I believe that even if this was the case, it would not change validity of this bug report.For a quick and dirty workaround I adjusted
StartLimitBurst
in/etc/systemd/system/pihole-FTL.service
.When digging through the source code of pihole I noticed a couple things and I am not exactly sure where this should be fixed.
https://github.com/pi-hole/AdminLTE/blob/3a11976ee8ecc50e2dd9efd76caad1ad41894dd5/scripts/pi-hole/php/func.php#L223
empty string as default value for the
reload
argument.https://github.com/pi-hole/AdminLTE/blob/3a11976ee8ecc50e2dd9efd76caad1ad41894dd5/scripts/pi-hole/php/func.php#L280
effectively results in
pihole -a addcustomdns 127.0.0.1 test1.local
(notice neithertrue
norfalse
are part of the argument for restart)https://github.com/pi-hole/pi-hole/blob/6a45c6a8e027e1ac30d4556a88f31684bc80ccf1/pihole#L579
pihole
shell script defers toAddCustomDNSAddress
inwebpage.sh
https://github.com/pi-hole/pi-hole/blob/6a45c6a8e027e1ac30d4556a88f31684bc80ccf1/advanced/Scripts/webpage.sh#L719-L743
RestartDNS command will be issued due to missing empty reload argument
https://github.com/pi-hole/AdminLTE/blob/3a11976ee8ecc50e2dd9efd76caad1ad41894dd5/scripts/pi-hole/php/func.php#L284
RestartDNS triggered again. Should this be
restartdns reload-lists
instead of justrestartdns
here?Conclusion
The issue here seems to affect both the AdminLTE as well as the pihole repository, so I am not entirely sure how the best or preferred way of fixing this would look like.
The text was updated successfully, but these errors were encountered: