Closed marc0s closed 6 years ago
I got the exact same issue here after performing a pull on the docker image.
Reason:
From /init, this command portusctl exec rails r /srv/Portus/bin/check_db.rb | grep DB
yields DB_EMPTY
if there is a single missing migration.
Which was my case, I had this migration missing: 20180207145522_change_vulnerabilities_to_medium_text.rb
If I manually run: portusctl rake db:migrate
(without lettings db:setup running), then check_db.rb yields DB_READY
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 has been finally fixed with #1970 and https://github.com/openSUSE/docker-containers/commit/293e28998f08f83de50335c854caecb9c1597d89. The head
image will contain the fix once it's done building.
Thanks everyone for the feedback :clap:
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!