gravity-sync
gravity-sync copied to clipboard
Failing to push/pull Gravity Databases
Issue Description I'm having issues pulling or pushing 2 gravity databases
Configuration Details
$ gravity-sync push
โ Initializing Gravity Sync (4.0.4)
โ Loading gravity-sync.conf
โ Detecting local Pi-hole installation
โ Detecting remote Pi-hole installation
โ Gravity Sync remote peer is configured
โ Evaluating arguments: PUSH
ยป Remote target [email protected]
โ Validating pathways to Pi-hole
โ Validating pathways to DNSMASQ
โ Hashing the remote Gravity Database
โ Comparing to the local Gravity Database
! Differences detected in the Gravity Database
โ Hashing the remote DNS Records
โ Comparing to the local DNS Records
! Differences detected in the DNS Records
! DNS CNAMEs not detected on the local Pi-hole
! Static DHCP Addresses not detected on the local Pi-hole
! Replication of Pi-hole settings is required
โ Performing backup of remote Gravity Databasesudo: unable to resolve host phole2-Pi3B: Name or service not known
โ Performing backup of remote Gravity Database
โ Performing backup of local Gravity Databasesudo: unable to resolve host phole3-Pi3B: Name or service not known
โ Performing backup of local Gravity Database
โ Checking Gravity Database copy integrity
โ Pushing the local Gravity Database
Not sure what I could be doing wrong.
The only other thing I did is ensure that the user I added a visudo entry for "piholeGravitySync":
piholeGravitySync ALL=(ALL) NOPASSWD:/usr/local/bin/gravity-sync,/usr/local/bin/pihole,/usr/bin/pihole-FTL
I think these two lines are your problem:
โ Performing backup of remote Gravity Databasesudo: unable to resolve host phole2-Pi3B: Name or service not known
โ Performing backup of local Gravity Databasesudo: unable to resolve host phole3-Pi3B: Name or service not known
Seems like DNS resolution isn't working properly. What happens if you run ping phole3-Pi3B? Is there a typo in your configuration where you missed the letter 'i', and the hostname should really be pihole3-Pi3B?
Seems like DNS resolution isn't working properly. What happens if you run
ping phole3-Pi3B? Is there a typo in your configuration where you missed the letter 'i', and the hostname should really bepihole3-Pi3B?
Fixed that when I added 127.0.1.1
$ sudo -u piholeGravitySync gravity-sync push
โ Initializing Gravity Sync (4.0.4)
โ Loading gravity-sync.conf
โ Detecting local Pi-hole installation
โ Detecting remote Pi-hole installation
โ Gravity Sync remote peer is configured
โ Evaluating arguments: PUSH
ยป Remote target [email protected]
โ Validating pathways to Pi-hole
โ Validating pathways to DNSMASQ
โ Hashing the remote Gravity Database
โ Comparing to the local Gravity Database
! Differences detected in the Gravity Database
โ Hashing the remote DNS Records
โ Comparing to the local DNS Records
! Differences detected in the DNS Records
! DNS CNAMEs not detected on the local Pi-hole
! Static DHCP Addresses not detected on the local Pi-hole
! Replication of Pi-hole settings is required
โ Performing backup of remote Gravity Database
โ Performing backup of local Gravity Database[sudo] password for piholeGravitySync:
โ Performing backup of local Gravity Database
โ Checking Gravity Database copy integrity
โ Pushing the local Gravity Database
Still doesn't work
Not sure why it's still asking for a sudo password in spite of your sudo rule, which looks fine to me. I'm guessing you have, but to cover all bases: have you configured that same sudo rule on both pihole machines?
I fixed that part by re-arranging the order of my sudo rules.
Other than that, same issue.
Get Outlook for iOShttps://aka.ms/o0ukef
From: Seb Thomson @.> Sent: Friday, February 17, 2023 7:19:45 AM To: vmstan/gravity-sync @.> Cc: YamiYukiSenpai @.>; Author @.> Subject: Re: [vmstan/gravity-sync] Failing to push/pull Gravity Databases (Issue #380)
Not sure why it's still asking for a sudo password in spite of your sudo rule, which looks fine to me. I'm guessing you have, but to cover all bases: have you configured that same sudo rule on both pihole machines?
โ Reply to this email directly, view it on GitHubhttps://github.com/vmstan/gravity-sync/issues/380#issuecomment-1434563964, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADELGZC3EGBGVQK35MNQNSLWX5UGDANCNFSM6AAAAAAUY2ZKTQ. You are receiving this because you authored the thread.Message ID: @.***>
Figured out why.
I only found out about gravity-sync sudo which I didn't use when I set it up.
My issue with it is that it does ALL commands, which I'm not comfortable with.
I'll work on making it more restricted in sudoers.
Effective July 26, 2024, this project has been retired. Thank you for your use and enthusiasm for a project that began as a few lines of bash in a Slack channel and envolved into something far more complex, and used by many thousands of Pi-hole enthusiasts over the last four years.