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

Fails at "Pushing the local Gravity Database". (Pull works on other side)

Open rr326 opened this issue 1 year ago โ€ข 2 comments
trafficstars

Issue Description I have a new install. Two docker containers. One will be master. Slave is empty. When I push from master, it fails at "Pushing the local Gravity Database". No explanation why. When I pull from slave, it succeeds. Both are configured.

Push:

 gravity-sync push
โˆž Initializing Gravity Sync (4.0.7)
โœ“ Loading gravity-sync.conf
โœ“ Detecting local Pi-hole installation
โœ“ Detecting remote Pi-hole installation - docker
โœ“ 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 Databasemd5sum: /etc/pihole/gravity.db: No such file or directory
โœ“ Hashing the remote Gravity Database
โœ“ Comparing to the local Gravity Database
! Differences detected in the Gravity Database
! DNS Records not detected on the remote Pi-hole
! 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
โœ“ Checking Gravity Database copy integrity
โœ— Pushing the local Gravity Database

You can see four "! xxx" which I assume are not problems, just showing sync needs to happen.

When I run 'gravity-sync compare' from master:

 gravity-sync compare
โˆž Initializing Gravity Sync (4.0.7)
โœ“ Loading gravity-sync.conf
โœ“ Detecting local Pi-hole installation
โœ“ Detecting remote Pi-hole installation - docker
โœ“ Gravity Sync remote peer is configured
โœ“ Evaluating arguments: COMPARE
ยป Remote target [email protected]
โœ“ Validating pathways to Pi-hole
โœ“ Validating pathways to DNSMASQ
โˆž Hashing the remote Gravity Databasemd5sum: /etc/pihole/gravity.db: No such file or directory
โœ“ Hashing the remote Gravity Database
โœ“ Comparing to the local Gravity Database
! Differences detected in the Gravity Database
! DNS Records not detected on the remote Pi-hole
! 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
โˆž Gravity Sync COMPARE completed after 2 seconds

Configuration Details

Master

gravity-sync info
โˆž Initializing Gravity Sync (4.0.7)
โœ“ Loading gravity-sync.conf
โœ“ Detecting local Pi-hole installation
โœ“ Detecting remote Pi-hole installation - docker
โœ“ Gravity Sync remote peer is configured
โœ“ Evaluating arguments: INFO
Local Software Versions
Pi-hole
  Pi-hole version is v5.17.3 (Latest: v5.17.3)
  web version is v5.21 (Latest: v5.21)
  FTL version is v5.24 (Latest: v5.24)
Debian GNU/Linux 12
Linux 6.1.0-rpi7-rpi-2712 aarch64
bash 5.2.15(1)-release
OpenSSH_9.2p1 Debian-2+deb12u1, OpenSSL 3.0.11 19 Sep 2023
rsync  version 3.2.7  protocol version 31
Sudo version 1.9.13p3
git version 2.39.2
Docker version 24.0.7, build afdd53b

Global Instance Settings
SSH Port: 22 (default)
SSH Key: /etc/gravity-sync/gravity-sync.rsa
Automated Replication: Disabled

Local Instance Settings
Local Hostname: pi5-seattle
Local Pi-hole Type: docker
Local Pi-hole Config Directory: /home/pi/dev/docker/pihole/etc-pihole
Local DNSMASQ Config Directory: /home/pi/dev/docker/pihole/etc-dnsmasq.d
Local Gravity Sync Binary: /usr/local/bin/gravity-sync
Local Gravity Sync Config Directory: /etc/gravity-sync
Local Pi-hole Container Name: pihole
Local Docker Binary Directory: /usr/bin/docker
Local File Owner Settings: 999:999

Remote Instance Settings
Remote Hostname/IP: 192.168.1.129
Remote Username: pi
Remote Pi-hole Type: docker
Remote Pi-hole Config Directory: /etc/pihole
Remote DNSMASQ Config Directory: /etc/dnsmasq.d
Remote Pi-hole Container Name: pihole
Remote Docker Binary Directory: /usr/bin/docker
Remote File Owner Settings: pihole:pihole
โˆž Gravity Sync INFO exited after 2 seconds

Slave

โฏ gravity-sync info
โˆž Initializing Gravity Sync (4.0.7)
โœ“ Loading gravity-sync.conf
โœ“ Detecting local Pi-hole installation
โœ“ Detecting remote Pi-hole installation - docker
โœ“ Gravity Sync remote peer is configured
โœ“ Evaluating arguments: INFO
Local Software Versions
Pi-hole
  Pi-hole version is v5.16.2 (Latest: v5.17.3)
  AdminLTE version is v5.19 (Latest: null)
  FTL version is v5.22 (Latest: v5.24)
Debian GNU/Linux 11
Linux 5.10.103-v7l+ armv7l
bash 5.1.4(1)-release
OpenSSH_8.4p1 Debian-5+deb11u3, OpenSSL 1.1.1w  11 Sep 2023
rsync  version 3.2.3  protocol version 31
Sudo version 1.9.5p2
git version 2.30.2
Docker version 24.0.7, build afdd53b

Global Instance Settings
SSH Port: 22 (default)
SSH Key: /etc/gravity-sync/gravity-sync.rsa
Automated Replication: Disabled

Local Instance Settings
Local Hostname: pi-seattle
Local Pi-hole Type: docker
Local Pi-hole Config Directory: /home/pi/dev/docker/pihole/etc-pihole
Local DNSMASQ Config Directory: /home/pi/dev/docker/pihole/etc-dnsmasq.d
Local Gravity Sync Binary: /usr/local/bin/gravity-sync
Local Gravity Sync Config Directory: /etc/gravity-sync
Local Pi-hole Container Name: pihole
Local Docker Binary Directory: /usr/bin/docker
Local File Owner Settings: 999:999

Remote Instance Settings
Remote Hostname/IP: 192.168.1.138
Remote Username: pi
Remote Pi-hole Type: docker
Remote Pi-hole Config Directory: /home/pi/dev/docker/pihole/etc-pihole
Remote DNSMASQ Config Directory: /home/pi/dev/docker/pihole/etc-dnsmasq.d
Remote Pi-hole Container Name: pihole
Remote Docker Binary Directory: /usr/bin/docker
Remote File Owner Settings: 999:999
โˆž Gravity Sync INFO exited after 2 seconds

rr326 avatar Jan 17 '24 13:01 rr326

Remote Pi-hole Config Directory: /etc/pihole

This doesn't appear to be correct for how the primary would view the secondary.

vmstan avatar Jan 17 '24 14:01 vmstan

That was the clue I needed.

I followed the installation scripts - primary then secondary, and for some reason it didn't fill in the remote info on the primary configuration.

I fixed those manually and it worked.

I'm not sure why, but maybe this:

During the installation at some point it was failing. I realized I didn't have authorized_keys set up to allow ssh from primary to secondary. I fixed it.

Maybe that was the issue? Perhaps "I can properly ssh to remote" isn't working properly in the requirements validation phase?

My problem is solved. (thanks.) Let me know if you want any more info from me, otherwise I can close this.

# REQUIRED SETTINGS ##########################

REMOTE_HOST='192.168.1.129'
REMOTE_USER='pi'

# CUSTOM VARIABLES ###########################

# Pi-hole Folder/File Customization - Only need to be customized when using containers
LOCAL_PIHOLE_DIRECTORY='/home/pi/dev/docker/pihole/etc-pihole'
# REMOTE_PIHOLE_DIRECTORY=''			    # Remote Pi-hole data directory
LOCAL_DNSMASQ_DIRECTORY='/home/pi/dev/docker/pihole/etc-dnsmasq.d'
# REMOTE_DNSMASQ_DIRECTORY=''               # Remote DNSMASQ/FTL data directory
LOCAL_FILE_OWNER='999:999'
# REMOTE_FILE_OWNER=''                      # Remote file owner for Pi-hole

# Pi-hole Docker/Podman container name - Docker will pattern match anything set below
LOCAL_DOCKER_CONTAINER='pihole'
# REMOTE_DOCKER_CONTAINER=''				# Remote Pi-hole container name

# HIDDEN FIGURES #############################
# See https://github.com/vmstan/gravity-sync/wiki/Hidden-Figures

rr326 avatar Jan 17 '24 14:01 rr326

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