Informatievlaanderen / VSDS-LDESServer4J

Linked Data Event Streams Server for Java
https://informatievlaanderen.github.io/VSDS-LDESServer4J
European Union Public License 1.2
10 stars 11 forks source link

Upgrade 2.3.0 to 2.13.0-SNAPSHOT #1258

Closed brechtvdv closed 7 months ago

brechtvdv commented 7 months ago

Received following error when booting new version of LDES server:

WARN 1 --- [           main] o.a.c.loader.WebappClassLoaderBase       : The web application [ROOT] appears to have started a thread named [BatchSpanProcessor_WorkerThread-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
2024-04-11T11:01:10.211713982Z  java.base/jdk.internal.misc.Unsafe.park(Native Method)
2024-04-11T11:01:10.211732374Z  java.base/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:269)
2024-04-11T11:01:10.211741310Z  java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1758)
2024-04-11T11:01:10.211745633Z  java.base/java.util.concurrent.ArrayBlockingQueue.poll(ArrayBlockingQueue.java:435)
2024-04-11T11:01:10.211749253Z  io.opentelemetry.sdk.trace.export.BatchSpanProcessor$Worker.run(BatchSpanProcessor.java:252)
2024-04-11T11:01:10.211753218Z  java.base/java.lang.Thread.run(Thread.java:1583)
brechtvdv commented 7 months ago

When trying locally and the same happens on the server:

ldes.server                            | 2024-04-11T12:39:44.902Z ERROR 1 --- [           main] o.s.boot.SpringApplication               : Application run failed
ldes.server                            | 
ldes.server                            | org.springframework.data.mapping.model.MappingInstantiationException: Failed to instantiate be.vlaanderen.informatievlaanderen.ldes.server.admin.mongo.eventstream.entity.EventStreamEntity using constructor public be.vlaanderen.informatievlaanderen.ldes.server.admin.mongo.eventstream.entity.EventStreamEntity(java.lang.String,java.lang.String,java.lang.String,boolean) with arguments touristattractions,http://www.w3.org/ns/prov#generatedAtTime,http://purl.org/dc/terms/isVersionOf,null
ldes.server                            |        at org.springframework.data.mapping.model.ClassGeneratingEntityInstantiator$EntityInstantiatorAdapter.createInstance(ClassGeneratingEntityInstantiator.java:278) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:na]
ldes.server                            |        at org.springframework.data.mapping.model.ClassGeneratingEntityInstantiator.createInstance(ClassGeneratingEntityInstantiator.java:98) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:na]
ldes.server                            |        at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:507) ~[mongo-admin-repository-jar-with-dependencies.jar:na]
ldes.server                            |        at org.springframework.data.mongodb.core.convert.MappingMongoConverter.readDocument(MappingMongoConverter.java:475) ~[mongo-admin-repository-jar-with-dependencies.jar:na]
ldes.server                            |        at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:411) ~[mongo-admin-repository-jar-with-dependencies.jar:na]
ldes.server                            |        at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:407) ~[mongo-admin-repository-jar-with-dependencies.jar:na]
ldes.server                            |        at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:118) ~[mongo-admin-repository-jar-with-dependencies.jar:na]
ldes.server                            |        at org.springframework.data.mongodb.core.MongoTemplate$ReadDocumentCallback.doWith(MongoTemplate.java:3217) ~[mongo-admin-repository-jar-with-dependencies.jar:na]
ldes.server                            |        at org.springframework.data.mongodb.core.MongoTemplate.executeFindMultiInternal(MongoTemplate.java:2851) ~[mongo-admin-repository-jar-with-dependencies.jar:na]
ldes.server                            |        at org.springframework.data.mongodb.core.MongoTemplate.doFind(MongoTemplate.java:2556) ~[mongo-admin-repository-jar-with-dependencies.jar:na]
ldes.server                            |        at org.springframework.data.mongodb.core.MongoTemplate.doFind(MongoTemplate.java:2537) ~[mongo-admin-repository-jar-with-dependencies.jar:na]
ldes.server                            |        at org.springframework.data.mongodb.core.MongoTemplate.find(MongoTemplate.java:865) ~[mongo-admin-repository-jar-with-dependencies.jar:na]
ldes.server                            |        at org.springframework.data.mongodb.repository.support.SimpleMongoRepository.findAll(SimpleMongoRepository.java:354) ~[mongo-admin-repository-jar-with-dependencies.jar:na]
ldes.server                            |        at org.springframework.data.mongodb.repository.support.SimpleMongoRepository.findAll(SimpleMongoRepository.java:136) ~[mongo-admin-repository-jar-with-dependencies.jar:na]
ldes.server                            |        at org.springframework.data.mongodb.repository.support.SimpleMongoRepository.findAll(SimpleMongoRepository.java:63) ~[mongo-admin-repository-jar-with-dependencies.jar:na]
ldes.server                            |        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[na:na]
ldes.server                            |        at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[na:na]
ldes.server                            |        at org.springframework.data.repository.core.support.RepositoryMethodInvoker$RepositoryFragmentMethodInvoker.lambda$new$0(RepositoryMethodInvoker.java:288) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:na]
ldes.server                            |        at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:136) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:na]
ldes.server                            |        at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:120) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:na]
ldes.server                            |        at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:516) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:na]
ldes.server                            |        at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:285) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:na]
ldes.server                            |        at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:628) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:na]
ldes.server                            |        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:6.0.13]
ldes.server                            |        at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke(QueryExecutorMethodInterceptor.java:168) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:na]
ldes.server                            |        at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke(QueryExecutorMethodInterceptor.java:143) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:na]
ldes.server                            |        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:6.0.13]
ldes.server                            |        at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:72) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:na]
ldes.server                            |        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:6.0.13]
ldes.server                            |        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:6.0.13]
ldes.server                            |        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:6.0.13]
ldes.server                            |        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:244) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:6.0.13]
ldes.server                            |        at jdk.proxy2/jdk.proxy2.$Proxy157.findAll(Unknown Source) ~[na:na]
ldes.server                            |        at be.vlaanderen.informatievlaanderen.ldes.server.admin.mongo.eventstream.EventStreamMongoRepository.retrieveAllEventStreams(EventStreamMongoRepository.java:21) ~[mongo-admin-repository-jar-with-dependencies.jar:na]
ldes.server                            |        at be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.eventstream.services.EventStreamServiceImpl.initEventStream(EventStreamServiceImpl.java:132) ~[ldes-server-admin-jar-with-dependencies.jar:na]
ldes.server                            |        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[na:na]
ldes.server                            |        at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[na:na]
ldes.server                            |        at org.springframework.context.event.ApplicationListenerMethodAdapter.doInvoke(ApplicationListenerMethodAdapter.java:348) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:6.0.13]
ldes.server                            |        at org.springframework.context.event.ApplicationListenerMethodAdapter.processEvent(ApplicationListenerMethodAdapter.java:233) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:6.0.13]
ldes.server                            |        at org.springframework.context.event.ApplicationListenerMethodAdapter.onApplicationEvent(ApplicationListenerMethodAdapter.java:165) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:6.0.13]
ldes.server                            |        at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:6.0.13]
ldes.server                            |        at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:6.0.13]
ldes.server                            |        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:6.0.13]
ldes.server                            |        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:445) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:6.0.13]
ldes.server                            |        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:6.0.13]
ldes.server                            |        at org.springframework.boot.context.event.EventPublishingRunListener.ready(EventPublishingRunListener.java:109) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:3.1.5]
ldes.server                            |        at org.springframework.boot.SpringApplicationRunListeners.lambda$ready$6(SpringApplicationRunListeners.java:80) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:3.1.5]
ldes.server                            |        at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[na:na]
ldes.server                            |        at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:3.1.5]
ldes.server                            |        at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:3.1.5]
ldes.server                            |        at org.springframework.boot.SpringApplicationRunListeners.ready(SpringApplicationRunListeners.java:80) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:3.1.5]
ldes.server                            |        at org.springframework.boot.SpringApplication.run(SpringApplication.java:335) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:3.1.5]
ldes.server                            |        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:3.1.5]
ldes.server                            |        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:3.1.5]
ldes.server                            |        at be.vlaanderen.informatievlaanderen.ldes.server.Application.main(Application.java:12) ~[classes!/:na]
ldes.server                            |        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[na:na]
ldes.server                            |        at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[na:na]
ldes.server                            |        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[ldes-server-application.jar:na]
ldes.server                            |        at org.springframework.boot.loader.Launcher.launch(Launcher.java:95) ~[ldes-server-application.jar:na]
ldes.server                            |        at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[ldes-server-application.jar:na]
ldes.server                            |        at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:466) ~[ldes-server-application.jar:na]
ldes.server                            | Caused by: java.lang.IllegalArgumentException: Parameter versionCreationEnabled must not be null
ldes.server                            |        at org.springframework.util.Assert.notNull(Assert.java:204) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:6.0.13]
ldes.server                            |        at be.vlaanderen.informatievlaanderen.ldes.server.admin.mongo.eventstream.entity.EventStreamEntity_Instantiator_j7dzin.newInstance(Unknown Source) ~[mongo-admin-repository-jar-with-dependencies.jar:na]
ldes.server                            |        at org.springframework.data.mapping.model.ClassGeneratingEntityInstantiator$EntityInstantiatorAdapter.createInstance(ClassGeneratingEntityInstantiator.java:276) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:na]
ldes.server                            |        ... 60 common frames omitted
ldes.server                            | 
brechtvdv commented 7 months ago

So it expects parameter versionCreationEnabled which didn't exist in 2.3.0

jobulcke commented 7 months ago

Hi Brecht Since version 2.12.0-SNAPSHOT, a new property is added to our event stream named versionCreationEnabled, which is used for determine if an event stream can ingest state objects or version objects. The above error indicates that the latest mongock changeset has not ran. This changeset will add the default value (false) to each existing eventstream. Add the following config to the application.yml to run the required changeset:

mongock:
  migration-scan-package:
    - be.vlaanderen.informatievlaanderen.ldes.server.infra.mongo.mongock.changeset15

The following config will scan always for every new changeset:

mongock:
    migration-scan-package: VSDS

If the error still occurs after this, further investigation will be done

jobulcke commented 7 months ago

Further investigation showed that Mongock ran too late in the application, resuling in the above error. This is now resolved in #1266