-
Notifications
You must be signed in to change notification settings - Fork 472
Database detected as empty and its tried to be setup again #1712
Comments
I got the exact same issue here after performing a pull on the docker image. Reason: If I manually run: |
I miss the notification for this reply, sorry. I got it fixed as well. Thanks. |
Actually, I would keep this bug open. We should expect init script to detect that there are missing migrations, and try to apply them on startup, instead of trying to wipe out and recreate the database. |
This task should be used when setting up the database instead of the usual combination. This handles databases with pending migrations, new databases, etc. See SUSE#1639 See SUSE#1712 Signed-off-by: Miquel Sabaté Solà <[email protected]>
The commit 914cc9ebfdee7b22ee934e6cc4bac0bfd6dfa9fd of Portus introduced the `portus:db:configure` task, which is a replacement for `db:setup` in containerized environments. See SUSE/Portus#1639 See SUSE/Portus#1712 Signed-off-by: Miquel Sabaté Solà <[email protected]>
This has been finally fixed with #1970 and openSUSE/docker-containers@293e289. The Thanks everyone for the feedback 👏 |
Description
I'm using a
docker-compose
setup. Fetchportus:head
and restarted my containers.portus
didn't come up because it failed with something very similar to this.Steps to reproduce
portus:head
Findings
After some digging, I found out that
init
is checking if we setPORTUS_INIT_COMMAND
, by default it isn't. I manually run thecheck_db.rb
script and found out that it was sending back aDB_EMPTY
, which is actually inaccurate. I manually entered into the DB and found that my data was still there.So, I set
PORTUS_INIT_COMMAND
toportusctl exec "pumactl -F /srv/Portus/config/puma.rb start"
(just asinit
runs at the end) and my container started flawlessly.What's
portus/db
using to determine if the database is empty or not? I think I have run somehow the same docker-compose setup but with2.3
instead ofhead
once trying to find out the issue (maybe causing the issue, actually?). Might it be the source of the problem if it can modify something thatportus/db
will interpret as an empty database?Please tell me if you need anything else.
Thanks!
The text was updated successfully, but these errors were encountered: