[Docker] Database Upgrade Failed - migrations failed

Hi there,

I’m currently using that standard docker version after running ‘docker-compose pull’. After logging in, I’m prompted to updated my DB schema:

image

After hitting ‘Update’, I get the following:

image

  • Not running anything special and have no 3rd party plugins.
  • Attempted incognito browser but no luck

Reading the FAQ etc. I’m going to export DB and restart everything. Possibly quicker that way.

latest version should be 147, you could’ve downgraded somehow to an older image.

p.s. tons of work = late replies

do ls -l /var/www/html/tt-rss/sql/pgsql/migrations inside app container

Yep, quite a lot of sql’s but here’s 146 & 147:

/ # ls -l /var/www/html/tt-rss/sql/pgsql/migrations | grep 146
-rw-r–r-- 1 app app 98 Dec 11 19:09 146.sql
-rw-r–r-- 1 app app 146 Dec 11 19:09 147.sql

Any quick way of upgrading again? Thanks again @fox

the thing to figure out here is why would it choose 146 instead of 147 if the latter file is there. i haven’t seen anything like this happen, ever. :thinking:

Yeah, quite odd. Even the config file states const SCHEMA_VERSION = 147; …but yeah still waiting to downgrade.

Any particular file to look for?

no idea what could cause this besides somehow you got older code on the app persistent volume which is not updated properly. where were you looking for sql files?

you can try looking through compose logs.
you can delete app volume, your data is in the database, so other than maybe custom plugins and stuff nothing would get lost.
you can also try recreating the containers (i.e. docker compose down; docker compose up).

other than that, idk.

So successfully able to get the DB for a complete redo however having issues pulling the OPML. Any suggestions?

~/tt-rss $ php8 /var/www/html/tt-rss/update.php --opml-export admin:/tmp/admin.opml

Schema version is wrong, please upgrade the database (–update-schema).

(no luck updating schema after this)

your problem is not database-related, it’s very unlikely that you’ll solve it by resetting the database.

and yes, if tt-rss is not starting, CLI won’t work either.

Restored on a new system w/ a backup DB. No idea what happened before but starting fresh w/ old DB is the way forward haha. Thanks again @fox