Are there known issues with 4.19.1?

Yesterday I decided to upgrade my liquibase karaf feature from 4.17.1 to the newest version of liquibase on maven central, which was 4.19.1.

However, 4.19.1 didn’t work for me. But 4.19.0 worked fine.

I checked the release notes for 4.19.1 and couldn’t see anything obvious there (I searched especially for “osgi” but couldn’t find anything).

So I came here do the forums to see if there were others with known problems with 4.19.1, before I started on the work to make a bug report (or possibly: change my code to adapt to new behaviour).

But on the top of the forum page was an announcement for liquibase 4.19.0…?

So my question is: should I try to get my code working with liquibase 4.19.1 (or report a bug if impossible), or should I just use 4.19.0 instead?

Thanks!

liquibase 4.20.0 have been released now so I tried it.

I get the same NullPointerException I got from 4.19.1 (but not from 4.19.0):

2023-03-11T13:08:35,899 | ERROR | features-3-thread-1 | SampleDbLiquibaseRunner          | 83 - no.priv.bang.karaf.liquibase.sample - 4.19.1.SNAPSHOT | Error creating sampleapp test database schema
liquibase.exception.LiquibaseException: java.lang.NullPointerException
	at liquibase.Liquibase.runInScope(Liquibase.java:2644) ~[?:?]
	at liquibase.Liquibase.listUnrunChangeSets(Liquibase.java:2286) ~[?:?]
	at liquibase.Liquibase.isUpToDateFastCheck(Liquibase.java:506) ~[?:?]
	at liquibase.Liquibase.lambda$update$1(Liquibase.java:237) ~[?:?]
	at liquibase.Scope.lambda$child$0(Scope.java:187) ~[?:?]
	at liquibase.Scope.child(Scope.java:196) ~[?:?]
	at liquibase.Scope.child(Scope.java:186) ~[?:?]
	at liquibase.Scope.child(Scope.java:165) ~[?:?]
	at liquibase.Liquibase.runInScope(Liquibase.java:2639) ~[?:?]
	at liquibase.Liquibase.update(Liquibase.java:236) ~[?:?]
	at liquibase.Liquibase.update(Liquibase.java:221) ~[?:?]
	at liquibase.Liquibase.update(Liquibase.java:207) ~[?:?]
	at liquibase.Liquibase.update(Liquibase.java:197) ~[?:?]
	at no.priv.bang.karaf.sample.db.liquibase.test.SampleDbLiquibaseRunner.applyLiquibaseChangelist(SampleDbLiquibaseRunner.java:77) ~[?:?]
	at no.priv.bang.karaf.sample.db.liquibase.test.SampleDbLiquibaseRunner.prepare(SampleDbLiquibaseRunner.java:55) ~[?:?]
	at org.ops4j.pax.jdbc.config.impl.DataSourceRegistration.<init>(DataSourceRegistration.java:88) ~[?:?]
	at org.ops4j.pax.jdbc.config.impl.DataSourceConfigManager.lambda$null$4(DataSourceConfigManager.java:95) ~[?:?]
	at org.ops4j.pax.jdbc.config.impl.ServiceTrackerHelper$1.addingService(ServiceTrackerHelper.java:132) ~[?:?]
	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:943) ~[osgi.core-8.0.0.jar:?]
	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:871) ~[osgi.core-8.0.0.jar:?]
	at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256) ~[osgi.core-8.0.0.jar:?]
	at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229) ~[osgi.core-8.0.0.jar:?]
	at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:903) ~[osgi.core-8.0.0.jar:?]
	at org.apache.felix.framework.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:990) ~[?:?]
	at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:838) ~[?:?]
	at org.apache.felix.framework.EventDispatcher.fireServiceEvent(EventDispatcher.java:545) ~[?:?]
	at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4863) ~[?:?]
	at org.apache.felix.framework.Felix.registerService(Felix.java:3834) ~[?:?]
	at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:328) ~[?:?]
	at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:302) ~[?:?]
	at org.ops4j.pax.jdbc.derby.impl.Activator.start(Activator.java:34) ~[?:?]
	at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:849) ~[?:?]
	at org.apache.felix.framework.Felix.activateBundle(Felix.java:2429) ~[?:?]
	at org.apache.felix.framework.Felix.startBundle(Felix.java:2335) ~[?:?]
	at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:1006) ~[?:?]
	at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:992) ~[?:?]
	at org.apache.karaf.features.internal.service.BundleInstallSupportImpl.startBundle(BundleInstallSupportImpl.java:165) ~[?:?]
	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1160) ~[?:?]
	at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:1041) ~[?:?]
	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069) ~[?:?]
	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004) ~[?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
	at java.lang.Thread.run(Thread.java:829) ~[?:?]
Caused by: java.lang.NullPointerException
	at liquibase.Scope.addMdcValue(Scope.java:416) ~[?:?]
	at liquibase.Scope.addMdcValue(Scope.java:406) ~[?:?]
	at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:602) ~[?:?]
	at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:591) ~[?:?]
	at liquibase.Liquibase$16.run(Liquibase.java:2290) ~[?:?]
	at liquibase.Scope.lambda$child$0(Scope.java:187) ~[?:?]
	at liquibase.Scope.child(Scope.java:196) ~[?:?]
	at liquibase.Scope.child(Scope.java:186) ~[?:?]
	at liquibase.Scope.child(Scope.java:165) ~[?:?]
	at liquibase.Liquibase.runInScope(Liquibase.java:2639) ~[?:?]
	... 44 more

So I guess the only way forward is to fix this somehow.

But there isn’t much to go on here. The NullPointerException happens deep down in a stack trace when creating an initial schema.

Hm… could it be that there is something missing from my XML schemas? I haven’t updated the schema version used here for ages?

Here is the schema that causes the above stack trace: liquibase-karaf-feature/db-changelog-1.0.0.xml at master · steinarb/liquibase-karaf-feature · GitHub

Also, this NullPointerException only happens when running in OSGi.

The NullPointerException happens here: liquibase/Scope.java at master · liquibase/liquibase · GitHub

The reason is because getMdcManager() is null

MdcManager seems to be brand new code?
Does it need to be exported as an OSGi capability?

Looks like there is no need to report this as a bug:

It already has been reported and a PR has been provided and has been merged: OSGI Missing Provide-Capability entry for liquibase.logging.mdc.MdcManager · Issue #3910 · liquibase/liquibase · GitHub