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.

  • GitHub comment 1098#242354857
    via GitHub by jethan
    ,
  • question
    via GitHub by jethan
    ,
  • Liquibase primary key is created twice on H2
    via Stack Overflow by Newbie
    ,
  • When using SpringLiquibase, the file names used for the databasechangelog can get rather long as it can use resource paths within jar files, e.g. {code}jar:file:/Users/toby/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/com.project.name/WEB-INF/lib/some-library.jar!/database/scripts/00-project-database-liquibase.sql{code} When these paths exceed 200 characters, liquibase fails with the following stack trace: {code:java} liquibase.exception.DatabaseException: Error executing SQL INSERT INTO public.databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, LIQUIBASE) VALUES ('1', 'jason', 'jar:file:/Users/toby/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/com.semantico.journals.frontend/WEB-INF/lib/sipp2-locator-1.0-SNAPSHOT.jar!/database/scripts/00-locator-liquibase.sql', NOW(), 2, '7:b6b832985892bbec4f63b3e4ec0c949c', 'The ''sql'' tag allows you to specify whatever sql you want. It is useful for complex changes that aren''t supported through Liquibase''s automated refactoring tags and to work around bugs and limitations of Liquibase. The SQL contained in the sql tag...', '', 'EXECUTED', '3.0.0-SNP'): ERROR: value too long for type character varying(200) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:56) ~[liquibase-core-3.0.2.jar:na] at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:98) ~[liquibase-core-3.0.2.jar:na] at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:64) ~[liquibase-core-3.0.2.jar:na] at liquibase.database.AbstractJdbcDatabase.markChangeSetExecStatus(AbstractJdbcDatabase.java:1209) ~[liquibase-core-3.0.2.jar:na] at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:34) ~[liquibase-core-3.0.2.jar:na] at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:58) ~[liquibase-core-3.0.2.jar:na] at liquibase.Liquibase.update(Liquibase.java:135) ~[liquibase-core-3.0.2.jar:na] at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:285) ~[liquibase-core-3.0.2.jar:na] at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:258) ~[liquibase-core-3.0.2.jar:na] [… spring setup truncated] {code} Suggested fix: update filename to 400 characters (merge request on the way).
    via by Toby Cole,
  • Activiti Liquibase Issue
    via Stack Overflow by Sunita Nayak
    ,
  • When using SpringLiquibase, the file names used for the databasechangelog can get rather long as it can use resource paths within jar files, e.g. {code}jar:file:/Users/toby/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/com.project.name/WEB-INF/lib/some-library.jar!/database/scripts/00-project-database-liquibase.sql{code} When these paths exceed 200 characters, liquibase fails with the following stack trace: {code:java} liquibase.exception.DatabaseException: Error executing SQL INSERT INTO public.databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, LIQUIBASE) VALUES ('1', 'jason', 'jar:file:/Users/toby/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/com.semantico.journals.frontend/WEB-INF/lib/sipp2-locator-1.0-SNAPSHOT.jar!/database/scripts/00-locator-liquibase.sql', NOW(), 2, '7:b6b832985892bbec4f63b3e4ec0c949c', 'The ''sql'' tag allows you to specify whatever sql you want. It is useful for complex changes that aren''t supported through Liquibase''s automated refactoring tags and to work around bugs and limitations of Liquibase. The SQL contained in the sql tag...', '', 'EXECUTED', '3.0.0-SNP'): ERROR: value too long for type character varying(200) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:56) ~[liquibase-core-3.0.2.jar:na] at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:98) ~[liquibase-core-3.0.2.jar:na] at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:64) ~[liquibase-core-3.0.2.jar:na] at liquibase.database.AbstractJdbcDatabase.markChangeSetExecStatus(AbstractJdbcDatabase.java:1209) ~[liquibase-core-3.0.2.jar:na] at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:34) ~[liquibase-core-3.0.2.jar:na] at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:58) ~[liquibase-core-3.0.2.jar:na] at liquibase.Liquibase.update(Liquibase.java:135) ~[liquibase-core-3.0.2.jar:na] at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:285) ~[liquibase-core-3.0.2.jar:na] at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:258) ~[liquibase-core-3.0.2.jar:na] [… spring setup truncated] {code} Suggested fix: update filename to 400 characters (merge request on the way).
    via by Toby Cole,
    • liquibase.exception.DatabaseException: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause [Failed SQL: CREATE TABLE demo.jhi_user (id BIGINT AUTO_INCREMENT NOT NULL, login VARCHAR(50) NOT NULL, password_hash VARCHAR(60) NULL, first_name VARCHAR(50) NULL, last_name VARCHAR(50) NULL, email VARCHAR(100) NULL, activated BIT(1) NOT NULL, lang_key VARCHAR(5) NULL, activation_key VARCHAR(20) NULL, reset_key VARCHAR(20) NULL, created_by VARCHAR(50) NOT NULL, created_date timestamp DEFAULT NOW() NOT NULL, reset_date timestamp NULL, last_modified_by VARCHAR(50) NULL, last_modified_date timestamp DEFAULT NOW() NULL, CONSTRAINT PK_JHI_USER PRIMARY KEY (id), UNIQUE (email), UNIQUE (login))] at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:301) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:107) at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1251) at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1234) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:554) at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:73) at liquibase.Liquibase.update(Liquibase.java:212) at liquibase.Liquibase.update(Liquibase.java:192) at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:434) at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:391) at free.config.liquibase.AsyncSpringLiquibase.initDb(AsyncSpringLiquibase.java:66) at free.config.liquibase.AsyncSpringLiquibase.lambda$afterPropertiesSet$39(AsyncSpringLiquibase.java:49)

    Users with the same issue

    tvrmsmith
    2 times, last one,
    Malcshour
    26 times, last one,