stevejenkins / pihole-cloudsync

Syncs blocklists, blacklists, and whitelists across multiple Pi-holes using a private GitHub repo
MIT License
518 stars 104 forks source link

Number of Blocked Domains on Dashboard not updating on Secondary PiHole #30

Open Wh1t3Rose opened 3 years ago

Wh1t3Rose commented 3 years ago

Hello.

I am able to confirm that my setup is working. The Master Pihole uploads to my github repo via Cronjob and my Secondary Pihole is pulling down those changes (new adlists at least) via Cronjob fine./

However the Domains blocked number on the Dashboard for the secondary Pihole never updates.

Pihole Master image

Pihole Slave image

My repo: https://github.com/Wh1t3Rose/my-pihole-lists

Debug logs: Master Pihole: https://pastebin.com/T8isvcJ9 Secondary: https://pastebin.com/PnHptpwZ

dispo2 commented 3 years ago

you have a ton of sql errors on the secondary, I'd suggest you rename / delete the gravity.db file in /etc/pihole then run pihole -r (retain settings) then run --initpull followed by --pull.

mooleshacat commented 2 years ago

I suspect the local repositories on both pi's are out of sync with the remote repositories...

What I did when I had that issue is just clobbered both pi's all and started over. Make sure you have a working pihole backup to use in the teleporter on the main pi ONLY. Do not use the teleporter on the secondary pi.

Make sure to reset your cloudsync repository (copy the files from https://github.com/stevejenkins/my-pihole-lists into your repository) before starting.

On both RPI1 and RPI2:

  1. pihole uninstall (no to uninstall packages, yes to everything else)
  2. rm -r /usr/local/bin/my-pihole-lists/ && rm -r /usr/local/bin/pihole-cloudsync/
  3. copy command from uninstall output and paste it to reinstall pihole right away
  4. During install uncheck the default 'Stephen Black' list
  5. Do not use the teleporter just yet

On master RPI1:

  1. Use teleporter to get back to where you were and make sure the option to clear database first is checked.
  2. Set all your settings under Settings page
  3. Install pihole-cloudsync again (follow instructions) for master RPI1, do --initpush and put it in --push mode
  4. Set up the cronjob

On slave RPI2:

  1. Do not use teleporter.
  2. Set all your settings under Settings page
  3. Install pihole-cloudsync again (follow instructions) for master RPI1, do --initpull and put it in --pull mode
  4. Set up the cronjob

To confirm, either manually run or wait for the cronjob to run, and then refresh the slave pihole dashboard. You should see all of the sudden the numbers go from 0 to whatever the master RPI1 says.

I tested by adding domains into blacklist and whitelist, waiting for timers to expire, then watch the updated date/time in your git repository, and then searched for the test domains on the slave.

Note: To ensure this does not happen again, do NOT make your adlist, whitelist, blacklist changes on the slave RPI2.

Make your adlist, whitelist, blacklist changes on the master RPI1 ONLY and allow it to sync back and forth