rajannpatel / Pi-Hole-PiVPN-on-Google-Compute-Engine-Free-Tier-with-Full-Tunnel-and-Split-Tunnel-OpenVPN-Configs

Run your own privacy-first ad blocking service in the cloud for free on Google Cloud Services.
MIT License
1.31k stars 111 forks source link

Autoupdate is not working #51

Closed Kwbmm closed 5 years ago

Kwbmm commented 5 years ago

Describe the bug The autoupdate described in the README.md file seems to not work for me. Here is crontab log (from /var/log/syslog):

cat /var/log/syslog | grep CRON
Aug 31 06:25:02 pi-hole CRON[26368]: (CRON) info (No MTA installed, discarding output)
Aug 31 06:30:01 pi-hole CRON[26518]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 06:39:01 pi-hole CRON[26641]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Aug 31 06:40:01 pi-hole CRON[26688]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 06:50:01 pi-hole CRON[26794]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 07:00:01 pi-hole CRON[26899]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 07:09:01 pi-hole CRON[27018]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Aug 31 07:10:01 pi-hole CRON[27075]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 07:17:01 pi-hole CRON[27145]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Aug 31 07:20:01 pi-hole CRON[27171]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 07:30:01 pi-hole CRON[27289]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 07:39:01 pi-hole CRON[27384]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Aug 31 07:40:01 pi-hole CRON[27442]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 07:50:01 pi-hole CRON[27537]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 08:00:01 pi-hole CRON[27669]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 08:09:01 pi-hole CRON[27751]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Aug 31 08:10:01 pi-hole CRON[27809]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 08:17:01 pi-hole CRON[27880]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Aug 31 08:20:01 pi-hole CRON[27931]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 08:30:01 pi-hole CRON[28038]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 08:39:01 pi-hole CRON[28120]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Aug 31 08:40:01 pi-hole CRON[28178]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 08:50:01 pi-hole CRON[28306]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 09:00:01 pi-hole CRON[28399]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 09:09:01 pi-hole CRON[28493]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Aug 31 09:10:01 pi-hole CRON[28541]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 09:17:01 pi-hole CRON[28647]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Aug 31 09:20:01 pi-hole CRON[28673]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 09:30:01 pi-hole CRON[28773]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 09:39:01 pi-hole CRON[29369]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Aug 31 09:40:01 pi-hole CRON[29427]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 09:50:01 pi-hole CRON[29527]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 10:00:01 pi-hole CRON[29626]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 10:09:01 pi-hole CRON[29746]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Aug 31 10:10:01 pi-hole CRON[29804]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 10:17:01 pi-hole CRON[29881]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Aug 31 10:20:01 pi-hole CRON[29908]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 10:30:01 pi-hole CRON[30043]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 10:39:01 pi-hole CRON[30129]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Aug 31 10:40:01 pi-hole CRON[30187]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 10:50:01 pi-hole CRON[30280]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 11:00:01 pi-hole CRON[30483]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 11:09:01 pi-hole CRON[30574]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Aug 31 11:10:01 pi-hole CRON[30632]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 11:17:01 pi-hole CRON[30728]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Aug 31 11:20:01 pi-hole CRON[30767]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 11:30:01 pi-hole CRON[30862]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 11:39:01 pi-hole CRON[30960]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Aug 31 11:40:01 pi-hole CRON[31008]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 11:50:01 pi-hole CRON[31146]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 12:00:01 pi-hole CRON[31243]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 12:09:01 pi-hole CRON[31335]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Aug 31 12:10:01 pi-hole CRON[31393]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 12:17:01 pi-hole CRON[31487]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Aug 31 12:20:01 pi-hole CRON[31513]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 12:30:01 pi-hole CRON[31606]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 12:39:01 pi-hole CRON[31724]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Aug 31 12:40:01 pi-hole CRON[31780]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 12:50:01 pi-hole CRON[31874]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 13:00:01 pi-hole CRON[31986]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 13:09:01 pi-hole CRON[32099]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Aug 31 13:10:01 pi-hole CRON[32157]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 13:17:01 pi-hole CRON[32228]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Aug 31 13:20:01 pi-hole CRON[32257]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 13:30:01 pi-hole CRON[32394]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 13:39:01 pi-hole CRON[32486]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Aug 31 13:40:01 pi-hole CRON[32534]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 13:48:01 pi-hole CRON[32619]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker remote)
Aug 31 13:50:01 pi-hole CRON[32663]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 14:00:01 pi-hole CRON[315]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 14:09:01 pi-hole CRON[415]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Aug 31 14:10:01 pi-hole CRON[466]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 14:17:01 pi-hole CRON[549]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Aug 31 14:20:01 pi-hole CRON[575]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 14:30:01 pi-hole CRON[695]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 14:39:01 pi-hole CRON[790]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Aug 31 14:40:01 pi-hole CRON[863]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 14:50:01 pi-hole CRON[956]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 15:00:01 pi-hole CRON[1219]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 15:09:01 pi-hole CRON[1707]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Aug 31 15:10:01 pi-hole CRON[1828]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Aug 31 15:17:01 pi-hole CRON[3456]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Aug 31 15:20:01 pi-hole CRON[3641]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)

This is pihole.log:

Aug 31 06:00:00 dnsmasq[26865]: query[PTR] <...>
Aug 31 06:00:00 dnsmasq[26865]: config <...>
Aug 31 06:00:00 dnsmasq[26865]: query[PTR] <...>
Aug 31 06:00:00 dnsmasq[26865]: config <...>
Aug 31 06:00:00 dnsmasq[26865]: query[PTR] <...>
Aug 31 06:00:00 dnsmasq[26865]: config <...>
Aug 31 06:00:00 dnsmasq[26865]: query[PTR] <...>
Aug 31 06:00:00 dnsmasq[26865]: cached <...>
Aug 31 06:00:00 dnsmasq[26865]: query[PTR] <...>
Aug 31 06:00:00 dnsmasq[26865]: cached <...>
Aug 31 07:00:00 dnsmasq[26865]: query[PTR] <...>

Expected behavior Pi-hole is updated daily. Web interface shouldn't show that there are updates available

rajannpatel commented 5 years ago

Great catch!

MarkIannucci commented 5 years ago

@Kwbmm , thanks for raising this issue. Looking at your activity (and mine), I'm not seeing anything in the log which suggests that the vm is executing the daily crontab. I'll look into this further and see if I can figure out why it is not working.

MarkIannucci commented 5 years ago

@Kwbmm , I configured postfix on my VM to get the error that was being logged. That clued me in to a script fail on my part, which I've now corrected. Doing that and waiting a day resolved my issue. Any chance you can make the config change and give us a test too?

Kwbmm commented 5 years ago

@Kwbmm , I configured postfix on my VM to get the error that was being logged. That clued me in to a script fail on my part, which I've now corrected. Doing that and waiting a day resolved my issue. Any chance you can make the config change and give us a test too?

I have performed the same changes you made in the PR. It will hopefully work.

rajannpatel commented 5 years ago

Please let me know when you folks think the PR with the fix for this issue is ready for merging.

Kwbmm commented 5 years ago

I have been trying to figure out whether autoupdate has been running on its own or not, I believe it does:

pihole.log

...
Sep  8 04:35:02 dnsmasq[2884]: query[AAAA] pi.hole from 127.0.0.1
Sep  8 04:35:02 dnsmasq[2884]: forwarded pi.hole to 8.8.4.4
Sep  8 04:35:02 dnsmasq[2884]: forwarded pi.hole to 8.8.8.8
Sep  8 04:35:02 dnsmasq[2884]: reply pi.hole is NODATA-IPv6
Sep  8 04:35:02 dnsmasq[2884]: query[AAAA] --- from 127.0.0.1
Sep  8 04:35:02 dnsmasq[2884]: forwarded --- to 8.8.4.4
Sep  8 04:35:02 dnsmasq[2884]: reply --- is NXDOMAIN
Sep  8 04:35:02 dnsmasq[2884]: query[AAAA] --- from 127.0.0.1
Sep  8 04:35:02 dnsmasq[2884]: forwarded --- to 8.8.4.4
Sep  8 04:35:02 dnsmasq[2884]: reply --- is NXDOMAIN
Sep  8 04:35:02 dnsmasq[2884]: query[AAAA] pi.hole.google.internal from 127.0.0.1
Sep  8 04:35:02 dnsmasq[2884]: forwarded pi.hole.google.internal to 8.8.4.4
Sep  8 04:35:02 dnsmasq[2884]: reply pi.hole.google.internal is NXDOMAIN
Sep  8 04:35:02 dnsmasq[2884]: query[A] pi.hole from 127.0.0.1
Sep  8 04:35:02 dnsmasq[2884]: /etc/pihole/local.list pi.hole is ---
Sep  8 04:35:02 dnsmasq[2884]: query[A] raw.githubusercontent.com from 127.0.0.1
Sep  8 04:35:02 dnsmasq[2884]: forwarded raw.githubusercontent.com to 8.8.4.4
Sep  8 04:35:02 dnsmasq[2884]: reply raw.githubusercontent.com is <CNAME>
...
Sep  8 04:35:13 dnsmasq[2884]: read /etc/hosts - 6 addresses
Sep  8 04:35:13 dnsmasq[2884]: read /etc/pihole/local.list - 2 addresses
Sep  8 04:35:13 dnsmasq[2884]: read /etc/pihole/black.list - 0 addresses

pihole-FTL.log

[2019-09-08 04:35:13.152 2884] Received SIGHUP, reloading cache
[2019-09-08 04:35:13.152 2884] Blocking status is enabled
[2019-09-08 04:35:13.152 2884] Compiled 0 Regex filters and 3 whitelisted domains in 0.1 msec (0 errors)
[2019-09-08 04:35:13.835 2884] /etc/pihole/black.list: parsed 0 domains (took 0.0 ms)
[2019-09-08 04:35:16.812 2884] /etc/pihole/gravity.list: parsed 1461877 domains (took 2977.7 ms)
[2019-09-08 11:22:00.544 2884] Resizing "/FTL-strings" from 28672 to 32768
[2019-09-08 20:24:38.499 2884] Resizing "/FTL-queries" from 688128 to 917504

Crontab log:

Sep  8 04:30:01 pi-hole CRON[16652]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updatechecker local)
Sep  8 04:35:01 pi-hole CRON[16701]: (root) CMD (   PATH="$PATH:/usr/local/bin/" pihole updateGravity >/var/log/pihole_updateGravity.log || cat /var/log/pihole_updateGravity.log)
Sep  8 04:39:01 pi-hole CRON[16900]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)

I can't tell if the autorestart works though, I think it was not needed in this case