liquibase.exception.DatabaseException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • grails 3 database migrations
    via Stack Overflow by Michael.D
    ,
  • From http://stackoverflow.com/questions/33767681/should-liquibase-cope-with-concurrent-initialisation I'm running a Liquibase migration concurrently against a clean HSQLDB instance, and while one of the updates succeeds the other fails as so: Exception in thread "Thread-7" liquibase.exception.LockException: liquibase.exception.DatabaseException: object name already exists: DATABASECHANGELOGLOCK in statement [CREATE TABLE PUBLIC.DATABASECHANGELOGLOCK (ID INT NOT NULL, LOCKED BOOLEAN NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID))] [Failed SQL: CREATE TABLE PUBLIC.DATABASECHANGELOGLOCK (ID INT NOT NULL, LOCKED BOOLEAN NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID))] at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:216) at liquibase.lockservice.StandardLockService.waitForLock(StandardLockService.java:155) at liquibase.Liquibase.update(Liquibase.java:194) at liquibase.Liquibase.update(Liquibase.java:190) at liquibase.Liquibase.update(Liquibase.java:186) at liquibase.Liquibase.update(Liquibase.java:179) Caused by: liquibase.exception.DatabaseException: object name already exists: DATABASECHANGELOGLOCK in statement [CREATE TABLE PUBLIC.DATABASECHANGELOGLOCK (ID INT NOT NULL, LOCKED BOOLEAN NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID))] [Failed SQL: CREATE TABLE PUBLIC.DATABASECHANGELOGLOCK (ID INT NOT NULL, LOCKED BOOLEAN NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID))] at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:316) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:122) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:112) at liquibase.lockservice.StandardLockService.init(StandardLockService.java:87) at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:189)
    via by Nathan Voxland,
  • GitHub comment 1#200814582
    via GitHub by pascalgrimaud
    ,
  • The stacktrace bellow shows that the generated changelog contains an extra single quote, in front of the default column value: [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building liquibase 1.0.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ liquibase --- [INFO] Deleting C:\dev\UNIONVMS\branches\dev\Modules\Reporting\maven.1438864315428\DB\liquibase\target [INFO] [INFO] --- liquibase-maven-plugin:3.4.0:update (default-cli) @ liquibase --- [INFO] ------------------------------------------------------------------------ [INFO] Executing on Database: jdbc:postgresql://localhost:5432/uvms INFO 8/19/15 11:58 AM: liquibase: Successfully acquired change log lock INFO 8/19/15 11:58 AM: liquibase: Reading from reporting.databasechangelog SEVERE 8/19/15 11:58 AM: liquibase: changelog/db-changelog-master.xml: changelog/0.1/generatedChangelog.xml::1439888259729-7::georgige (generated): Change Set changelog/0.1/generatedChangelog.xml::14398882597 29-7::georgige (generated) failed. Error: ERROR: syntax error at or near "0" Position: 385 [Failed SQL: CREATE TABLE reporting.report (id BIGSERIAL NOT NULL, name VARCHAR(255) NOT NULL, description TEXT, filter_expression TEXT NOT NULL, out_components VARCHAR(255) NOT NULL, scope_id BIGINT NOT NULL, created_by VARCHAR(255) NOT NULL, created_on TIMESTAMP(29) WITHOUT TIME ZONE NOT NULL, deleted_on TIMESTAMP(29) WITHOUT TIME ZONE, deleted_by VARCHAR(255), is_deleted BPCHAR(1) DEFAULT ''0': :bpchar', is_shared BPCHAR(1) DEFAULT ''0'::bpchar' NOT NULL, CONSTRAINT report_pkey PRIMARY KEY (id))] liquibase.exception.DatabaseException: ERROR: syntax error at or near "0" Position: 385 [Failed SQL: CREATE TABLE reporting.report (id BIGSERIAL NOT NULL, name VARCHAR(255) NOT NULL, description TEXT, filter_expression TEXT NOT NULL, out_components VARCHAR(255) NOT NULL, scope_id BIGINT NOT NULL, created_by VARCHAR(255) NOT NULL, created_on TIMESTAMP(29) WITHOUT TIME ZONE NOT NULL, deleted_on TIMESTAMP(29) WITHOUT TIME ZONE, deleted_by VARCHAR(255), is_deleted BPCHAR(1) DEFAULT ''0': :bpchar', is_shared BPCHAR(1) DEFAULT ''0'::bpchar' NOT NULL, CONSTRAINT report_pkey PRIMARY KEY (id))] at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:316) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:122) at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1243) at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1226) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:548) at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51)
    via by Georgi Georgiev,
    • liquibase.exception.DatabaseException: ERROR: relation "appointment" already exists [Failed SQL: CREATE TABLE public.appointment (id BIGSERIAL NOT NULL, version BIGINT, customer_id BIGINT, duration BYTEA, note TEXT, personal_available BOOLEAN DEFAULT 0, personal_booked BOOLEAN DEFAULT 0, provider_id BIGINT, start_time BYTEA, url VARCHAR(255), CONSTRAINT "appointmentPK" PRIMARY KEY (id))] at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:316)

    Users with the same issue

    Malcshour
    13 times, last one,