mattwebbio / orbital-sync

Synchronize multiple Pi-hole instances
http://orbitalsync.com
MIT License
634 stars 20 forks source link

Error: The host XXX refused to connect. Is it down? #334

Closed gamosoft closed 4 months ago

gamosoft commented 4 months ago

What happened?

Hello there, first of all thanks for putting this together, I am really into containerizing everything in my homelab and this project suits my needs :-)

I have my main pihole server on a dedicated raspberry Pi with IP 192.168.1.9 working perfectly fine. Now I have a whole bunch of containers and would like to add a new docker container for pihole (at the time of writing this the latest available one pihole/pihole:2024.05.0) so I can have a backup one, synchronizing using Orbital.

Everything is behind Traefik as a reverse proxy and custom wildcard certificates issued by my own CA to my own homelab.local domain so no external dependencies here. ;-)

The problem when I attempt to start Orbital is what is shown in the log below.

This is the relevant piece of docker compose for my secondary pihole (the containerized one):

    labels:
      - traefik.enable=true
      - traefik.http.routers.pihole.rule=Host(`pihole.${HOMELAB_DOMAIN}`)
      - traefik.http.services.pihole.loadbalancer.server.port=80
      - traefik.http.routers.pihole.entrypoints=web,websecure
      - traefik.http.routers.pihole.tls=true
      - traefik.http.middlewares.pihole-prefix.addprefix.prefix=/admin

and this is the one for Orbital:

    environment:
      - PRIMARY_HOST_BASE_URL=http://192.168.1.9
      - PRIMARY_HOST_PATH=/admin
      - PRIMARY_HOST_PASSWORD=$PH_WEBPASSWORD
      - SECONDARY_HOSTS_1_BASE_URL=https://pihole.${HOMELAB_DOMAIN}
      - SECONDARY_HOSTS_1_PASSWORD=$PH_WEBPASSWORD
      - SECONDARY_HOSTS_1_PATH=/admin
      - INTERVAL_MINUTES=60

To discard certificate trust issues, I even tried with NODE_TLS_REJECT_UNAUTHORIZED=0 but the same error...

I've tried adding regex rules for the middleware, removing the /admin, etc etc, but always the same issue :-(

Any help would be appreciated.

Any ideas what can I try to make it work?

Version

1.8.1

Log output

homelab-orbital  | 6/6/2024, 4:04:51 PM: ➡️ Signing in to http://192.168.1.9/admin...
homelab-orbital  | 6/6/2024, 4:04:51 PM: ✔️ Successfully signed in to http://192.168.1.9/admin!
homelab-orbital  | 6/6/2024, 4:04:51 PM: ➡️ Downloading backup from http://192.168.1.9/admin...
homelab-orbital  | 6/6/2024, 4:04:52 PM: ✔️ Backup from http://192.168.1.9/admin completed!
homelab-orbital  | 6/6/2024, 4:04:52 PM: ➡️ Signing in to https://pihole.homelab.local/admin...
homelab-orbital  | 6/6/2024, 4:04:52 PM: ⚠ Error: The host "https://pihole.homelab.local/admin" refused to connect. Is it down?
homelab-orbital  | 6/6/2024, 4:04:52 PM: ⚠ Failure: 0/1 hosts synced.
homelab-orbital  | 6/6/2024, 4:04:52 PM: Waiting 60 minutes...
gamosoft commented 4 months ago

Nevermind, it was due to the bridging network I was using, I actually replaced the host URL with the internal hostname assigned to my secondary pihole container:

- SECONDARY_HOSTS_1_BASE_URL=http://homelab-pihole

And it all works now, thanks a lot! ☺️