liquibase.exception.MigrationFailedException: Migration failed for change set changelog/db-changelog-3.7.1.xml::3.7.1_mychangeset::mycorp: Reason: changelog/db-changelog-3.7.1.xml : liquibase.precondition.core.ColumnExistsPrecondition@252b6749 : Cannot snapshot offline database

JIRA | Rafael Chaves | 2 years ago
  1. 0

    Trying the support for offline SQL generation (implemented in CORE-883 and documented [here|http://www.liquibase.org/documentation/offline.html]). I have a change log with change sets that have preconditions (that access the DB) and are set as onSqlOutput="TEST". I am seeing quite erratic behavior. Any of the following may happen: # the changelog is processed and the expected SQL is generated (preconditions are not executed) # the changelog is processed with the preconditions deemed as unsatisfied (probably not actually executed) # the changelog processing fails due to the precondition being evaluated (stack trace below) The bare expectation is that it worked always the same way (note that the offline mode generates a csv file that if not deleted will affect the result of a following execution). In my tests I always delete the file. {code} SEVERE 12/12/14 15:51: liquibase: ...: liquibase.precondition.core.ColumnExistsPrecondition@252b6749 : Cannot snapshot offline database liquibase.exception.MigrationFailedException: Migration failed for change set changelog/db-changelog-3.7.1.xml::3.7.1_mychangeset::mycorp: Reason: changelog/db-changelog-3.7.1.xml : liquibase.precondition.core.ColumnE xistsPrecondition@252b6749 : Cannot snapshot offline database at liquibase.changelog.ChangeSet.execute(ChangeSet.java:482) at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:43 ) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:70) at liquibase.Liquibase.update(Liquibase.java:195) at liquibase.Liquibase.update(Liquibase.java:246) at liquibase.Liquibase.update(Liquibase.java:229) at liquibase.integration.commandline.Main.doMigration(Main.java:1006) at liquibase.integration.commandline.Main.run(Main.java:170) at liquibase.integration.commandline.Main.main(Main.java:89) Caused by: liquibase.exception.PreconditionErrorException: Precondition Error at liquibase.precondition.core.ColumnExistsPrecondition.check(ColumnExis tsPrecondition.java:81) at liquibase.precondition.core.NotPrecondition.check(NotPrecondition.jav a:38) at liquibase.precondition.core.AndPrecondition.check(AndPrecondition.jav a:43) at liquibase.precondition.core.AndPrecondition.check(AndPrecondition.jav a:43) at liquibase.precondition.core.PreconditionContainer.check(PreconditionC ontainer.java:201) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:439) ... 8 more Caused by: liquibase.exception.DatabaseException: Cannot snapshot offline databa se at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGe neratorFactory.java:124) at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGe neratorFactory.java:134) at liquibase.snapshot.SnapshotGeneratorFactory.has(SnapshotGeneratorFact ory.java:88) at liquibase.precondition.core.ColumnExistsPrecondition.check(ColumnExis tsPrecondition.java:77) ... 13 more Unexpected error running Liquibase: Precondition Error SEVERE 12/12/14 15:51: liquibase: changelog/db-changelog-3.7.1.xml::3.7.1_mychangeset::mycorp: Precondition Error liquibase.exception.MigrationFailedException: Migration failed for change set changelog/db-changelog-3.7.1.xml::3.7.1_mychangeset::mycorp: Reason: changelog/db-changelog-3.7.1.xml : liquibase.precondition.core.ColumnExistsPrecondition@252b6749 : Cannot snapshot offline database at liquibase.changelog.ChangeSet.execute(ChangeSet.java:482) at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:43) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:70) at liquibase.Liquibase.update(Liquibase.java:195) at liquibase.Liquibase.update(Liquibase.java:246) at liquibase.Liquibase.update(Liquibase.java:229) at liquibase.integration.commandline.Main.doMigration(Main.java:1006) at liquibase.integration.commandline.Main.run(Main.java:170) at liquibase.integration.commandline.Main.main(Main.java:89) Caused by: liquibase.exception.PreconditionErrorException: Precondition Error at liquibase.precondition.core.ColumnExistsPrecondition.check(ColumnExis tsPrecondition.java:81) at liquibase.precondition.core.NotPrecondition.check(NotPrecondition.jav a:38) at liquibase.precondition.core.AndPrecondition.check(AndPrecondition.jav a:43) at liquibase.precondition.core.AndPrecondition.check(AndPrecondition.jav a:43) at liquibase.precondition.core.PreconditionContainer.check(PreconditionC ontainer.java:201) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:439) ... 8 more Caused by: liquibase.exception.DatabaseException: Cannot snapshot offline database at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:124) at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:134) at liquibase.snapshot.SnapshotGeneratorFactory.has(SnapshotGeneratorFactory.java:88) at liquibase.precondition.core.ColumnExistsPrecondition.check(ColumnExis tsPrecondition.java:77) ... 13 more {code}

    JIRA | 2 years ago | Rafael Chaves
    liquibase.exception.MigrationFailedException: Migration failed for change set changelog/db-changelog-3.7.1.xml::3.7.1_mychangeset::mycorp: Reason: changelog/db-changelog-3.7.1.xml : liquibase.precondition.core.ColumnExistsPrecondition@252b6749 : Cannot snapshot offline database
  2. 0

    Not null sqlCheck in Liquibase precondition

    Stack Overflow | 2 years ago | Grzegorz Olszewski
    liquibase.exception.MigrationFailedException: Migration failed for change set /tmp/test.changeset.xml::4::test: Reason: /tmp/test.changeset.xml : No rows returned from SQL Precondition
  3. 0

    From http://liquibase.org/forum/index.php?topic=221.0 Hello, I would like to signal a kind of "exception swallowing". I was testing LiquiBase Version: 2.0-rc2-SNAPSHOT against a test HSQL database whith the last snaphot jar of HSQLDB 1.9 released on 1 Nov (after RC6). I was running the command "liquibase --logLevel=debug --changeLogFile=update.xml update" whith my changelongs including this xml: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9 http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd"> <changeSet author="jsmith" id="1" runOnChange="true"> <preConditions onFail="MARK_RAN"> <viewExists viewName="departments_vw"/> </preConditions> <dropView viewName="departments_vw"/> </changeSet> <changeSet author="jsmith" id="2" runOnChange="true"> <createView viewName="departments_vw"> select id, dname from departments </createView> </changeSet> </databaseChangeLog> and I had this error: INFO 12/11/09 22.55:liquibase: Reading from DATABASECHANGELOG DEBUG 12/11/09 22.55:liquibase: Running Changeset:latest/vw/departments_vw.xml::1::jsmith::(Checksum: 2:d47fa6915fc3c813b6a0b666cdcb2601) DEBUG 12/11/09 22.55:liquibase: Changeset latest/vw/departments_vw.xml::1::jsmith::(Checksum: 2:d47fa6915fc3c813b6a0b666cdcb2601) DEBUG 12/11/09 22.55:liquibase: Release Database Lock INFO 12/11/09 22.55:liquibase: Successfully released change log lock LiquiBase Update Failed: Precondition Error INFO 12/11/09 22.55:liquibase: Precondition Error liquibase.exception.MigrationFailedException: Migration failed for change set latest/vw/departments_vw.xml::1::jsmith: Reason: update.xml : Error getting jdbc:hsqldb:hsql://localhost/testdb view with liquibase.statement.core.GetViewDefinitionStatement@a00185 : Caused By: Precondition Error at liquibase.changelog.ChangeSet.execute(ChangeSet.java:197) at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:26) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:39) at liquibase.Liquibase.update(Liquibase.java:103) at liquibase.integration.commandline.Main.doMigration(Main.java:664) at liquibase.integration.commandline.Main.main(Main.java:105) Caused by: liquibase.exception.PreconditionErrorException: Precondition Error at liquibase.precondition.core.ViewExistsPrecondition.check(ViewExistsPrecondition.java:39) at liquibase.precondition.core.AndPrecondition.check(AndPrecondition.java:24) at liquibase.precondition.core.PreconditionContainer.check(PreconditionContainer.java:199) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:163) ... 5 more Now, the problem it's not the error by itself, but the fact that I had no way to understand the real cause of the error! I debugged the application and here's what I discovered: the original DatabaseException is caught in class HsqlDatabaseSnapshotGenerator(JdbcDatabaseSnapshotGenerator).readView(ResultSet, Database) line: 146: in this fragment of code: try { view.setDefinition(database.getViewDefinition(rs.getString("TABLE_SCHEM"), name)); } catch (DatabaseException e) { throw new DatabaseException("Error getting " + database.getConnection().getURL() + " view with " + new GetViewDefinitionStatement(view.getSchema(), name), e); } and is generated in this fragment of code (in JdbcExecutor.execute(StatementCallback, List<SqlVisitor>) line: 58) public Object execute(StatementCallback action, List<SqlVisitor> sqlVisitors) throws DatabaseException { DatabaseConnection con = database.getConnection(); Statement stmt = null; try { stmt = ((JdbcConnection) con).getUnderlyingConnection().createStatement(); Statement stmtToUse = stmt; return action.doInStatement(stmtToUse); } catch (SQLException ex) { // Release Connection early, to avoid potential connection pool deadlock // in the case when the exception translator hasn't been initialized yet. JdbcUtils.closeStatement(stmt); stmt = null; throw new DatabaseException("Error executing SQL " + StringUtils.join(applyVisitors(action.getStatement(), sqlVisitors), ", "), ex); } finally { JdbcUtils.closeStatement(stmt); } } reached with the following stack: JdbcExecutor.execute(StatementCallback, List<SqlVisitor>) line: 58 JdbcExecutor.query(SqlStatement, ResultSetExtractor, List<SqlVisitor>) line: 124 JdbcExecutor.query(SqlStatement, RowMapper, List<SqlVisitor>) line: 132 JdbcExecutor.queryForObject(SqlStatement, RowMapper, List<SqlVisitor>) line: 140 JdbcExecutor.queryForObject(SqlStatement, Class, List<SqlVisitor>) line: 149 JdbcExecutor.queryForObject(SqlStatement, Class) line: 145 HsqlDatabase(AbstractDatabase).getViewDefinition(String, String) line: 608 HsqlDatabaseSnapshotGenerator(JdbcDatabaseSnapshotGenerator).readView(ResultSet, Database) line: 146 HsqlDatabaseSnapshotGenerator(JdbcDatabaseSnapshotGenerator).readViews(DatabaseSnapshot, String, DatabaseMetaData) line: 263 HsqlDatabaseSnapshotGenerator(JdbcDatabaseSnapshotGenerator).createSnapshot(Database, String, Set<DiffStatusListener>) line: 203 DatabaseSnapshotGeneratorFactory.createSnapshot(Database, String, Set<DiffStatusListener>) line: 69 ViewExistsPrecondition.check(Database, DatabaseChangeLog, ChangeSet) line: 37 PreconditionContainer(AndPrecondition).check(Database, DatabaseChangeLog, ChangeSet) line: 24 PreconditionContainer.check(Database, DatabaseChangeLog, ChangeSet) line: 199 ChangeSet.execute(DatabaseChangeLog, Database) line: 163 UpdateVisitor.visit(ChangeSet, DatabaseChangeLog, Database) line: 26 ChangeLogIterator.run(ChangeSetVisitor, Database) line: 39 Liquibase.update(String) line: 103 Main.doMigration() line: 664 Main.main(String[]) line: 105 The variable ex in the code above contains the real problem: java.sql.SQLException: user lacks privilege or object not found: SYSTEM_VIEWS and the message of the DatabaseException being thrown further clarify the problem: Error executing SQL SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.SYSTEM_VIEWS WHERE TABLE_NAME = 'DEPARTMENTS_VW' AND TABLE_SCHEMA='PUBLIC' What appens at the end, unfortunately, is that neither of the messages is reported in the output of the program: conversely, the message reported: Error getting jdbc:hsqldb:hsql://localhost/testdb view with liquibase.statement.core.GetViewDefinitionStatement@a00185 is quite "enigmatic". I've see that the DatabaseException is wrapped by a ErrorPrecondition and futher by a PrecoditionErrorException (ViewExistsPrecondition.check(Database, DatabaseChangeLog, ChangeSet) line: 39): when the output message is built, the following fragment of code is executed (PreconditionContainer.check(Database, DatabaseChangeLog, ChangeSet) line: 227 ): catch (PreconditionErrorException e) { StringBuffer message = new StringBuffer(); message.append(" ").append(e.getErrorPreconditions().size()).append(" preconditions failed").append(StreamUtil.getLineSeparator()); for (ErrorPrecondition invalid : e.getErrorPreconditions()) { message.append(" ").append(invalid.toString()); message.append(StreamUtil.getLineSeparator()); } here is invoked the method toString on the istance of the class ErrorPrecondition: this method does not print the real cause. Here is an extract of my debugging environment (eclipse) where you may find the variables and some of their internal values, in particular I've found here the real "cause"(s) of the problem that aren't reported in the program output. invalid ErrorPrecondition (id=1756) cause DatabaseException (id=1764) cause DatabaseException (id=1744) cause SQLException (id=1725) cause null detailMessage "user lacks privilege or object not found: SYSTEM_VIEWS" (id=1729) detailMessage "Error executing SQL SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.SYSTEM_VIEWS WHERE TABLE_NAME = 'DEPARTMENTS_VW' AND TABLE_SCHEMA='PUBLIC'" (id=1745) detailMessage "Error getting jdbc:hsqldb:hsql://localhost/testdb view with liquibase.statement.core.GetViewDefinitionStatement@593f5a2f" (id=1774) stackTrace null changeLog DatabaseChangeLog (id=1752) precondition ViewExistsPrecondition (id=45) by the way: I don't know why in HSQL 1.9 (snapshot) the object INFORMATION_SCHEMA.SYSTEM_VIEWS does'nt exists anymore: instead exists the object INFORMATION_SCHEMA.VIEWS... Regards, Duccio

    JIRA | 7 years ago | Nathan Voxland
    liquibase.exception.MigrationFailedException: Migration failed for change set latest/vw/departments_vw.xml::1::jsmith: Reason: update.xml : Error getting jdbc:hsqldb:hsql://localhost/testdb view with liquibase.statement.core.GetViewDefinitionStatement@a00185 : Caused By: Precondition Error
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Trying the support for offline SQL generation (implemented in CORE-883 and documented [here|http://www.liquibase.org/documentation/offline.html]). I have a change log with change sets that have preconditions (that access the DB) and are set as onSqlOutput="TEST". I am seeing quite erratic behavior. Any of the following may happen: # the changelog is processed and the expected SQL is generated (preconditions are not executed) # the changelog is processed with the preconditions deemed as unsatisfied (probably not actually executed) # the changelog processing fails due to the precondition being evaluated (stack trace below) The bare expectation is that it worked always the same way (note that the offline mode generates a csv file that if not deleted will affect the result of a following execution). In my tests I always delete the file. {code} SEVERE 12/12/14 15:51: liquibase: ...: liquibase.precondition.core.ColumnExistsPrecondition@252b6749 : Cannot snapshot offline database liquibase.exception.MigrationFailedException: Migration failed for change set changelog/db-changelog-3.7.1.xml::3.7.1_mychangeset::mycorp: Reason: changelog/db-changelog-3.7.1.xml : liquibase.precondition.core.ColumnE xistsPrecondition@252b6749 : Cannot snapshot offline database at liquibase.changelog.ChangeSet.execute(ChangeSet.java:482) at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:43 ) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:70) at liquibase.Liquibase.update(Liquibase.java:195) at liquibase.Liquibase.update(Liquibase.java:246) at liquibase.Liquibase.update(Liquibase.java:229) at liquibase.integration.commandline.Main.doMigration(Main.java:1006) at liquibase.integration.commandline.Main.run(Main.java:170) at liquibase.integration.commandline.Main.main(Main.java:89) Caused by: liquibase.exception.PreconditionErrorException: Precondition Error at liquibase.precondition.core.ColumnExistsPrecondition.check(ColumnExis tsPrecondition.java:81) at liquibase.precondition.core.NotPrecondition.check(NotPrecondition.jav a:38) at liquibase.precondition.core.AndPrecondition.check(AndPrecondition.jav a:43) at liquibase.precondition.core.AndPrecondition.check(AndPrecondition.jav a:43) at liquibase.precondition.core.PreconditionContainer.check(PreconditionC ontainer.java:201) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:439) ... 8 more Caused by: liquibase.exception.DatabaseException: Cannot snapshot offline databa se at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGe neratorFactory.java:124) at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGe neratorFactory.java:134) at liquibase.snapshot.SnapshotGeneratorFactory.has(SnapshotGeneratorFact ory.java:88) at liquibase.precondition.core.ColumnExistsPrecondition.check(ColumnExis tsPrecondition.java:77) ... 13 more Unexpected error running Liquibase: Precondition Error SEVERE 12/12/14 15:51: liquibase: changelog/db-changelog-3.7.1.xml::3.7.1_mychangeset::mycorp: Precondition Error liquibase.exception.MigrationFailedException: Migration failed for change set changelog/db-changelog-3.7.1.xml::3.7.1_mychangeset::mycorp: Reason: changelog/db-changelog-3.7.1.xml : liquibase.precondition.core.ColumnExistsPrecondition@252b6749 : Cannot snapshot offline database at liquibase.changelog.ChangeSet.execute(ChangeSet.java:482) at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:43) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:70) at liquibase.Liquibase.update(Liquibase.java:195) at liquibase.Liquibase.update(Liquibase.java:246) at liquibase.Liquibase.update(Liquibase.java:229) at liquibase.integration.commandline.Main.doMigration(Main.java:1006) at liquibase.integration.commandline.Main.run(Main.java:170) at liquibase.integration.commandline.Main.main(Main.java:89) Caused by: liquibase.exception.PreconditionErrorException: Precondition Error at liquibase.precondition.core.ColumnExistsPrecondition.check(ColumnExis tsPrecondition.java:81) at liquibase.precondition.core.NotPrecondition.check(NotPrecondition.jav a:38) at liquibase.precondition.core.AndPrecondition.check(AndPrecondition.jav a:43) at liquibase.precondition.core.AndPrecondition.check(AndPrecondition.jav a:43) at liquibase.precondition.core.PreconditionContainer.check(PreconditionC ontainer.java:201) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:439) ... 8 more Caused by: liquibase.exception.DatabaseException: Cannot snapshot offline database at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:124) at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:134) at liquibase.snapshot.SnapshotGeneratorFactory.has(SnapshotGeneratorFactory.java:88) at liquibase.precondition.core.ColumnExistsPrecondition.check(ColumnExis tsPrecondition.java:77) ... 13 more {code}

    JIRA | 2 years ago | Rafael Chaves
    liquibase.exception.MigrationFailedException: Migration failed for change set changelog/db-changelog-3.7.1.xml::3.7.1_mychangeset::mycorp: Reason: changelog/db-changelog-3.7.1.xml : liquibase.precondition.core.ColumnE xistsPrecondition@252b6749 : Cannot snapshot offline database
  6. 0

    we upgraded from 2.0.5 to 3.4.2 Liquibase last week and the below changeset is working fine with 2.0.5. I see a similar error documented for previous releases in a JIRA ticket(CORE-2198). I have a change set that verifies if an Oracle view exists in a schema(DYNCT1) and drop it if it exists. I log in as my "liquibase" user which defaults to the "system" schema. To reproduce the problem, I have the following change set that generates an error: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd"> <property name="changeSetType" value="DDL"/> <changeSet author="AAAA.AAAAA" id="1614" failOnError="true"> <preConditions onFail="MARK_RAN"> <viewExists schemaName="DYNCT1" viewName="SKU" /> </preConditions> <comment>[OPT-1257] Drop View</comment> <dropView schemaName="DYNCT1" viewName="V_A" /> <rollback> CREATE VIEW "DYNCT1"."V_A" ("SKU_ID", "PROMO_ID", "BONUS_ITEM_SKU") AS SELECT DISTINCT SKU.SKU_ID, SKU.PROMO_ID, SKU.BONUS_ITEM_SKU FROM DYNCT1.A SKU; GRANT SELECT ON dynct1.V_A TO dyncat_objsel_role; </rollback> </changeSet> </databaseChangeLog> The changeset is failing with the below error. Reason: [java] src/main/resources/changeLog.xml : liquibase.precondition.core.ViewExistsPrecondition@59d4cd39 : Empty result set, expected one row [java] [java] liquibase.exception.MigrationFailedException: Migration failed for change set releases/1614/atg/dynct1/drop_view_v_a.xml::1614::venkatrama.kamaraj: [java] Reason: [java] src/main/resources/changeLog.xml : liquibase.precondition.core.ViewExistsPrecondition@59d4cd39 : Empty result set, expected one row [java] [java] at liquibase.changelog.ChangeSet.execute(ChangeSet.java:513) [java] at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51) [java] at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:73) [java] at liquibase.Liquibase.update(Liquibase.java:212) [java] at liquibase.Liquibase.update(Liquibase.java:192) [java] at liquibase.Liquibase.update(Liquibase.java:327) [java] at liquibase.Liquibase.updateTestingRollback(Liquibase.java:1069) [java] at liquibase.Liquibase.updateTestingRollback(Liquibase.java:1061) [java] at liquibase.integration.commandline.Main.doMigration(Main.java:1167) [java] at liquibase.integration.commandline.Main.run(Main.java:180) [java] at liquibase.integration.commandline.Main.main(Main.java:99) [java] Caused by: liquibase.exception.PreconditionErrorException: Precondition Error [java] at liquibase.precondition.core.ViewExistsPrecondition.check(ViewExistsPrecondition.java:66) [java] at liquibase.precondition.core.AndPrecondition.check(AndPrecondition.java:43) [java] at liquibase.precondition.core.PreconditionContainer.check(PreconditionContainer.java:202) [java] at liquibase.changelog.ChangeSet.execute(ChangeSet.java:470) [java] ... 10 more [java] Caused by: liquibase.exception.DatabaseException: Error getting jdbc:oracle:thin:@localhost:1541:OV1ATG view with liquibase.statement.core.GetViewDefinitionStatement@421e361 [java] at liquibase.snapshot.jvm.ViewSnapshotGenerator.snapshotObject(ViewSnapshotGenerator.java:100) [java] at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:60) [java] at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50) [java] at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:63) [java] at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50) [java] at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:194) [java] at liquibase.snapshot.DatabaseSnapshot.init(DatabaseSnapshot.java:70) [java] at liquibase.snapshot.DatabaseSnapshot.<init>(DatabaseSnapshot.java:44) [java] at liquibase.snapshot.JdbcDatabaseSnapshot.<init>(JdbcDatabaseSnapshot.java:21) [java] at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:150) [java] at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:158) [java] at liquibase.snapshot.SnapshotGeneratorFactory.has(SnapshotGeneratorFactory.java:108) [java] at liquibase.precondition.core.ViewExistsPrecondition.check(ViewExistsPrecondition.java:60) [java] ... 13 more [java] Caused by: liquibase.exception.DatabaseException: Expected single row from liquibase.statement.core.GetViewDefinitionStatement@658c5a19 but got 0 [java] at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:140) [java] at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:151) [java] at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:146) [java] at liquibase.database.AbstractJdbcDatabase.getViewDefinition(AbstractJdbcDatabase.java:867) [java] at liquibase.snapshot.jvm.ViewSnapshotGenerator.snapshotObject(ViewSnapshotGenerator.java:75) [java] ... 25 more [java] Caused by: liquibase.exception.DatabaseException: Empty result set, expected one row [java] at liquibase.util.JdbcUtils.requiredSingleResult(JdbcUtils.java:141) [java] at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:138) [java] ... 29 more

    JIRA | 9 months ago | Bhvani Prasad Atluri
    liquibase.exception.MigrationFailedException: Migration failed for change set releases/1614/atg/dynct1/drop_view_v_a.xml::1614::venkatrama.kamaraj: Reason: src/main/resources/changeLog.xml : liquibase.precondition.core.ViewExistsPrecondition@59d4cd39 : Empty result set, expected one row

    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

      Cannot snapshot offline database

      at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot()
    2. Liquibase Core
      Main.main
      1. liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:124)
      2. liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:134)
      3. liquibase.snapshot.SnapshotGeneratorFactory.has(SnapshotGeneratorFactory.java:88)
      4. liquibase.precondition.core.ColumnExistsPrecondition.check(ColumnExistsPrecondition.java:77)
      5. liquibase.precondition.core.NotPrecondition.check(NotPrecondition.java:38)
      6. liquibase.precondition.core.AndPrecondition.check(AndPrecondition.java:43)
      7. liquibase.precondition.core.AndPrecondition.check(AndPrecondition.java:43)
      8. liquibase.precondition.core.PreconditionContainer.check(PreconditionContainer.java:201)
      9. liquibase.changelog.ChangeSet.execute(ChangeSet.java:439)
      10. liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:43)
      11. liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:70)
      12. liquibase.Liquibase.update(Liquibase.java:195)
      13. liquibase.Liquibase.update(Liquibase.java:246)
      14. liquibase.Liquibase.update(Liquibase.java:229)
      15. liquibase.integration.commandline.Main.doMigration(Main.java:1006)
      16. liquibase.integration.commandline.Main.run(Main.java:170)
      17. liquibase.integration.commandline.Main.main(Main.java:89)
      17 frames