liquibase.exception.DatabaseException: java.text.ParseException: Unknown bit value: 2

JIRA | Crystal | 4 years ago
  1. 0

    Reported via email: Using this statement to insert the binary data: {code} <insert tableName="webtools_file"> <column name="db_id" valueNumeric="275" /> <column name="db_created" /> <column name="db_updated" /> <column name="db_version" valueNumeric="1" /> <column name="content" valueBlobFile="icons/8f13b0edb57b156bf807f0e329afc76c.png" /> <column name="filesize" valueNumeric="5867" /> <column name="filename" value="8f13b0edb57b156bf807f0e329afc76c.png" /> <column name="hash" value="8f13b0edb57b156bf807f0e329afc76c" /> <column name="mimetype" value="image/png" /> </insert> {code} This works perfectly fine in Liquibase 3.2.3, but in Liquibase 3.3.x, I get this exception: {code} liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: No value specified for parameter 1. at liquibase.statement.ExecutablePreparedStatementBase.execute(ExecutablePreparedStatementBase.java:79) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:118) at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1227) at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1210) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:550) at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:43) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:73) at liquibase.Liquibase.update(Liquibase.java:200) at org.liquibase.maven.plugins.LiquibaseUpdate.doUpdate(LiquibaseUpdate.java:33) … Caused by: org.postgresql.util.PSQLException: No value specified for parameter 1. at org.postgresql.core.v3.SimpleParameterList.checkAllParametersSet(SimpleParameterList.java:228) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:245) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:570) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:420) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:413) at liquibase.statement.ExecutablePreparedStatementBase.execute(ExecutablePreparedStatementBase.java:77) {code}

    JIRA | 2 years ago | Nathan Voxland
    liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: No value specified for parameter 1.
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    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).

    JIRA | 3 years ago | Toby Cole
    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)
  4. 0

    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).

    JIRA | 3 years ago | Toby Cole
    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)

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. liquibase.exception.DatabaseException

      java.text.ParseException: Unknown bit value: 2

      at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.getColumnTypeAndDefValue()
    2. Liquibase Core
      JdbcDatabaseSnapshotGenerator.getColumnTypeAndDefValue
      1. liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.getColumnTypeAndDefValue(JdbcDatabaseSnapshotGenerator.java:404)
      1 frame