SavageSoftware / portainer-backup

Portainer Backup Utility
153 stars 14 forks source link

Can't connect to portainer #18

Open crispybegs opened 8 months ago

crispybegs commented 8 months ago

hi all, i'd really like to try and get this working but I'm running into a bit of a wall. Whatever I try, I'm unable to connect to portainer.

Firstly, my portainer container has these ports:

Screenshot 2024-02-07 at 19 36 47

.. so I presumed the PORTAINER_BACKUP_URL should be "http://192.168.1.14:8000" (192.168.1.14 being the server it's on), however the logs show Validating portainer server failing with Request failed with status code 404

I tried PORTAINER_BACKUP_URL: "http://portainer:8000" but this produces an error of getaddrinfo EAI_AGAIN portainer PORTAINER_BACKUP_URL: "http://portainer:9000" also produces getaddrinfo EAI_AGAIN portainer

PORTAINER_BACKUP_URL: "http://192.168.1.14:9000" produces an error saying ECONNREFUSED 192.168.1.14:9000

My portainer container network is 'bridge', so I tried putting portainer-backup also on the bridge network, but it made no difference to the error messages

At this point I'm stumped, so I must be missing something obvious. Any ideas? This is my compose, to help maybe spot what I've done wrong

version: '3.8'
services:
  portainer-backup:
    container_name: portainer-backup
    image: savagesoftware/portainer-backup:latest
    hostname: portainer-backup
    restart: unless-stopped
    command: schedule
    environment:
      TZ: Europe/London
      PORTAINER_BACKUP_URL: "http://192.168.1.14:9000"
      PORTAINER_BACKUP_TOKEN: "_redacted_"
      PORTAINER_BACKUP_PASSWORD: ""
      PORTAINER_BACKUP_OVERWRITE: 1
      PORTAINER_BACKUP_SCHEDULE: "33 19 * * *"
      PORTAINER_BACKUP_STACKS: 1
      PORTAINER_BACKUP_DRYRUN: 0
      PORTAINER_BACKUP_CONCISE: 1
      PORTAINER_BACKUP_DIRECTORY: "/home/crispy/docker/portainer-backups/automatic"
      PORTAINER_BACKUP_FILENAME: "nas-portainer-backup-{{yyyy-MM-dd}}.tar.gz"
    volumes:
      - /home/crispy/docker/portainer-backups/automatic:/backup
Shieroz commented 5 months ago

Your portainer stack itself might be listening on another port. Check the VIRTUAL_PORT=9000 environment variable of your portainer stack. The default is 9000 so you'll have to change your port mapping to 8000:9000 to get the URL http://192.168.1.14:8000 working.