barcus/bareos

Restore jobs not shown in Webui

Closed this issue · 2 comments

opelx commented

Hello bareos friends,

there are some restore jobs:

    $ sudo docker-compose exec bareos-dir bconsole
    Connecting to Director localhost:9101
    ....
    *.jobs type=R
    restore-NextCloud
    RestoreFiles

but both aren't shown by the webui
Bild bareos-webui-restore-w8jrx.png auf abload.de Bild bareos-webui-restore-8ek0a.png auf abload.de

"Restore Jobs" are grayed out. I found an old reference from 2016 and older (e.g. Kein Restore in WebUI but it isn't applicable here since there are no db settings as I found on webui ini files), but they aren't helpful.

Attached my compose file for the case it matters:

    version: '3'
    services:
      bareos-dir:
        image: barcus/bareos-director:19-ubuntu-pgsql
        restart: 
          always
        volumes:
          - director_config:/etc/bareos
          - director_data:/var/lib/bareos
        ports:
          # public for other clients on network
          - 9101:9101
        networks:
          - bareos-tier
          - default
        environment:
          - DB_HOST=bareos-db
          - DB_PORT=5432
          - DB_PASSWORD=ThisIsMySecretDBp4ssw0rd
          - BAREOS_SD_HOST=bareos-sd
          - BAREOS_SD_PASSWORD=ThisIsMySecretSDp4ssw0rd
          - BAREOS_FD_HOST=bareos-fd
          - BAREOS_FD_PASSWORD=ThisIsMySecretFDp4ssw0rd
          - BAREOS_WEBUI_PASSWORD=ThisIsMySecretUIp4ssw0rd
          - SMTP_HOST=mail.example.com
          - SENDER_MAIL=bareos@example.com #optional
          - ADMIN_MAIL=bareos@example.com
          - TZ=Europe/Berlin
        depends_on:
          - bareos-db
          - bareos-sd
      bareos-sd:
        image: barcus/bareos-storage:19-ubuntu
        restart: 
          always
        ports:
          - 9103:9103
        networks:
          - default
        volumes:
          - storage_config:/etc/bareos
          - storage_data:/var/lib/bareos/storage
        environment:
          - BAREOS_SD_PASSWORD=ThisIsMySecretSDp4ssw0rd
          - TZ=Europe/Berlin
      bareos-fd:
        image: barcus/bareos-client:19-ubuntu
        restart: 
          always
        networks:
          - default
        volumes:
          - client_config:/etc/bareos
          - director_data:/var/lib/bareos-director
        environment:
          - BAREOS_FD_PASSWORD=ThisIsMySecretFDp4ssw0rd
          - TZ=Europe/Berlin
      bareos-webui:
        image: barcus/bareos-webui:19-ubuntu
        restart: 
          always
        ports:
          - 9100:80
        networks:
          - default
          - frontproxy-tier
        extra_hosts:
          # Doesn't fix apache's warning about 'ServerName'
          - "bareos.example.com:192.168.1.11"
          - "backup.example.com:192.168.1.11"
        environment:
          - BAREOS_DIR_HOST=bareos-dir
          - SERVER_STATS=yes
          - TZ=Europe/Berlin
          - VIRTUAL_HOST=bareos.example.com,backup.example.com
        volumes:
          - webui_config:/etc/bareos-webui
          - webui_data:/usr/share/bareos-webui
        depends_on:
          - bareos-dir
      bareos-db:
        image: postgres:9.3
        restart: 
          always
        networks:
          - default
        volumes:
          - postgresql_data:/var/lib/postgresql/data
        environment:
          - POSTGRES_PASSWORD=ThisIsMySecretDBp4ssw0rd
          - TZ=Europe/Berlin
        healthcheck:
          test: ["CMD-SHELL", "pg_isready -U postgres"]
          interval: 2s
          timeout: 20s
          retries: 3
    volumes:
      director_config:
        driver: local
        driver_opts:
          type: none
          o: 'bind'
          device: '/srv/docker/bareos/config/director'
      director_data:
        driver: local
        driver_opts:
          type: none
          o: 'bind'
          device: '/srv/docker/bareos/data/director'
      storage_config:
        driver: local
        driver_opts:
          type: none
          o: 'bind'
          device: '/srv/docker/bareos/config/storage'
      storage_data:
        driver: local
        driver_opts:
          type: none
          o: 'bind'
          device: '/srv/docker/bareos/data/storage'
      client_config:
        driver: local
        driver_opts:
          type: none
          o: 'bind'
          device: '/srv/docker/bareos/config/client'
      webui_config:
        driver: local
        driver_opts:
          type: none
          o: 'bind'
          device: '/srv/docker/bareos/config/webui'
      webui_data:
        driver: local
        driver_opts:
          type: none
          o: 'bind'
          device: '/srv/docker/bareos/data/webui'
      postgresql_data:
        driver: local
        driver_opts:
          type: none
          o: 'bind'
          device: '/srv/docker/bareos/data/pgsql'
    networks:
      bareos-tier:
        external: 
          true
      frontproxy-tier:
        external: 
          true

Also, my restore job hasn't any specials:

    $ cat  bareos-dir.d/job/restore-NextCloud.conf 
    Job {
      Name = "restore-NextCloud"
      Description = "Restore Nextcloud files and database"
      Type = Restore
      Client = nextcloud-fd
      FileSet = "NextCloud"
      Storage = File
      Pool = Incremental
      Messages = Standard
      Where = /
      ClientRunBeforeJob = "/nextcloud_before.sh"
      ClientRunAfterJob =  "/nextcloud_after_restore.sh"
    }
opelx commented

so, after some more test, the issue dissappears if I 'remove' the job/restore-NextCloud.conf. But I'm not sure about the reason in detail.

    $ cat -n ./client/nextcloud-fd.conf
         1	Client {
         2	  Name = nextcloud-fd
         3	  Address = nextcloud-fd
         4	  Password = ThisIsMySecretFDp4ssw0rd
         5	}

    $ cat -n ./fileset/NextCloud.conf
         1	FileSet {
         2	  Name = "NextCloud"
         3	  Description = "Back up Nextcloud dirs and dump MySQL DB"
         4	  Include {
         5	    Options {
         6	      Signature = MD5
         7	      # Bareos uses https://github.com/bareos/fastlzlib for compression=LZFAST,
         8	      # compression=LZ4 and compression= LZ4HC
         9	      # which isn't available on alpine linux (2020, v3.11)
        10	      Compression = GZIP
        11	    }
        12	    File = /var/www/html
        13	    Plugin = "bpipe:file=/MYSQL/dump.sql:reader=/mysql_bpipe_backup.sh:writer=/mysql_bpipe_restore.sh"
        14	  }
        15	}
    $ cat -n ./job/restore-NextCloud.conf.disabled
         1	Job {
         2	  Name = "restore-NextCloud"
         3	  Description = "Restore Nextcloud files and database"
         4	  Type = Restore
         5	  Client = nextcloud-fd
         6	  FileSet = "NextCloud"
         7	  Storage = File
         8	  Pool = Incremental
         9	  Messages = Standard
        10	  Where = /
        11	  ClientRunBeforeJob = "/nextcloud_before.sh"
        12	  ClientRunAfterJob =  "/nextcloud_after_restore.sh"
        13	}
    $ cat -n ./job/backup-NextCloud.conf
         1	Job {
         2	  Name = "backup-NextCloud"
         3	  JobDefs = "DefaultJob"
         4	  Client = "nextcloud-fd"
         5	  FileSet = "NextCloud"
         6	  ClientRunBeforeJob = "/nextcloud_before.sh"
         7	  ClientRunAfterJob =  "/nextcloud_after_backup.sh"
         8	}

The background about this comes from Bareos Backup Whitepaper.

Edit: Just checked: restore from bconsole works as expected.

opelx commented

Seems to be known problem, mentioned at https://bugs.bareos.org/view.php?id=1244, so it's not related to the docker version, I close it :)