cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Liquibase clear-checksums usage throws SQLException

gonzalad
Node Link

Hello,

I'm using liquibase neo4j plugin 4.10.0 on a Spring Boot Application.

When I add the following setting in the application.yml:

spring:
  liquibase:
    clear-checksums: true

I get an error on startup:

2022-05-11 16:32:01.418 ERROR [,,] 34389 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration$LiquibaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.DatabaseException: org.neo4j.driver.exceptions.ClientException: Invalid input 'P': expected 's/S' or 'n/N' (line 1, column 2 (offset: 1))
"UPDATE DATABASECHANGELOG SET MD5SUM = NULL"
  ^ [Failed SQL: (0) UPDATE DATABASECHANGELOG SET MD5SUM = NULL]
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
  at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944)
  at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
  at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144)
  at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:771)
  at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:763)
  at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:438)
  at org.springframework.boot.SpringApplication.run(SpringApplication.java:339)
  at org.springframework.boot.SpringApplication.run(SpringApplication.java:1329)
  at org.springframework.boot.SpringApplication.run(SpringApplication.java:1318)
  at fr.pcscol.cof.ApplicationServeur.main(ApplicationServeur.java:17)
Caused by: liquibase.exception.DatabaseException: org.neo4j.driver.exceptions.ClientException: Invalid input 'P': expected 's/S' or 'n/N' (line 1, column 2 (offset: 1))
"UPDATE DATABASECHANGELOG SET MD5SUM = NULL"
  ^ [Failed SQL: (0) UPDATE DATABASECHANGELOG SET MD5SUM = NULL]
  at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:397)
  at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:83)
  at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:151)
  at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:135)
  at liquibase.Liquibase$19.run(Liquibase.java:2174)
  at liquibase.Scope.lambda$child$0(Scope.java:180)
  at liquibase.Scope.child(Scope.java:189)
  at liquibase.Scope.child(Scope.java:179)
  at liquibase.Scope.child(Scope.java:158)
  at liquibase.Liquibase.runInScope(Liquibase.java:2405)
  at liquibase.Liquibase.clearCheckSums(Liquibase.java:2158)
  at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:301)
  at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:269)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)
  ... 17 common frames omitted
Caused by: java.sql.SQLException: org.neo4j.driver.exceptions.ClientException: Invalid input 'P': expected 's/S' or 'n/N' (line 1, column 2 (offset: 1))
"UPDATE DATABASECHANGELOG SET MD5SUM = NULL"
  ^
  at org.neo4j.jdbc.utils.BoltNeo4jUtils.executeInTx(BoltNeo4jUtils.java:85)
  at org.neo4j.jdbc.utils.BoltNeo4jUtils.executeInTx(BoltNeo4jUtils.java:92)
  at org.neo4j.jdbc.bolt.BoltNeo4jStatement.executeInternal(BoltNeo4jStatement.java:108)
  at org.neo4j.jdbc.bolt.BoltNeo4jStatement.execute(BoltNeo4jStatement.java:90)
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.base/java.lang.reflect.Method.invoke(Method.java:566)
  at org.neo4j.jdbc.utils.Neo4jInvocationHandler.invoke(Neo4jInvocationHandler.java:54)
  at com.sun.proxy.$Proxy291.execute(Unknown Source)
  at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:95)
  at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
  at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:393)
  ... 31 common frames omitted
Caused by: org.neo4j.driver.exceptions.ClientException: Invalid input 'P': expected 's/S' or 'n/N' (line 1, column 2 (offset: 1))
"UPDATE DATABASECHANGELOG SET MD5SUM = NULL"
  ^
  at org.neo4j.driver.internal.util.Futures.blockingGet(Futures.java:143)
  at org.neo4j.driver.internal.InternalResult.blockingGet(InternalResult.java:128)
  at org.neo4j.driver.internal.InternalResult.consume(InternalResult.java:117)
  at org.neo4j.jdbc.bolt.BoltNeo4jStatement.lambda$execute$2(BoltNeo4jStatement.java:97)
  at org.neo4j.jdbc.utils.BoltNeo4jUtils.executeInTx(BoltNeo4jUtils.java:78)
  ... 43 common frames omitted
  Suppressed: org.neo4j.driver.internal.util.ErrorUtil$InternalExceptionCause: null
    at org.neo4j.driver.internal.util.ErrorUtil.newNeo4jError(ErrorUtil.java:80)
    at org.neo4j.driver.internal.async.inbound.InboundMessageDispatcher.handleFailureMessage(InboundMessageDispatcher.java:105)
    at org.neo4j.driver.internal.messaging.common.CommonMessageReader.unpackFailureMessage(CommonMessageReader.java:83)
    at org.neo4j.driver.internal.messaging.common.CommonMessageReader.read(CommonMessageReader.java:59)
    at org.neo4j.driver.internal.async.inbound.InboundMessageHandler.channelRead0(InboundMessageHandler.java:83)
    at org.neo4j.driver.internal.async.inbound.InboundMessageHandler.channelRead0(InboundMessageHandler.java:35)
    at org.neo4j.driver.internal.shaded.io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
    at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
    at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
    at org.neo4j.driver.internal.async.inbound.MessageDecoder.channelRead(MessageDecoder.java:47)
    at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
    at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:311)
    at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:432)
    at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)
    at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    at org.neo4j.driver.internal.shaded.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
    at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at org.neo4j.driver.internal.shaded.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
    at org.neo4j.driver.internal.shaded.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
    at org.neo4j.driver.internal.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)
    at org.neo4j.driver.internal.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
    at org.neo4j.driver.internal.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
    at org.neo4j.driver.internal.shaded.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
    at org.neo4j.driver.internal.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
    at org.neo4j.driver.internal.shaded.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at org.neo4j.driver.internal.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:834)

From what I understand the update SQL query is generated by liquibase.Liquibase#clearCheckSums():

I tried to change the table name to "__LiquibaseChangeSet" on debug mode, but same error.

Thanks,
Adrian

3 REPLIES 3

gonzalad
Node Link

atm, I executed the following script

MATCH (cs:`__LiquibaseChangeSet`)
WHERE cs.changeLog = 'liquibase.xml'
SET cs.checkSum = null;

It does the same as the thing we would expect from liquibase.Liquibase#clearCheckSums():

When you execute the migration after that, the liquibase migration computes the checkSum property without reexecuting the migrations.

Cheers,
Adrian

I'm so sorry I see this post only now.

Clearing checksums should work out of the box without resorting to manual query execution.

I opened an issue here.

Congratulations, you just uncovered a 5 year-old Liquibase core bug. A fix is on the way.

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online