[ 
https://issues.apache.org/jira/browse/NIFI-11845?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mark Bean updated NIFI-11845:
-----------------------------
    Attachment: nifi-registry-app.log

> Upgrade NiFi Registry from 1.22.0 to 1.23.0 fails with H2 database migration 
> failure
> ------------------------------------------------------------------------------------
>
>                 Key: NIFI-11845
>                 URL: https://issues.apache.org/jira/browse/NIFI-11845
>             Project: Apache NiFi
>          Issue Type: Bug
>            Reporter: Mark Bean
>            Priority: Major
>             Fix For: 1.23.0
>
>         Attachments: nifi-registry-app.log
>
>
> Upgrading NiFi Registry 1.22.0 to 1.23.0 failed during RC evaluation. The H2 
> database was not successfully migrated. 
> Procedure for reproducing: Configure and start Registry 1.22.0. Add at least 
> one versioned flow to the Registry.
> Shutdown Registry 1.22.0
> Install Registry 1.23.0. Configuration files have remained the same in 1.23.0 
> (no new or removed properties) so it is safe to copy conf/ directory from 
> 1.22.0 into 1.23.0 installation.
> Copy database/ and flow_storage/ directories from 1.22.0 to 1.23.0 (or 
> reference appropriately in 1.23.0 config files.
> Attempt to start Registry 1.23.0.
> Stack trace is deep. It begins with:
> 023-07-21 13:12:31,815 ERROR [main] o.springframework.boot.SpringApplication 
> Application run failed
> org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
> creating bean with name 'niFiRegistryApiApplication': Unsatisfied dependency 
> expressed through field 'eventService'; nested exception is 
> org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
> creating bean with name 'eventService' defined in URL 
> [jar:file:/opt/apache-nifi/nifi-registry-1.23.0/work/jetty/nifi-registry-web-api-1.23.0.war/webapp/WEB-INF/lib/nifi-registry-framework-1.23.0.jar!/org/apache/nifi/registry/event/EventService.class]:
>  Unsatisfied dependency expressed through constructor parameter 0; nested 
> exception is 
> org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
> creating bean with name 'standardProviderFactory' defined in URL 
> [jar:file:/opt/apache-nifi/nifi-registry-1.23.0/work/jetty/nifi-registry-web-api-1.23.0.war/webapp/WEB-INF/lib/nifi-registry-framework-1.23.0.jar!/org/apache/nifi/registry/provider/StandardProviderFactory.class]:
>  Unsatisfied dependency expressed through constructor parameter 2; nested 
> exception is org.springframework.beans.factory.BeanCreationException: Error 
> creating bean with name 'getDataSource' defined in class path resource 
> [org/apache/nifi/registry/db/DataSourceFactory.class]: Bean instantiation via 
> factory method failed; nested exception is 
> org.springframework.beans.BeanInstantiationException: Failed to instantiate 
> [javax.sql.DataSource]: Factory method 'getDataSource' threw exception; 
> nested exception is java.lang.RuntimeException: H2 database migration failed
>         at 
> org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:662)
>         at 
> org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:642)
>         at 
> org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119)
>         at 
> org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
>         at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431)
>         at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619)
>         at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
>         at 
> org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
>         at 
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
>         at 
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
>         at 
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
>         at 
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
>         at 
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:921)
>         at 
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
>         at 
> org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
>         at 
> org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731)
>         at 
> org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
>         at 
> org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
>         at 
> org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:175)
>         at 
> org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:155)
>         at 
> org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:97)
>         at 
> org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:174)
>         at 
> org.eclipse.jetty.plus.annotation.ContainerInitializer.callStartup(ContainerInitializer.java:142)
>         at 
> org.eclipse.jetty.annotations.ServletContainerInitializersStarter.doStart(ServletContainerInitializersStarter.java:64)
>         at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
>         at 
> org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:356)
>         at 
> org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1449)
>         at 
> org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1414)
>         at 
> org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:916)
>         at 
> org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:288)
>         at 
> org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:524)
>         at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
>         at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
>         at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)
>         at 
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
>         at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
>         at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
>         at org.eclipse.jetty.server.Server.start(Server.java:423)
>         at 
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
>         at 
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
>         at org.eclipse.jetty.server.Server.doStart(Server.java:387)
>         at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
>         at 
> org.apache.nifi.registry.jetty.JettyServer.start(JettyServer.java:93)
>         at org.apache.nifi.registry.NiFiRegistry.<init>(NiFiRegistry.java:110)
>         at org.apache.nifi.registry.NiFiRegistry.main(NiFiRegistry.java:159)
> And more relevant portion related to NiFi code may include:
> Caused by: java.lang.RuntimeException: H2 database migration failed
>         at 
> org.apache.nifi.registry.db.DataSourceFactory.createDataSource(DataSourceFactory.java:104)
>         at 
> org.apache.nifi.registry.db.DataSourceFactory.getDataSource(DataSourceFactory.java:56)
>         at 
> org.apache.nifi.registry.db.DataSourceFactory$$EnhancerBySpringCGLIB$$feffe099.CGLIB$getDataSource$0(<generated>)
>         at 
> org.apache.nifi.registry.db.DataSourceFactory$$EnhancerBySpringCGLIB$$feffe099$$FastClassBySpringCGLIB$$36649477.invoke(<generated>)
>         at 
> org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
>         at 
> org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
>         at 
> org.apache.nifi.registry.db.DataSourceFactory$$EnhancerBySpringCGLIB$$feffe099.getDataSource(<generated>)
>         at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>         at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.base/java.lang.reflect.Method.invoke(Method.java:566)
>         at 
> org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
>         ... 95 common frames omitted



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to