V4.27.0 IllegalStateException: More than one CommandStep provides class liquibase.changelog.visitor.ChangeExecListener error in docker container

I am upgrading our liquibase build project, part of this is changing from running “java -jar liquibase-core.jar …” to running the update command in the liquibase/liquibase docker container.

I have hit an error I don’t comprehend, nor know how to fix. We use the community /OSS edition of liquibase, not PRO.

Essentially I run

docker run -d liquibase/liquibase:4.27 bash -c lpm add mysql --global; \
liquibase
--driver=com.mysql.cj.jdbc.Driver
--changelog-file=main.changelog.xml
--url="jdbc:mysql://mysql_base:3306/dbname?'jdbcCompliantTruncation=false&sessionVariables=sql_mode=''"
--username=liquibase_user
--password=secret
--contexts="install,mysql,dev"
update

I receive this stacktrace
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at liquibase.integration.commandline.LiquibaseLauncher.main(LiquibaseLauncher.java:116)
Caused by: java.lang.IllegalStateException: More than one CommandStep provides class liquibase.changelog.visitor.ChangeExecListener. Steps: liquibase.command.core.helpers.ChangeExecListenerCommandStep, com.datical.liquibase.ext.command.helpers.ProChangeExecListenerCommandStep
at liquibase.command.CommandFactory.lambda$whoProvidesClass$3(CommandFactory.java:117)
at java.base/java.util.stream.ReduceOps$2ReducingSink.accept(Unknown Source)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.reduce(Unknown Source)
at liquibase.command.CommandFactory.whoProvidesClass(CommandFactory.java:116)
at liquibase.command.CommandFactory.findDependenciesForCommand(CommandFactory.java:104)
at liquibase.command.CommandFactory.computePipelineForCommandDefinition(CommandFactory.java:77)
at liquibase.command.CommandFactory.getCommandDefinition(CommandFactory.java:50)
at liquibase.command.CommandFactory.getCommands(CommandFactory.java:174)
at liquibase.integration.commandline.LiquibaseCommandLine.getCommands(LiquibaseCommandLine.java:1110)
at liquibase.integration.commandline.LiquibaseCommandLine.buildPicoCommandLine(LiquibaseCommandLine.java:216)
at liquibase.integration.commandline.LiquibaseCommandLine.<init>(LiquibaseCommandLine.java:192)
at liquibase.integration.commandline.LiquibaseCommandLine.main(LiquibaseCommandLine.java:100)
... 5 more

Thanks in advance
** Update this seems to be a 4.27 issue, as this works okay on 4.26
Alan

Alan,

Thanks for the report. I’m investigating.

Wesley

Alan,

Apologies for the delay in responding.

From GitHub - liquibase/docker, you might take a look at:

  1. To install the MySQL driver, use -e INSTALL_MYSQL=true. You shouldn’t have to add a bash command.
  2. Be sure to mount your volume that contains the changelog by doing -v c:\projects\my-project\src\main\resources:/liquibase/changelog
  3. Instead of passing so many things on the command line, try a properties file (if you can). See GitHub - liquibase/docker

Also, is there a chance that you are running this from a directory that contains an install of Liquibase? That could account for why you are picking up the duplicate command steps.

Thanks,
Wesley