Illustration Image

Cannot find generators for database class liquibase.ext.cassandra.database.CassandraDatabase

I'm receiving an error when attempting to run Liquibase migrations using liquibase-cassandra:4.31.1.1 against a ScyllaDB cluster.

The code I'm using:

String contacts = Arrays.stream(myHosts.split(","))
    .map(String::trim)
    .collect(Collectors.joining("--"));

String jdbcUrl = String.format("jdbc:cassandra://%s:%d/%s?compliancemode=Liquibase&localdatacenter=%s&requesttimeout=10000",
    contacts,
    myPort,
    myKeyspace,
    myDataCenter);

String changeLogFile = "db/changelog/db.changelog-master.json";

Connection connection = DriverManager.getConnection(jdbcUrl, myUsername, myPassword);
Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(connection));
Liquibase liquibase = new Liquibase(changeLogFile, new ClassLoaderResourceAccessor(), database);

liquibase.update("main");

Error log:

PM liquibase.command
INFO: Logging exception.
ERROR: Exception Details
ERROR: Exception Primary Class:  IllegalStateException
ERROR: Exception Primary Reason:  Cannot find generators for database class liquibase.ext.cassandra.database.CassandraDatabase, statement: SELECT TABLE_NAME, KEYSPACE_NAME, COMMENT FROM system_schema.tables WHERE keyspace_name = 'mykeyspace' AND TABLE_NAME = 'databasechangelog'. Either Liquibase or the database platform does not support the type of statement being generated. Please check your database documentation for more information.
ERROR: Exception Primary Source:  Cassandra 3.0.8
PM liquibase.command
INFO: Command execution complete
Error when executing Liquibase migrations:
liquibase.exception.CommandExecutionException: liquibase.exception.ChangeLogParseException: Error parsing db/changelog/db.changelog-master.json : Cannot find generators for database class liquibase.ext.cassandra.database.CassandraDatabase, statement: SELECT TABLE_NAME, KEYSPACE_NAME, COMMENT FROM system_schema.tables WHERE keyspace_name = 'mykeyspace' AND TABLE_NAME = 'databasechangelog'. Either Liquibase or the database platform does not support the type of statement being generated. Please check your database documentation for more information.

Note: I ran this code against a local ScyllaDB container and it worked as expected. The problem happens when I try to run in test/prod environment against a ScyllaDB cluster. The connection with the cluster is being established, the problem happens in liquibase.update("main").

Has anyone faced this issue?

Become part of our
growing community!
Welcome to Planet Cassandra, a community for Apache Cassandra®! We're a passionate and dedicated group of users, developers, and enthusiasts who are working together to make Cassandra the best it can be. Whether you're just getting started with Cassandra or you're an experienced user, there's a place for you in our community.
A dinosaur
Planet Cassandra is a service for the Apache Cassandra® user community to share with each other. From tutorials and guides, to discussions and updates, we're here to help you get the most out of Cassandra. Connect with us and become part of our growing community today.
© 2009-2023 The Apache Software Foundation under the terms of the Apache License 2.0. Apache, the Apache feather logo, Apache Cassandra, Cassandra, and the Cassandra logo, are either registered trademarks or trademarks of The Apache Software Foundation. Sponsored by Anant Corporation and Datastax, and Developed by Anant Corporation.

Get Involved with Planet Cassandra!

We believe that the power of the Planet Cassandra community lies in the contributions of its members. Do you have content, articles, videos, or use cases you want to share with the world?