liquibase.exception.DatabaseException: ERROR: relation "databasechangelog" already exists

I’m facing an issue after upgrading my project from Jmix 2.4.5 to Jmix 2.5.0.
When I start the application, Liquibase fails with the following error:

liquibase.exception.DatabaseException: ERROR: relation "databasechangelog" already exists

And the failed SQL statement is:

CREATE TABLE public.databasechangelog (
    ID VARCHAR(255) NOT NULL,
    AUTHOR VARCHAR(255) NOT NULL,
    FILENAME VARCHAR(255) NOT NULL,
    DATEEXECUTED TIMESTAMP WITHOUT TIME ZONE NOT NULL,
    ORDEREXECUTED INTEGER NOT NULL,
    EXECTYPE VARCHAR(10) NOT NULL,
    MD5SUM VARCHAR(35),
    DESCRIPTION VARCHAR(255),
    COMMENTS VARCHAR(255),
    TAG VARCHAR(255),
    LIQUIBASE VARCHAR(20),
    CONTEXTS VARCHAR(255),
    LABELS VARCHAR(255),
    DEPLOYMENT_ID VARCHAR(10)
)

It seems like Liquibase is trying to create the databasechangelog table even though it already exists in the database, which causes the startup process to fail.

Has anyone experienced this after upgrading to Jmix 2.5.0?
Any guidance on how to resolve this would be greatly appreciated.

Link of project

Hello,

  1. Did you do any operations related to database schemas or user before update?
  2. What search_path is in your database? Use SQL SHOW search_path; to display it.
  3. Check and confirm that your public schema contains all your tables including databasechangelog.
  4. Does your user has enough priviliges to access to public.databasechangelog? Try to manually select data from that table under that user.

Regards,
Ivan

For now it looks like the issue in PG driver (Liquibase fails to detect databasechangelog table and crashes with PostgreSQL JDBC driver 42.7.5 · Issue #6666 · liquibase/liquibase · GitHubhttps://github.com/pgjdbc/pgjdbc/pull/3390).
After explicit downgrade driver version from 42.7.5 to 42.7.4 it works fine.

But this issue is not reproduced consistently, need further investigation.

Regards,
Ivan

This might be a reason. I did try the project with MS-SQL and MariaDB which did not work either. If you want I can try again to be sure this project isn’t working with other databases too ?

Regards
Felix