Hi there, I have a problem running maven plugin org.liquibase:liquibase-maven-plugin:3.9.0 with Spring. I have a changelog file include all files from folder. When i start liquibase with this changeset - all things go perfect.
Liquibase Version: 3.10.1
Running Java under C:\Program Files\Java\jdk-11.0.7 (Version 11.0.7)
Driver: postgresql-42.2.11.jar
When i run the same changelog with maven with defined profiles in pom.xml with command
mvn liquibase:update -Pdev
i have an error:
“Execution default-cli of goal org.liquibase:liquibase-maven-plugin:3.9.0:update failed: liquibase.exception.DatabaseException: Error executing SQL SELECT MAX(ORDEREXECUTED) FROM databasechangelog: ERROR: relation “databasechangelog” does not exist”
Could some give me a some idea what could be a problem?
Hi @ronak!
Yes, the same database with the same user.
The first changeset is executed. After it’s execution I have the messages:
SELECT MAX(ORDEREXECUTED) FROM databasechangelog
[INFO] Successfully released change log lock
[ERROR] Could not release lock
liquibase.exception.LockException: liquibase.exception.DatabaseException: Error executing SQL UPDATE databasechangeloglock SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1: ERROR: relation “databasechangeloglock” does not exist
I’ve checked in the database. The table “databasechangeloglock” is created. I think It couldn’t continue because the state in databasechangeloglock table column “locked” is true. The table databasechangelog is empty. It is not indicated that the first changeset is executed.
Hmm…it is true if there is a row in the databasechangeloglock table, then it indicates there is a lock. Perhaps the process got destroyed before liquibase could finish?
Have you tried deleting the row in databasechangeloglock table (leaving it empty) and running the liquibase update (via maven) again after that?
I’m experiencing the same behavior as @ned but on a completely fresh postgres db instance:
[INFO] ChangeSet liquibase/main.xml::1::smstromb ran successfully in 1828ms
[INFO] SELECT MAX(ORDEREXECUTED) FROM databasechangelog
[INFO] Successfully released change log lock
[ERROR] Could not release lock
liquibase.exception.LockException: liquibase.exception.DatabaseException: Error executing SQL UPDATE databasechangeloglock SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1: ERROR: relation “databasechangeloglock” does not exist
The databasechangeloglock and databasechangelog tables are created and the changset specified in the changelog is executed correctly, but it fails to find “databasechangeloglock” when attempting to remove the lock that it itself created. “databasechangelog” remains empty.
Running “UPDATE databasechangeloglock SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;” manually via psql does not return ERROR: relation “databasechangeloglock” does not exist.
Hi @ronak !
My local system is Windows 10. Yes I created in src/main/resources folder liquibase. Add liquibase-dev.properties. Define profiles in pom.xml. liquibase.properties points to my local postgres database.
Use connector.changelog.xml in which I included two changelog’s.
Postgres Version 12
Liquibase Version: 3.10.1
Driver: postgresql-42.2.11.jar