Error upgrading retool 2.x: Sequelize Error

Hi there,

we are currently running self-hosted retool 2.103.7 (licensed) and are trying to upgrade to the latest 2. version available for tryretool/backend, which according to docker hub ist 2.123.20.

Following the README for updating retool, I have edited the local Dockerfile to match the desired version and ran ./update_retool.sh. The updated images is being pulled and the containers are being restarted. However, migrations cannot be applied by the jobs runner service, so the api service won't start:

jobs-runner_1 | {"level":"info","message":"[process service types] JOBS_RUNNER","timestamp":"2024-10-29T05:30:31.274Z"}
api_1 | There are 59 pending database migrations, checking for up-to-date schema in 1 second(s)...
jobs-runner_1 | Acquiring lock to run migrations...
jobs-runner_1 | Acquired lock
jobs-runner_1 | Running database migrations...
jobs-runner_1 | == 20230309194747-drop-branch-pagesave-constraints-from-commits: migrating =======
jobs-runner_1 |
jobs-runner_1 | ---------------------------
jobs-runner_1 | - EXITING RETOOL -
jobs-runner_1 | ---------------------------
jobs-runner_1 |
jobs-runner_1 | Error running database migrations: SequelizeUnknownConstraintError: Unknown constraint error

We are using an external postgres DB. A table retool_db_migrations exists, but is completely empty. No customizations have been made to our Retool installation.

How can this be fixed so we may upgrade to the latest 2.x legacy version?

Thanks for your support!

3 Likes

Hi @seibert-io! Welcome to the community. :slightly_smiling_face:

I'm able to see the details of the specific migration that seems to be failing, but nothing jumps out to me as being particularly suspicious. It expects there to be a constraint on the commits table called 'commits_branch_page_save_key'.

Can you query this table to see exactly what constraints currently exist? There are some guidelines here describing how to do this. Can you additionally check to see which extensions, if any, have been enabled for your database?

1 Like