Problem with Beta 5.0:
The API verb "summary" (/admin/api.php?summary) is incorrectly reporting status as "enabled" in the returned JSON document
{"domains_being_blocked":"92,265","dns_queries_today":"137","ads_blocked_today":"0","ads_percentage_today":"0.0","unique_domains":"18","queries_forwarded":"67","queries_cached":"70","clients_ever_seen":"1","unique_clients":"1","dns_queries_all_types":"137","reply_NODATA":"3","reply_NXDOMAIN":"0","reply_CNAME":"0","reply_IP":"3","privacy_level":"0","status":"enabled","gravity_last_updated":{"file_exists":true,"absolute":1587599942,"relative":{"days":0,"hours":1,"minutes":15}}}
Debug Token:
[Replace this text with the debug token provided from running pihole -d (or running the debug script through the web interface]
jfb
April 23, 2020, 1:54am
2
How does this compare to the information shown following this command line entry:
echo ">stats >quit" | nc localhost 4711
That is also returning enabled:
$ echo ">stats >quit" | nc localhost 4711
domains_being_blocked 92265
dns_queries_today 381
ads_blocked_today 109
ads_percentage_today 28.608923
unique_domains 286
queries_forwarded 193
queries_cached 79
clients_ever_seen 3
unique_clients 3
dns_queries_all_types 381
reply_NODATA 3
reply_NXDOMAIN 5
reply_CNAME 80
reply_IP 158
privacy_level 0
status enabled
DL6ER
April 23, 2020, 8:13am
5
Thanks for reporting this bug! It has no direct influcence anywhere on the dashboard as the callback api.php?status
is used instead. This one is reporting the correct status.
The bug will be fixed by
pi-hole:release/v5.0
← pi-hole:fix/summary_status
opened 08:11AM - 23 Apr 20 UTC
**By submitting this pull request, I confirm the following:**
- [X] I have re… ad and understood the [contributors guide](https://github.com/pi-hole/pi-hole/blob/master/CONTRIBUTING.md).
- [X] I have checked that [another pull request](https://github.com/pi-hole/FTL/pulls) for this purpose does not exist.
- [X] I have considered, and confirmed that this submission will be valuable to others.
- [X] I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
- [X] I give this submission freely, and claim no ownership to its content.
**How familiar are you with the codebase?:**
## 10
---
Do not decide whether we are blocking or not based on the gravity count (pre-v5.0 measure) but use the dedicated `blockingstatus` variable.
The underlying issue was that we decided whether blocking is enabled or not by counting the blocked domains in Pi-hole v4.x. However, with Pi-hole v5.0, the number of blocked domains does not change when you enable or disable blocking to speed up the entire process. Instead, we check immediately before a database lookup whether we can skip this as the user doesn't want any domains to be blocked at all.
1 Like