gravity-sync icon indicating copy to clipboard operation
gravity-sync copied to clipboard

Failing to push/pull Gravity Databases

Open YamiYukiSenpai opened this issue 2 years ago โ€ข 5 comments
trafficstars

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

YamiYukiSenpai avatar Feb 11 '23 18:02 YamiYukiSenpai

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?

rst-ack avatar Feb 14 '23 01:02 rst-ack

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?

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

YamiYukiSenpai avatar Feb 17 '23 03:02 YamiYukiSenpai

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?

rst-ack avatar Feb 17 '23 12:02 rst-ack

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: @.***>

YamiYukiSenpai avatar Feb 17 '23 18:02 YamiYukiSenpai

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.

YamiYukiSenpai avatar Apr 09 '23 08:04 YamiYukiSenpai

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.

vmstan avatar Jul 26 '24 18:07 vmstan