liquibase.exception.DatabaseException: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: Error getting jdbc:mysql://10.5.210.245:3306/domus_migracion view with liquibase.statement.core.GetViewDefinitionStatement@6debbf97

JIRA | Nicolás Orbes | 2 years ago
  1. 0

    We are trying to use some JUnit test for our application... everything goes fine when we start with an empty database and we only run the create sentences, but when we try to run the case more than once and use the dropAll method the following error appears: INFO 8/11/14 12:11 PM: liquibase: Successfully released change log lock liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: Error getting jdbc:mysql://10.5.210.245:3306/domus_migracion view with liquibase.statement.core.GetViewDefinitionStatement@6debbf97 liquibase.exception.DatabaseException: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: Error getting jdbc:mysql://10.5.210.245:3306/domus_migracion view with liquibase.statement.core.GetViewDefinitionStatement@6debbf97 at liquibase.Liquibase.dropAll(Liquibase.java:676) at liquibase.Liquibase.dropAll(Liquibase.java:658) at com.accsa.domus.business.db.Update.blank(Update.java:85) at com.accsa.domus.business.db.Update.main(Update.java:95) Caused by: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: Error getting jdbc:mysql://10.5.210.245:3306/domus_migracion view with liquibase.statement.core.GetViewDefinitionStatement@6debbf97 at liquibase.database.AbstractJdbcDatabase.dropDatabaseObjects(AbstractJdbcDatabase.java:732) at liquibase.Liquibase.dropAll(Liquibase.java:671) ... 3 more Caused by: liquibase.exception.DatabaseException: Error getting jdbc:mysql://10.5.210.245:3306/domus_migracion view with liquibase.statement.core.GetViewDefinitionStatement@6debbf97 at liquibase.snapshot.jvm.ViewSnapshotGenerator.snapshotObject(ViewSnapshotGenerator.java:77) at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:59) at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50) at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:62) at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50) at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:153) at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:226) at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:248) at liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnapshot.java:185) at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:167) at liquibase.snapshot.DatabaseSnapshot.init(DatabaseSnapshot.java:56) at liquibase.snapshot.DatabaseSnapshot.<init>(DatabaseSnapshot.java:33) at liquibase.snapshot.JdbcDatabaseSnapshot.<init>(JdbcDatabaseSnapshot.java:22) at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:126) at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:119) at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:107) at liquibase.database.AbstractJdbcDatabase.dropDatabaseObjects(AbstractJdbcDatabase.java:729) ... 4 more Caused by: liquibase.exception.DatabaseException: Empty result set, expected one row at liquibase.util.JdbcUtils.requiredSingleResult(JdbcUtils.java:141) at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:152) at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:162) at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:157) at liquibase.database.AbstractJdbcDatabase.getViewDefinition(AbstractJdbcDatabase.java:855) at liquibase.snapshot.jvm.ViewSnapshotGenerator.snapshotObject(ViewSnapshotGenerator.java:75) ... 20 more Exception in thread "main" liquibase.exception.DatabaseException: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: Error getting jdbc:mysql://10.5.210.245:3306/domus_migracion view with liquibase.statement.core.GetViewDefinitionStatement@6debbf97 at liquibase.Liquibase.dropAll(Liquibase.java:676) at liquibase.Liquibase.dropAll(Liquibase.java:658) at com.accsa.domus.business.db.Update.blank(Update.java:85) at com.accsa.domus.business.db.Update.main(Update.java:95) Caused by: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: Error getting jdbc:mysql://10.5.210.245:3306/domus_migracion view with liquibase.statement.core.GetViewDefinitionStatement@6debbf97 at liquibase.database.AbstractJdbcDatabase.dropDatabaseObjects(AbstractJdbcDatabase.java:732) at liquibase.Liquibase.dropAll(Liquibase.java:671) ... 3 more Caused by: liquibase.exception.DatabaseException: Error getting jdbc:mysql://10.5.210.245:3306/domus_migracion view with liquibase.statement.core.GetViewDefinitionStatement@6debbf97 at liquibase.snapshot.jvm.ViewSnapshotGenerator.snapshotObject(ViewSnapshotGenerator.java:77) at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:59) at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50) at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:62) at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50) at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:153) at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:226) at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:248) at liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnapshot.java:185) at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:167) at liquibase.snapshot.DatabaseSnapshot.init(DatabaseSnapshot.java:56) at liquibase.snapshot.DatabaseSnapshot.<init>(DatabaseSnapshot.java:33) at liquibase.snapshot.JdbcDatabaseSnapshot.<init>(JdbcDatabaseSnapshot.java:22) at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:126) at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:119) at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:107) at liquibase.database.AbstractJdbcDatabase.dropDatabaseObjects(AbstractJdbcDatabase.java:729) ... 4 more Caused by: liquibase.exception.DatabaseException: Empty result set, expected one row at liquibase.util.JdbcUtils.requiredSingleResult(JdbcUtils.java:141) at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:152) at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:162) at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:157) at liquibase.database.AbstractJdbcDatabase.getViewDefinition(AbstractJdbcDatabase.java:855) at liquibase.snapshot.jvm.ViewSnapshotGenerator.snapshotObject(ViewSnapshotGenerator.java:75) ... 20 more There are several issues similar to these over internet, but after following all the recommendations we couldn't find a solution. The database has no views, but debugging de code we saw that some view methods are called using tables as parameters. Any help would be great!

    JIRA | 2 years ago | Nicolás Orbes
    liquibase.exception.DatabaseException: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: Error getting jdbc:mysql://10.5.210.245:3306/domus_migracion view with liquibase.statement.core.GetViewDefinitionStatement@6debbf97
  2. 0

    We are trying to use some JUnit test for our application... everything goes fine when we start with an empty database and we only run the create sentences, but when we try to run the case more than once and use the dropAll method the following error appears: INFO 8/11/14 12:11 PM: liquibase: Successfully released change log lock liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: Error getting jdbc:mysql://10.5.210.245:3306/domus_migracion view with liquibase.statement.core.GetViewDefinitionStatement@6debbf97 liquibase.exception.DatabaseException: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: Error getting jdbc:mysql://10.5.210.245:3306/domus_migracion view with liquibase.statement.core.GetViewDefinitionStatement@6debbf97 at liquibase.Liquibase.dropAll(Liquibase.java:676) at liquibase.Liquibase.dropAll(Liquibase.java:658) at com.accsa.domus.business.db.Update.blank(Update.java:85) at com.accsa.domus.business.db.Update.main(Update.java:95) Caused by: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: Error getting jdbc:mysql://10.5.210.245:3306/domus_migracion view with liquibase.statement.core.GetViewDefinitionStatement@6debbf97 at liquibase.database.AbstractJdbcDatabase.dropDatabaseObjects(AbstractJdbcDatabase.java:732) at liquibase.Liquibase.dropAll(Liquibase.java:671) ... 3 more Caused by: liquibase.exception.DatabaseException: Error getting jdbc:mysql://10.5.210.245:3306/domus_migracion view with liquibase.statement.core.GetViewDefinitionStatement@6debbf97 at liquibase.snapshot.jvm.ViewSnapshotGenerator.snapshotObject(ViewSnapshotGenerator.java:77) at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:59) at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50) at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:62) at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50) at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:153) at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:226) at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:248) at liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnapshot.java:185) at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:167) at liquibase.snapshot.DatabaseSnapshot.init(DatabaseSnapshot.java:56) at liquibase.snapshot.DatabaseSnapshot.<init>(DatabaseSnapshot.java:33) at liquibase.snapshot.JdbcDatabaseSnapshot.<init>(JdbcDatabaseSnapshot.java:22) at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:126) at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:119) at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:107) at liquibase.database.AbstractJdbcDatabase.dropDatabaseObjects(AbstractJdbcDatabase.java:729) ... 4 more Caused by: liquibase.exception.DatabaseException: Empty result set, expected one row at liquibase.util.JdbcUtils.requiredSingleResult(JdbcUtils.java:141) at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:152) at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:162) at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:157) at liquibase.database.AbstractJdbcDatabase.getViewDefinition(AbstractJdbcDatabase.java:855) at liquibase.snapshot.jvm.ViewSnapshotGenerator.snapshotObject(ViewSnapshotGenerator.java:75) ... 20 more Exception in thread "main" liquibase.exception.DatabaseException: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: Error getting jdbc:mysql://10.5.210.245:3306/domus_migracion view with liquibase.statement.core.GetViewDefinitionStatement@6debbf97 at liquibase.Liquibase.dropAll(Liquibase.java:676) at liquibase.Liquibase.dropAll(Liquibase.java:658) at com.accsa.domus.business.db.Update.blank(Update.java:85) at com.accsa.domus.business.db.Update.main(Update.java:95) Caused by: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: Error getting jdbc:mysql://10.5.210.245:3306/domus_migracion view with liquibase.statement.core.GetViewDefinitionStatement@6debbf97 at liquibase.database.AbstractJdbcDatabase.dropDatabaseObjects(AbstractJdbcDatabase.java:732) at liquibase.Liquibase.dropAll(Liquibase.java:671) ... 3 more Caused by: liquibase.exception.DatabaseException: Error getting jdbc:mysql://10.5.210.245:3306/domus_migracion view with liquibase.statement.core.GetViewDefinitionStatement@6debbf97 at liquibase.snapshot.jvm.ViewSnapshotGenerator.snapshotObject(ViewSnapshotGenerator.java:77) at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:59) at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50) at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:62) at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50) at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:153) at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:226) at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:248) at liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnapshot.java:185) at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:167) at liquibase.snapshot.DatabaseSnapshot.init(DatabaseSnapshot.java:56) at liquibase.snapshot.DatabaseSnapshot.<init>(DatabaseSnapshot.java:33) at liquibase.snapshot.JdbcDatabaseSnapshot.<init>(JdbcDatabaseSnapshot.java:22) at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:126) at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:119) at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:107) at liquibase.database.AbstractJdbcDatabase.dropDatabaseObjects(AbstractJdbcDatabase.java:729) ... 4 more Caused by: liquibase.exception.DatabaseException: Empty result set, expected one row at liquibase.util.JdbcUtils.requiredSingleResult(JdbcUtils.java:141) at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:152) at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:162) at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:157) at liquibase.database.AbstractJdbcDatabase.getViewDefinition(AbstractJdbcDatabase.java:855) at liquibase.snapshot.jvm.ViewSnapshotGenerator.snapshotObject(ViewSnapshotGenerator.java:75) ... 20 more There are several issues similar to these over internet, but after following all the recommendations we couldn't find a solution. The database has no views, but debugging de code we saw that some view methods are called using tables as parameters. Any help would be great!

    JIRA | 2 years ago | Nicolás Orbes
    liquibase.exception.DatabaseException: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: Error getting jdbc:mysql://10.5.210.245:3306/domus_migracion view with liquibase.statement.core.GetViewDefinitionStatement@6debbf97
  3. 0

    I am using liquibase for creating cassarndra. My liquibase version is 3.3.2 and But its showing the following error. D:\Liquibase -Cassandra\common-model\build.xml:89: Unable to drop all objects fr om database. at liquibase.integration.ant.DropAllTask.executeWithLiquibaseClassloader (DropAllTask.java:31) at liquibase.integration.ant.BaseLiquibaseTask.execute(BaseLiquibaseTask .java:82) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:392) at org.apache.tools.ant.Target.performTasks(Target.java:413) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399) at org.apache.tools.ant.Project.executeTarget(Project.java:1368) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe cutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1251) at org.apache.tools.ant.Main.runBuild(Main.java:811) at org.apache.tools.ant.Main.startAnt(Main.java:217) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) Caused by: liquibase.exception.DatabaseException: liquibase.exception.LockExcept ion: liquibase.exception.DatabaseException: java.sql.SQLSyntaxErrorException: li ne 1:121 missing EOF at ',' (... datetime, LOCKEDBY VARCHAR(255)[,] CONSTRAINT.. .) 'CREATE TABLE DATABASECHANGELOGLOCK (ID INT NOT NULL, LOCKED BOOLEAN NOT NULL, L OCKGRANTED datetime, LOCKEDBY VARCHAR(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID))' at liquibase.Liquibase.dropAll(Liquibase.java:748) at liquibase.Liquibase.dropAll(Liquibase.java:730) at liquibase.integration.ant.DropAllTask.executeWithLiquibaseClassloader (DropAllTask.java:28) ... 17 more Caused by: liquibase.exception.LockException: liquibase.exception.DatabaseExcept ion: java.sql.SQLSyntaxErrorException: line 1:121 missing EOF at ',' (... dateti me, LOCKEDBY VARCHAR(255)[,] CONSTRAINT...) 'CREATE TABLE DATABASECHANGELOGLOCK (ID INT NOT NULL, LOCKED BOOLEAN NOT NULL, L OCKGRANTED datetime, LOCKEDBY VARCHAR(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID))' at liquibase.lockservice.StandardLockService.acquireLock(StandardLockSer vice.java:215) at liquibase.lockservice.StandardLockService.waitForLock(StandardLockSer vice.java:154) at liquibase.Liquibase.dropAll(Liquibase.java:738) ... 19 more Caused by: liquibase.exception.DatabaseException: java.sql.SQLSyntaxErrorExcepti on: line 1:121 missing EOF at ',' (... datetime, LOCKEDBY VARCHAR(255)[,] CONSTR AINT...) 'CREATE TABLE DATABASECHANGELOGLOCK (ID INT NOT NULL, LOCKED BOOLEAN NOT NULL, L OCKGRANTED datetime, LOCKEDBY VARCHAR(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID))' at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStat ement(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.ja va:87) at liquibase.lockservice.StandardLockService.acquireLock(StandardLockSer vice.java:188) ... 21 more This is my ANT target in build.xml <target name="dropAll" depends="prepare" > <dropAllDatabaseObjects driver="${db.driver}" url="${db.url}" username="${db.username}" password="${db.password}" promptOnNonLocalDatabase="yes" classpathref="classpath" /> </target>

    JIRA | 2 years ago | arun m r
    liquibase.exception.DatabaseException: java.sql.SQLSyntaxErrorException: li ne 1:121 missing EOF at ',' (... datetime, LOCKEDBY VARCHAR(255)[,] CONSTRAINT.. .) 'CREATE TABLE DATABASECHANGELOGLOCK (ID INT NOT NULL, LOCKED BOOLEAN NOT NULL, L OCKGRANTED datetime, LOCKEDBY VARCHAR(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID))'
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Table exists precondition fails with the following exception: {code} DEBUG 3/20/15 4:12 PM: liquibase: <skipped> Executing QUERY database command: SELECT TEXT FROM ALL_VIEWS WHERE upper(VIEW_NAME)='*_<VIEW_NAME>_*' AND OWNER='_*<CURRENT_USER>*_' SEVERE 3/20/15 4:12 PM: liquibase: <skipped> Change Set <skipped> failed. Error: Migration failed for change set <skipped> Reason: <skipped> liquibase.precondition.core.TableExistsPrecondition@333f8b04 : Empty result set, expected one row liquibase.exception.MigrationFailedException: Migration failed for change set <skipped> Reason: <skipped> liquibase.precondition.core.TableExistsPrecondition@333f8b04 : Empty result set, expected one row at liquibase.changelog.ChangeSet.execute(ChangeSet.java:514) at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:50) 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) at org.liquibase.maven.plugins.AbstractLiquibaseUpdateMojo.performLiquibaseTask(AbstractLiquibaseUpdateMojo.java:24) at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute(AbstractLiquibaseMojo.java:377) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216) at org.apache.maven.cli.MavenCli.main(MavenCli.java:160) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: liquibase.exception.PreconditionErrorException: Precondition Error at liquibase.precondition.core.TableExistsPrecondition.check(TableExistsPrecondition.java:65) at liquibase.precondition.core.AndPrecondition.check(AndPrecondition.java:43) at liquibase.precondition.core.PreconditionContainer.check(PreconditionContainer.java:201) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:471) ... 27 more Caused by: liquibase.exception.DatabaseException: Error getting jdbc:oracle:thin:@<host>:<port>/<service_name> view with liquibase.statement.core.GetViewDefinitionStatement@13fabfb3 at liquibase.snapshot.jvm.ViewSnapshotGenerator.snapshotObject(ViewSnapshotGenerator.java:100) at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:60) at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50) at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:63) at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50) at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:189) at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:267) at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:289) at liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnapshot.java:221) at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:203) at liquibase.snapshot.DatabaseSnapshot.init(DatabaseSnapshot.java:70) at liquibase.snapshot.DatabaseSnapshot.<init>(DatabaseSnapshot.java:45) at liquibase.snapshot.JdbcDatabaseSnapshot.<init>(JdbcDatabaseSnapshot.java:25) at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:134) at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:123) at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:111) at liquibase.snapshot.SnapshotGeneratorFactory.has(SnapshotGeneratorFactory.java:101) at liquibase.precondition.core.TableExistsPrecondition.check(TableExistsPrecondition.java:59) ... 30 more Caused by: liquibase.exception.DatabaseException: Expected single row from liquibase.statement.core.GetViewDefinitionStatement@58815902 but got 0 at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:155) at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:166) at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:161) at liquibase.database.AbstractJdbcDatabase.getViewDefinition(AbstractJdbcDatabase.java:862) at liquibase.snapshot.jvm.ViewSnapshotGenerator.snapshotObject(ViewSnapshotGenerator.java:75) ... 47 more Caused by: liquibase.exception.DatabaseException: Empty result set, expected one row at liquibase.util.JdbcUtils.requiredSingleResult(JdbcUtils.java:141) at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:153) ... 51 more {code} Analysis showed that snapshot creation attempt was made during table existence check, and has eventually failed during attempt to get a View definition: {{liquibase.snapshot.jvm.ViewSnapshotGenerator.snapshotObject(DatabaseObject, DatabaseSnapshot)}}: {code} String rawViewName = row.getString("TABLE_NAME"); String rawSchemaName = StringUtils.trimToNull(row.getString("TABLE_SCHEM")); String rawCatalogName = StringUtils.trimToNull(row.getString("TABLE_CAT")); {code} After lines above are executed, {{rawSchemaName}} is <APPROPRIATE_VIEW_SCHEMA> and {{rawCatalogName}} is null. Next, View object itself is created: {code} View view = new View().setName(cleanNameFromDatabase(rawViewName, database)); view.setRemarks(remarks); CatalogAndSchema schemaFromJdbcInfo = ((AbstractJdbcDatabase) database).getSchemaFromJdbcInfo(rawCatalogName, rawSchemaName); view.setSchema(new Schema(schemaFromJdbcInfo.getCatalogName(), schemaFromJdbcInfo.getSchemaName())); {code} {{liquibase.database.AbstractJdbcDatabase.getSchemaFromJdbcInfo(String, String)}} calls {{liquibase.CatalogAndSchema.customize(Database)}} that eventually calls {{liquibase.CatalogAndSchema.standardize(Database)}}. This method considers catalog/schema names to be "in the wrong order" (Oracle does not support schemas while schema name is not null and catalog name is null) and swaps their values: {code} if (accordingTo.supportsSchemas()) { if (schemaName != null && schemaName.equalsIgnoreCase(accordingTo.getDefaultSchemaName())) { schemaName = null; } } else { if (catalogName == null && schemaName != null) { //had names in the wrong order catalogName = schemaName; } schemaName = catalogName; } {code} {{liquibase.CatalogAndSchema.customize(Database)}} also sets {{schemaName}} to the default value (<CURRENT_USER>): {code} public CatalogAndSchema customize(Database accordingTo) { CatalogAndSchema standard = standardize(accordingTo); String catalogName = standard.getCatalogName(); String schemaName = standard.getSchemaName(); <skipped> if (schemaName == null) { schemaName = accordingTo.getDefaultSchemaName(); } <skipped> return new CatalogAndSchema(catalogName, schemaName); } {code} Hence, catalog name becomes correct schema name and schema name becomes <CURRENT_USER>.{{liquibase.sqlgenerator.core.GetViewDefinitionGeneratorOracle.generateSql(GetViewDefinitionStatement, Database, SqlGeneratorChain)}} uses schema name (again, schemas are not supported by Oracle DB) instead of a catalog in its statement: {code} return new Sql[]{ new UnparsedSql("SELECT TEXT FROM ALL_VIEWS WHERE upper(VIEW_NAME)='" + statement.getViewName().toUpperCase() + "' AND OWNER='" + schema.getSchemaName() + "'") }; {code}

    JIRA | 2 years ago | Alexander Kiselyov
    liquibase.exception.MigrationFailedException: Migration failed for change set <skipped> Reason: <skipped> liquibase.precondition.core.TableExistsPrecondition@333f8b04 : Empty result set, expected one row
  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 | 8 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

      Empty result set, expected one row

      at liquibase.util.JdbcUtils.requiredSingleResult()
    2. Liquibase Core
      Liquibase.dropAll
      1. liquibase.util.JdbcUtils.requiredSingleResult(JdbcUtils.java:141)
      2. liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:152)
      3. liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:162)
      4. liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:157)
      5. liquibase.database.AbstractJdbcDatabase.getViewDefinition(AbstractJdbcDatabase.java:855)
      6. liquibase.snapshot.jvm.ViewSnapshotGenerator.snapshotObject(ViewSnapshotGenerator.java:75)
      7. liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:59)
      8. liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50)
      9. liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:62)
      10. liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50)
      11. liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:153)
      12. liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:226)
      13. liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:248)
      14. liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnapshot.java:185)
      15. liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:167)
      16. liquibase.snapshot.DatabaseSnapshot.init(DatabaseSnapshot.java:56)
      17. liquibase.snapshot.DatabaseSnapshot.<init>(DatabaseSnapshot.java:33)
      18. liquibase.snapshot.JdbcDatabaseSnapshot.<init>(JdbcDatabaseSnapshot.java:22)
      19. liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:126)
      20. liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:119)
      21. liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:107)
      22. liquibase.database.AbstractJdbcDatabase.dropDatabaseObjects(AbstractJdbcDatabase.java:729)
      23. liquibase.Liquibase.dropAll(Liquibase.java:671)
      24. liquibase.Liquibase.dropAll(Liquibase.java:658)
      24 frames
    3. com.accsa.domus
      Update.main
      1. com.accsa.domus.business.db.Update.blank(Update.java:85)
      2. com.accsa.domus.business.db.Update.main(Update.java:95)
      2 frames