liquibase.exception.JDBCException: Error executing SQL INSERT INTO [dbo].[DATABASECHANGELOG] ([DATEEXECUTED], [AUTHOR], [LIQUIBASE], [DESCRIPTION], [COMMENTS], [MD5SUM], [ID], [FILENAME]) VALUES (GETDATE(), 'justx2', '1.9.5_ct1', 'Empty', 'Doing nothing', 'd41d8cd98f0b24e980998ecf8427e', '1', 'CASESENSITIVE.xml')

JIRA | Nathan Voxland | 7 years ago
  1. 0

    Liquibase 1.9.5 on Windows against MS-SQL. Liquibase is case insensitive on its arguments, so >liquibase --changeLogFile=casesensitive.xml update >liquibase --changeLogFile=CASESENSITIVE.xml update will execute the same changelogfile. The database is also case insensitive and will see the two nameings as the same. If a changelog contains a changeset with attribute runAlways="true", running it using case different naming will raise an database exception. So somewhere in the code there must be a case sensitive comparison that results in an INSERT statement where it should have been an UPDATE statement. casesensitive.xml Code: <?xml version="1.0" encoding="UTF-8"?> <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 id="1" author="justx2" runAlways="true"> <comment>Doing nothing</comment> </changeSet> </databaseChangeLog> Example: >liquibase --changeLogFile=casesensitive.xml update Migration successful >liquibase --changeLogFile=casesensitive.xml update Migration successful >liquibase --changeLogFile=CASESENSITIVE.xml update Migration Failed: Violation of PRIMARY KEY constraint 'PK_DATABASECHANGELOG'. Cannot insert duplicate key in object 'dbo.DATABASECHANGELOG'.. For more information, use the --logLevel flag) 144 ERROR liquibase.main (111) - Violation of PRIMARY KEY constraint 'PK_DATABASECHANGELOG'. Cannot insert duplicate key in object 'dbo.DATABASECHANGELOG'. liquibase.exception.JDBCException: Error executing SQL INSERT INTO [dbo].[DATABASECHANGELOG] ([DATEEXECUTED], [AUTHOR], [LIQUIBASE], [DESCRIPTION], [COMMENTS], [MD5SUM], [ID], [FILENAME]) VALUES (GETDATE(), 'justx2', '1.9.5_ct1', 'Empty', 'Doing nothing', 'd41d8cd98f0b24e980998ecf8427e', '1', 'CASESENSITIVE.xml') at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:55) at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:86) at liquibase.database.AbstractDatabase.markChangeSetAsRan(AbstractDatabase.java:1309) at liquibase.parser.visitor.UpdateVisitor.visit(UpdateVisitor.java:28) at liquibase.parser.ChangeLogIterator.run(ChangeLogIterator.java:41) at liquibase.Liquibase.update(Liquibase.java:112) at liquibase.commandline.Main.doMigration(Main.java:650) at liquibase.commandline.Main.main(Main.java:97) Caused by: java.sql.SQLException: Violation of PRIMARY KEY constraint 'PK_DATABASECHANGELOG'. Cannot insert duplicate key in object 'dbo.DATABASECHANGELOG'. at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368) at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2820) at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2258) at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:632) at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584) at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546) at net.sourceforge.jtds.jdbc.JtdsStatement.executeImpl(JtdsStatement.java:723) at net.sourceforge.jtds.jdbc.JtdsStatement.execute(JtdsStatement.java:1160) at liquibase.database.template.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:78) at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:48) ... 7 more

    JIRA | 7 years ago | Nathan Voxland
    liquibase.exception.JDBCException: Error executing SQL INSERT INTO [dbo].[DATABASECHANGELOG] ([DATEEXECUTED], [AUTHOR], [LIQUIBASE], [DESCRIPTION], [COMMENTS], [MD5SUM], [ID], [FILENAME]) VALUES (GETDATE(), 'justx2', '1.9.5_ct1', 'Empty', 'Doing nothing', 'd41d8cd98f0b24e980998ecf8427e', '1', 'CASESENSITIVE.xml')
  2. 0

    Liquibase 1.9.5 on Windows against MS-SQL. Liquibase is case insensitive on its arguments, so >liquibase --changeLogFile=casesensitive.xml update >liquibase --changeLogFile=CASESENSITIVE.xml update will execute the same changelogfile. The database is also case insensitive and will see the two nameings as the same. If a changelog contains a changeset with attribute runAlways="true", running it using case different naming will raise an database exception. So somewhere in the code there must be a case sensitive comparison that results in an INSERT statement where it should have been an UPDATE statement. casesensitive.xml Code: <?xml version="1.0" encoding="UTF-8"?> <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 id="1" author="justx2" runAlways="true"> <comment>Doing nothing</comment> </changeSet> </databaseChangeLog> Example: >liquibase --changeLogFile=casesensitive.xml update Migration successful >liquibase --changeLogFile=casesensitive.xml update Migration successful >liquibase --changeLogFile=CASESENSITIVE.xml update Migration Failed: Violation of PRIMARY KEY constraint 'PK_DATABASECHANGELOG'. Cannot insert duplicate key in object 'dbo.DATABASECHANGELOG'.. For more information, use the --logLevel flag) 144 ERROR liquibase.main (111) - Violation of PRIMARY KEY constraint 'PK_DATABASECHANGELOG'. Cannot insert duplicate key in object 'dbo.DATABASECHANGELOG'. liquibase.exception.JDBCException: Error executing SQL INSERT INTO [dbo].[DATABASECHANGELOG] ([DATEEXECUTED], [AUTHOR], [LIQUIBASE], [DESCRIPTION], [COMMENTS], [MD5SUM], [ID], [FILENAME]) VALUES (GETDATE(), 'justx2', '1.9.5_ct1', 'Empty', 'Doing nothing', 'd41d8cd98f0b24e980998ecf8427e', '1', 'CASESENSITIVE.xml') at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:55) at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:86) at liquibase.database.AbstractDatabase.markChangeSetAsRan(AbstractDatabase.java:1309) at liquibase.parser.visitor.UpdateVisitor.visit(UpdateVisitor.java:28) at liquibase.parser.ChangeLogIterator.run(ChangeLogIterator.java:41) at liquibase.Liquibase.update(Liquibase.java:112) at liquibase.commandline.Main.doMigration(Main.java:650) at liquibase.commandline.Main.main(Main.java:97) Caused by: java.sql.SQLException: Violation of PRIMARY KEY constraint 'PK_DATABASECHANGELOG'. Cannot insert duplicate key in object 'dbo.DATABASECHANGELOG'. at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368) at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2820) at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2258) at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:632) at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584) at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546) at net.sourceforge.jtds.jdbc.JtdsStatement.executeImpl(JtdsStatement.java:723) at net.sourceforge.jtds.jdbc.JtdsStatement.execute(JtdsStatement.java:1160) at liquibase.database.template.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:78) at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:48) ... 7 more

    JIRA | 7 years ago | Nathan Voxland
    liquibase.exception.JDBCException: Error executing SQL INSERT INTO [dbo].[DATABASECHANGELOG] ([DATEEXECUTED], [AUTHOR], [LIQUIBASE], [DESCRIPTION], [COMMENTS], [MD5SUM], [ID], [FILENAME]) VALUES (GETDATE(), 'justx2', '1.9.5_ct1', 'Empty', 'Doing nothing', 'd41d8cd98f0b24e980998ecf8427e', '1', 'CASESENSITIVE.xml')
  3. 0

    SQL Server Schema Upgrade Fails (6.5 -> 7.0 EAP)

    YouTrack | 5 years ago
    java.sql.SQLException: The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Failed create trigger SYM_ON_I... implicit conversion different column collation on SQLServer

    symmetricds | 2 years ago | jagarcia1
    org.jumpmind.db.sql.SqlException: Implicit conversion of varchar value to varchar cannot be performed because the collation of the value is unresolved due to a collation conflict between "SQL_Latin1_General_CP1_CI_AI" and "SQL_Latin1_General_CP1_CI_AS" in add operator.
  6. 0

    During a deployment of 2.5.0 at Sinclair, the SSP deployment failed with the following error in the log {noformat} Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in ServletContext resource [/WEB-INF/spring/app-config.xml]: Invocation of init method failed; nested exception is liquibase.exception.MigrationFailedException: Migration failed for change set org/jasig/ssp/database/changesets/000130.xml::create mv directory_person view and pop msql::jim.stanley: Reason: liquibase.exception.DatabaseException: Error executing SQL SELECT * INTO dbo.mv_directory_person FROM dbo.v_directory_person;: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.: Caused By: Error executing SQL SELECT * INTO dbo.mv_directory_person FROM dbo.v_directory_person;: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.: Caused By: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1512) ~[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521) ~[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) ~[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296) ~[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) ~[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293) ~[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) ~[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:286) ~[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) ~[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:912) ~[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:855) ~[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:770) ~[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:489) ~[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE] ... 65 common frames omitted Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set org/jasig/ssp/database/changesets/000130.xml::create mv directory_person view and pop msql::jim.stanley: Reason: liquibase.exception.DatabaseException: Error executing SQL SELECT * INTO dbo.mv_directory_person FROM dbo.v_directory_person;: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.: Caused By: Error executing SQL SELECT * INTO dbo.mv_directory_person FROM dbo.v_directory_person;: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.: Caused By: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. at liquibase.changelog.ChangeSet.execute(ChangeSet.java:347) ~[liquibase-core-2.0.3.jar:na] at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:27) ~[liquibase-core-2.0.3.jar:na] at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:58) ~[liquibase-core-2.0.3.jar:na] at liquibase.Liquibase.update(Liquibase.java:113) ~[liquibase-core-2.0.3.jar:na] at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:244) ~[liquibase-core-2.0.3.jar:na] at org.jasig.ssp.util.liquibase.ExtendedSpringLiquibase.afterPropertiesSet(ExtendedSpringLiquibase.java:67) ~[ExtendedSpringLiquibase.class:na] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1571) ~[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509) ~[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE] ... 77 common frames omitted Caused by: liquibase.exception.DatabaseException: Error executing SQL SELECT * INTO dbo.mv_directory_person FROM dbo.v_directory_person;: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:62) ~[liquibase-core-2.0.3.jar:na] at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:104) ~[liquibase-core-2.0.3.jar:na] at liquibase.database.AbstractDatabase.execute(AbstractDatabase.java:1075) ~[liquibase-core-2.0.3.jar:na] at liquibase.database.AbstractDatabase.executeStatements(AbstractDatabase.java:1059) ~[liquibase-core-2.0.3.jar:na] at liquibase.changelog.ChangeSet.execute(ChangeSet.java:317) ~[liquibase-core-2.0.3.jar:na] ... 84 common frames omitted Caused by: java.sql.SQLException: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368) ~[jtds-1.2.4.jar:1.2.4] at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2820) ~[jtds-1.2.4.jar:1.2.4] at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2258) ~[jtds-1.2.4.jar:1.2.4] at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:632) ~[jtds-1.2.4.jar:1.2.4] at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584) ~[jtds-1.2.4.jar:1.2.4] at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546) ~[jtds-1.2.4.jar:1.2.4] at net.sourceforge.jtds.jdbc.JtdsStatement.executeImpl(JtdsStatement.java:723) ~[jtds-1.2.4.jar:1.2.4] at net.sourceforge.jtds.jdbc.JtdsStatement.execute(JtdsStatement.java:1160) ~[jtds-1.2.4.jar:1.2.4] at liquibase.executor.jvm.JdbcExecutor$1ExecuteStatementCallback.doInStatement(JdbcExecutor.java:92) ~[liquibase-core-2.0.3.jar:na] at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55) ~[liquibase-core-2.0.3.jar:na] ... 88 common frames omitted {noformat}

    Apereo Issues | 2 years ago | Jason Elwood
    liquibase.exception.DatabaseException: Error executing SQL SELECT * INTO dbo.mv_directory_person FROM dbo.v_directory_person;: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.: Caused By: Error executing SQL SELECT * INTO dbo.mv_directory_person FROM dbo.v_directory_person;: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.: Caused By: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

  1. abrazeneb 8 times, last 4 months ago
1 unregistered visitors
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. java.sql.SQLException

    Violation of PRIMARY KEY constraint 'PK_DATABASECHANGELOG'. Cannot insert duplicate key in object 'dbo.DATABASECHANGELOG'.

    at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic()
  2. jTDS
    JtdsStatement.execute
    1. net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
    2. net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2820)
    3. net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2258)
    4. net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:632)
    5. net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584)
    6. net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546)
    7. net.sourceforge.jtds.jdbc.JtdsStatement.executeImpl(JtdsStatement.java:723)
    8. net.sourceforge.jtds.jdbc.JtdsStatement.execute(JtdsStatement.java:1160)
    8 frames
  3. liquibase.database.template
    JdbcTemplate.execute
    1. liquibase.database.template.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:78)
    2. liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:48)
    3. liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:86)
    3 frames
  4. Liquibase Core
    AbstractDatabase.markChangeSetAsRan
    1. liquibase.database.AbstractDatabase.markChangeSetAsRan(AbstractDatabase.java:1309)
    1 frame
  5. liquibase.parser.visitor
    UpdateVisitor.visit
    1. liquibase.parser.visitor.UpdateVisitor.visit(UpdateVisitor.java:28)
    1 frame
  6. Liquibase Core
    Liquibase.update
    1. liquibase.parser.ChangeLogIterator.run(ChangeLogIterator.java:41)
    2. liquibase.Liquibase.update(Liquibase.java:112)
    2 frames
  7. liquibase.commandline
    Main.main
    1. liquibase.commandline.Main.doMigration(Main.java:650)
    2. liquibase.commandline.Main.main(Main.java:97)
    2 frames