barcus / bareos

Docker image for Bareos
https://hub.docker.com/r/barcus
MIT License
116 stars 55 forks source link

Version mixup after latest container update? #94

Closed PaulLebmann closed 3 years ago

PaulLebmann commented 3 years ago

Hi,

after updating a functioning docker-compose setup of 19-ubuntu-pgsql to the version pushed a day a go to dockerhub the director wont start. Errors concerning the database are shown. It seems the latest image of 19-ubuntu-pgsql wants an older database scheme than the version before created. I expected that bareos 19.2 is in the image and therefore that there are no needs for changes to the database.

Steps to reproduce (if required): I'm not able to reproduce, since I don't have another setup here but I'd say take a running 19-ubutnu-pgsql setup from last year and run docker-compose pull and docker-compose up -d.

Here you see the output I found in docker-compose logs -f while the container is restarting:

bareos_bareos-dir_1 exited with code 1 bareos-dir_1 | Updating postgresql tables bareos-dir_1 | Don't know how to upgrade from version 2192 to 2171 bareos-dir_1 | Granting postgresql tables bareos-dir_1 | psql:/tmp/grants.sql.105:1: ERROR: role "bareos" already exists bareos-db_1 | ERROR: role "bareos" already exists bareos-db_1 | STATEMENT: CREATE USER bareos PASSWORD 'HFNfO1KT9rwI0D8eg6k4'; bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | GRANT bareos-dir_1 | Privileges for user bareos granted ON database bareos. bareos-dir_1 | bareos-dir: dird/dird.cc:927-0 Could not open Catalog "MyCatalog", database "bareos". bareos-dir_1 | bareos-dir: dird/dird.cc:932-0 Version error for database "bareos". Wanted 2171, got 2192 bareos-dir_1 | bareos-dir ERROR TERMINATION bareos-dir_1 | Please correct the configuration in /etc/bareos/bareos-dir.d//.conf bareos_bareos-dir_1 exited with code 1

I tried to find out what Version of bareos corresponds to what version of the database (-scheme I suppose), but I was not lucky. To me it seems that Wanted 2171, got 2192 indicates that the version of the director in the new image is older than the version in the image I used before.

I suspect it is just an error with the Bareos 19 image and therefore an upgrade to Bareos 20 should work. I have not tried it, but if I'm not able to find a solution in the next few days it is going to be my way forward.

Best regards and thanks for your great work on this project!

barcus commented 3 years ago

Hi, i can reproduce it. this image contains Bareos 18 (it explains why db is 2171) let me take a look

barcus commented 3 years ago

Interesting issue, seems to be there for a while (when i started to use buildx to build arm version) ! 😁 Also maybe it could be related to number of same image i use in one context. Its related to docker build context that i don't use correctly. It affects v17 and v19 ubuntu images. so finaly i'm gonna create a dedicated context for each build

PaulLebmann commented 3 years ago

Whoa - that's a quick response. I just opened your github issues (here in the morning) and thought I made an error not sending the report.

Thanks a lot!