question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cassandra Liquibase DB Migration

See original GitHub issue

Hello Team,

We are trying to use liquibase to do our db related changes in Cassandra when we are deploying our application components to GKP. We are trying to use liquibase for two things: a) Generating change log set:

When I try to execute below command it generated a nothing for a change log set and got below output:

$ java -jar liquibase-core.jar --classpath=driver.jar;liquibase-cassandra-4.2.1.jar;snakeyaml-1.12.jar --changeLogFile=dev/dbchangelog.xml --url=**********;DefaultKeyspace=*;UID=;PWD=&&&&&&&&&;SSLMode=1;UseSslIdentityCheck=0;AuthMech=1;SSLTruststorePath=I:\liquibasejar\app-dev1.jks;SSLTruststorePwd= --driver=com.simba.cassandra.jdbc42.Driver --defaultSchemaName= --logLevel=info generateChangeLog Mar 17, 2022 3:32:31 PM liquibase.servicelocator INFO: Cannot load service: liquibase.license.LicenseService: Provider liquibase.license.pro.DaticalTrueLicenseService could not be instantiated ####################################################

_ _ _ _

| | () () |

| | _ __ _ _ _ | |_ __ _ ___ ___

| | | |/ _ | | | | | '_ \ / _ / __|/ _ \

| || | (| | || | | |) | (| _ \ __/

_/|_, |_,||./ _,|/__|

| |

|_|

Get documentation at docs.liquibase.com

Get certified courses at learn.liquibase.com

Free schema change activity reports at

https://hub.liquibase.com/

#################################################### Starting Liquibase at 15:32:31 (version 4.4.3 #53 built at 2021-08-05 18:32+0000) SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”. SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. BEST PRACTICE: The changelog generated by diffChangeLog/generateChangeLog should be inspected for correctness and completeness before being deployed. Mar 17, 2022 3:32:34 PM liquibase.snapshot WARNING: Did not find catalog ‘’ to snapshot Mar 17, 2022 3:32:34 PM liquibase.servicelocator INFO: Cannot load service: liquibase.serializer.ChangeLogSerializer: liquibase.serializer.core.json.JsonChangeLogSerializer Unable to get public no-arg constructor Mar 17, 2022 3:32:34 PM liquibase.servicelocator INFO: Cannot load service: liquibase.serializer.ChangeLogSerializer: liquibase.serializer.core.yaml.YamlChangeLogSerializer Unable to get public no-arg constructor Mar 17, 2022 3:32:34 PM liquibase.servicelocator INFO: Cannot load service: liquibase.serializer.ChangeLogSerializer: com.datical.liquibase.ext.diff.FormattedDiffSerializer Unable to get public no-arg constructor Mar 17, 2022 3:32:34 PM liquibase.diff INFO: changeSets count: 0 Mar 17, 2022 3:32:34 PM liquibase.diff INFO: No changesets to add. Generated changelog written to I:\liquibasejar\dev\dbchangelog.xml Liquibase command ‘generateChangeLog’ was executed successfully. I also tried to generate the changelog using below page by executing liquibase as a maven plug in: https://www.baeldung.com/liquibase-refactor-schema-of-java-app but still it says to change set and nothing diff to write upon db change log set.

b) Also using liquibase creates two tables in db after doing db related changes: a) Databasechangelog – this is to capture db related changes which is being applied by liquibase. b) Databasechangeloglock – this is table is used to acquire lock on db while performing changes. Both of these table are created automatically by liquibase in DB if they are not present. We want these tables to have custom names rather than default name. So in our liquibase configurations, we are passing hard coded values for custom table names as of now. liquibase.setDatabaseChangeLogTable(“VQCHANGELOG”); liquibase.setDatabaseChangeLogLockTable(“VQCHANGELOGLOCK”);

          When we deploy this change to GKP, we are getting below error in our pod which says unconfigured table for lock:
          2022-03-21 18:37:00.858  INFO 1 --- [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 3 endpoint(s) beneath base path '/actuator'

2022-03-21 18:37:00.960 INFO 1 — [ main] c.j.c.e.q.virtual.config.AsyncConfig : Configuring AsyncTaskExecutor [taskExecutor] for [virtualQualificationAsyncTaskExecutor]… 2022-03-21 18:37:00.967 INFO 1 — [ main] c.j.c.e.q.virtual.config.AsyncConfig : Configuring AsyncTaskExecutor [mvcTaskExecutor] for [MvcVirtualQualificationAsyncTaskExecutor]… 2022-03-21 18:37:01.013 INFO 1 — [ main] .c.p.g.l.m.r.KafkaListenerRestController : kafka Listener rest controller active. 2022-03-21 18:37:01.154 INFO 1 — [ main] c.j.c.e.q.v.c.LiquibaseConfiguration : Retrieving database change log table name : VQCHANGELOG 2022-03-21 18:37:01.154 INFO 1 — [ main] c.j.c.e.q.v.c.LiquibaseConfiguration : Retrieving database change log lock table name : VQCHANGELOGLOCK 2022-03-21 18:37:02.994 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:37:13.905 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:37:24.809 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:37:35.743 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:37:46.636 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:37:57.539 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:38:08.385 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:38:19.284 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:38:30.200 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:38:41.071 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:38:51.917 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:39:02.816 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:39:13.702 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:39:24.675 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:39:35.543 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:39:46.445 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:39:57.314 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:40:08.180 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:40:19.056 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:40:29.972 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:40:40.871 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:40:51.805 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:41:02.794 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:41:13.655 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:41:24.515 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:41:35.405 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:41:46.254 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:41:57.166 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:42:08.059 WARN 1 — [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘liquibase’ defined in class path resource [com/qualification/virtual/config/LiquibaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.LockException: liquibase.exception.DatabaseException: Error executing SQL SELECT ID,LOCKED,LOCKGRANTED,LOCKEDBY FROM ewallet_dev1.VQCHANGELOGLOCK WHERE ID=1: [Simba]CassandraJDBCDriver ERROR Invalid query: SELECT ID,LOCKED,LOCKGRANTED,LOCKEDBY FROM ewallet_dev1.VQCHANGELOGLOCK WHERE ID=1, Cause: com.simba.cassandra.shaded.datastax.driver.core.exceptions.InvalidQueryException: unconfigured table vqchangeloglock.

Kindly check these and suggest us if we are missing some thing or come config that needs to be corrected. Any help is greatly appreciated.

Additional detail:

Liquibase Version: 4.4.3 Liquibase Integration & Version: Spring boot Liquibase Extension(s) & Version: Database Vendor & Version: Cassandra 3.11 Operating System Type & Version: Linux **************-7d77b9cb84-kgxzw 3.10.0-1160.42.2.el7.x86_64 #1 SMP Tue Aug 31 20:15:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Thanks. Himanshu.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
himanshudaksha007commented, Mar 22, 2022

@kataggart : As soon as I can get some info on this, I will schedule the zoom call for 30 mins. Thank you so much for the help 😃

0reactions
kataggartcommented, Mar 24, 2022

@lanevska thanks for the heads up on that PR over on the extension repo. I will see what we might be able to do.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Liquibase with Cassandra
Apache Cassandra is an open source, distributed, NoSQL database. It presents a partitioned wide column storage model with consistent semantics.
Read more >
Is there an equivalent of Liquibase for Cassandra? - Quora
It's a simple and lightweight migration tool for Cassandra that's based on Axel Fontaine's Flyway project . It works just like Flyway. Plain...
Read more >
Cassandra schema migrations on application startup - findinpath
liquibase. are used extensively in the Java world for performing database schema migrations on the application startup. As a side note, these ...
Read more >
Cassandra Schema Migration for Spring-Boot Projects - itwarilal
Database schema migration solutions do provide such support, for RDBMS Flyway, Liquibase and MyBatis are proven solutions.
Read more >
What are the best migration tools for Cassandra?
i.e tool for managing database evolution/versioning (similar to flyway) ... like flyway and liquibase. similarly, do we have for cassandra?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found