Pi-hole: After a few days Pi Hole stops blocking ads

Created on 27 Mar 2016  路  33Comments  路  Source: pi-hole/pi-hole

After a few days of leaving Pi Hole running this occurs: http://imgur.com/xY0fG9G

Then after running gravity.sh things start working again: http://imgur.com/yyWhbOL

Sometimes the "blocked domains" goes to "0". But the blocked ads always remains at "0" until I rerun the gravity script.

Confirmed Fixed in next release

All 33 comments

I've had similar problems where it would show 1 or 0 domains blocked.

Hi there, can you try updating to the latest version (curl -L https://install.pi-hole.net | bash) to see if this problem is fixed.

Many thanks

I got the exact same problem :( I updated two days ago (4/8/16) and today it happened again. Please help, I love my pi hole :)

Hmmm. This is a strange one.

If you're all on the latest version, could you please run pihole -d and then paste the output (/var/log/pihole_debug.log) into a pastebin then link it here? thanks!

Just happened again: http://i.imgur.com/MpJ0gsB.png

_Edit by Promofaux - moved output to pastebin... http://pastebin.com/2nzVwJAQ_

Just happened to me with
http://i.imgur.com/tfpIKjj.png

_Edit by Promofaux - moved output to pastebin.. http://pastebin.com/g9BfJ8MK_

Fixed by reinstalled :/

@rj45jack and @0xc0ffea, can you please copy the log instead to http://pastebin.com and link it? It helps clean up the conversation.

I've just come across this issue also. I noticed I was being served ads. When I loaded the admin panel, I was shown that there were 3 domains being blacklisted.

I fixed by rerunning the gravity script (pihole -g).

I'm running my Pi-Hole on Debian hosted in a VM, so not exactly a normal setup. I updated from 2.5.3 to 2.6.2, and only encountered the issue a few days after the upgrade process.

I had fixed the problem prior to seeing this issue thread, so unfortunately I don't have a dump file for you. If it recurs I will get you one.

O.o It's happening here too, I think...
Screenshot

It appears that only the hostname of the pi, pi.hole (another way to reach the pi... pi.hole/admin), and the blacklist are present in the blocklist. So the actual lists and the whitelist do not get added...

After running gravity, it works... Weird.

OK, so it sounds like this may be down to permissions. I thought the cron job ran as root, though?

Same issue here: suddenly down to 3 domains being blocked. I re-ran the full installer before seeing this thread. I was (and am a still) on v2.6.1.2 -- all was OK on 2.5.3 before.

I just started getting this problem after upgrading from 2.5.3 and confirmed it on two other devices. Runs fine for couple days then down to 3 or 4 blocked domains until gravity is run.

Right, I think we can definitely put this down to the cron job, as it seems to have happened at the same(ish) time for everyone. (The cron job is set to run at 01:59 every Sunday)

Interestingly, this hasn't happened on my setup, but I'm not using a raspberry pi............

Had the same issue, quick fis ix running pihole -g (gravity list update)

Permissions after running pihole -g
image

Permissions after cron runs the same command:
image

Now to find the bit that is removing write permissions from gravity.list... I think that may be the issue here!

Out of curiosity, how did you run the cron script?

I haven't been able to replicate. After running the cron script I'm still seeing:
image

I cheated, I set it to run every minute and rebooted the machine!

image

Hax. Will follow you down the rabbit hole to see if I can replicate.

Well that's interesting. Note the file size of the gravity list and the permissions:
image
Then 30 seconds later (before the cron script re-executes)
image

It's like it's rebuilding the file in the background before cron fires again (which I know is because I just set it to run each minute). Also, permissions on the files are wrong now..

Just tail'ed the gravity list. It's being written out, then being cleaned for some reason. Every minute like clock work it's populating. SS attached in my next comment, because hardcore RDP/VM copy paste derp.

So the way gravity works is like so:

  • Download/update source lists from various locations
  • Parse them all into a single file
  • Process that file several times to remove comments/sort the domains out etc
  • Copy the final file (pihole.3.accretionDisc.txt) over the top of gravity.list _(I think this might be where it's going wrong. I might be wrong though)_
  • Clear up un-used pihole.n.* files

It may be that we just need to preface this line with a $SUDO, however as cron runs the script as root, that shouldn't matter Nope, not that.

Trying that SS again:
image

I had not thought to tail gravity.list! Yeah, as per my previous post, It get's overwritten when gravity runs.

I'm getting realllly weird outputs from tails now.

I've just fixed everything on my end. If you need more testing or anything, please give me a shout. In the meantime, food :)

It's strange, according to mail, the cron job is getting different numbers of domains on each run of pihole -g

I have some stuff at my actual job to be getting on with, but I will give it some thought and let you know if I need anything! Thanks!

Update

Found it! Its the spinner function that is causing the issues, weirdly. It's kind of hacked in anyway, so I'll remove it.

@articuno1au Can I borrow you for testing purposes, please?

cd /etc/.pihole
sudo git fetch
sudo git checkout BugFix409
./automated\ install/basic-install.sh

Then make the changes to the cron job again as we did earlier and confirm that it's fixed!
Thanks

Testing now. Will edit with results.
EDIT::
The output from tail was much much better this time. Looks like more like 100k domains.

Showing the correct number of domains in the admin interface and permissions appear correct. Waiting for the cron job to cycle a few more times before I'll say it looks fixed.

Looking good.
image
image
I'd be calling it fixed.

Nice work sir :)

Super, that's good enough for me. Will merge and release! Hold your horses!

(by the way, just sudo git checkout master and re-run the install script again to go back to main branch.)

Cheers.

I had already done so to save me having to nano into my cron files again. Advanced laziness ;)

Although, truth be told, I probably should have waited for you to publish before I did it..

OK! Fixed in 2.6.2! Re-run install script to update (next up.. a working update script. #soon)

@PromoFaux - Apologies if this re-opens (I'm a bitbucket user).

If you need help testing anything in the future, just mention me and I'll come check it out. I'm in GMT+10, so I should be off work when you're pushing stuff.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tyrnight picture tyrnight  路  32Comments

emmtte picture emmtte  路  33Comments

bauxi picture bauxi  路  53Comments

zimmertr picture zimmertr  路  63Comments

Gartonious picture Gartonious  路  58Comments