Description
Describe the bug
Hey guys, I am trying to upgrade my datahub version from 0.15.0.1 to 1.0.0 but I am getting error related to OpenTelemetry dependency.
Note: everything works fine on version 0.15.0.1 (all environment variables related to otel works as expected).
More details about the trace error below.
To Reproduce
Steps to reproduce the behavior:
- Disable the environment variable
OTEL_SDK_DISABLED = false
for one of the services (GMS e.g.) - Deploy Datahub v1.0.0
- The deploy will not succeed with the following error:
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.datahubproject.metadata.context.TraceContext]: Factory method 'traceContext' threw exception with message: Cannot invoke "Object.getClass()" because "closeable" is null
Expected behavior
OTEL SDK when enabled must works fine in v1.0.0, as this is the behaviour in v0.15.0.1.
Additional context
Full stack trace error:
INFO: [10.162.41.250]:5701 [dev] [5.3.6] Could not connect to: /10.162.42.127:5701. Reason: IOException[Connection refused to address /10.162.42.127:5701] Mar 24, 2025 5:43:49 PM io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder build INFO: Error encountered during autoconfiguration. Closing partially configured components. 2025-03-24 17:43:49,702 [main] WARN o.e.jetty.ee10.webapp.WebAppContext:508 - Failed startup of context osbwej.JettyEmbeddedWebAppContext@5f57fde7{application,/,b=[jar:file:/datahub/datahub-gms/bin/war.war!/, (URL) jar:nested:///datahub/datahub-gms/bin/war.war/!BOOT-INF/lib/swagger-ui-5.10.3.jar!/META-INF/resources/],a=STOPPED,h=oeje10s.SessionHandler@33a4cdba{STOPPED}} org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authFilter' defined in class path resource [com/linkedin/gms/ServletConfig.class]: Unsatisfied dependency expressed through method 'authFilter' parameter 0: Error creating bean with name 'authenticationFilter': Unsatisfied dependency expressed through field '_tokenService': Error creating bean with name 'dataHubTokenService' defined in class path resource [com/linkedin/gms/factory/auth/DataHubTokenServiceFactory.class]: Unsatisfied dependency expressed through method 'getInstance' parameter 0: Error creating bean with name 'systemOperationContext' defined in class path resource [com/linkedin/gms/factory/context/SystemOperationContextFactory.class]: Unsatisfied dependency expressed through method 'javaSystemOperationContext' parameter 10: Error creating bean with name 'traceContext' defined in class path resource [com/linkedin/gms/factory/config/GMSOpenTelemetryConfig.class]: Failed to instantiate [io.datahubproject.metadata.context.TraceContext]: Factory method 'traceContext' threw exception with message: Cannot invoke "Object.getClass()" because "closeable" is null at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:795) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:542) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1355) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1185) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:205) at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:210) at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:201) at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addServletContextInitializerBeans(ServletContextInitializerBeans.java:96) at org.springframework.boot.web.servlet.ServletContextInitializerBeans.<init>(ServletContextInitializerBeans.java:85) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getServletContextInitializerBeans(ServletWebServerApplicationContext.java:266) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.selfInitialize(ServletWebServerApplicationContext.java:240) at org.springframework.boot.web.embedded.jetty.ServletContextInitializerConfiguration.callInitializers(ServletContextInitializerConfiguration.java:65) at org.springframework.boot.web.embedded.jetty.ServletContextInitializerConfiguration.configure(ServletContextInitializerConfiguration.java:54) at org.eclipse.jetty.ee10.webapp.Configurations.configure(Configurations.java:505) at org.eclipse.jetty.ee10.webapp.WebAppContext.configure(WebAppContext.java:480) at org.eclipse.jetty.ee10.webapp.WebAppContext.startContext(WebAppContext.java:1296) at org.eclipse.jetty.ee10.servlet.ServletContextHandler.lambda$doStart$0(ServletContextHandler.java:1047) at org.eclipse.jetty.server.handler.ContextHandler$ScopedContext.call(ContextHandler.java:1452) at org.eclipse.jetty.ee10.servlet.ServletContextHandler.doStart(ServletContextHandler.java:1044) at org.eclipse.jetty.ee10.webapp.WebAppContext.doStart(WebAppContext.java:499) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169) at org.eclipse.jetty.server.Server.start(Server.java:641) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:120) at org.eclipse.jetty.server.Handler$Abstract.doStart(Handler.java:491) at org.eclipse.jetty.server.Server.doStart(Server.java:582) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93) at org.springframework.boot.web.embedded.jetty.JettyWebServer.initialize(JettyWebServer.java:120) at org.springframework.boot.web.embedded.jetty.JettyWebServer.<init>(JettyWebServer.java:87) at org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory.getJettyWebServer(JettyServletWebServerFactory.java:480) at org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory.getWebServer(JettyServletWebServerFactory.java:194) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:188) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:162) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:619) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) at org.springframework.boot.SpringApplication.run(SpringApplication.java:335) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1363) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1352) at com.linkedin.gms.GMSApplication.main(GMSApplication.java:19) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:569) at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:102) at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:64) at org.springframework.boot.loader.launch.JarLauncher.main(JarLauncher.java:40) Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authenticationFilter': Unsatisfied dependency expressed through field '_tokenService': Error creating bean with name 'dataHubTokenService' defined in class path resource [com/linkedin/gms/factory/auth/DataHubTokenServiceFactory.class]: Unsatisfied dependency expressed through method 'getInstance' parameter 0: Error creating bean with name 'systemOperationContext' defined in class path resource [com/linkedin/gms/factory/context/SystemOperationContextFactory.class]: Unsatisfied dependency expressed through method 'javaSystemOperationContext' parameter 10: Error creating bean with name 'traceContext' defined in class path resource [com/linkedin/gms/factory/config/GMSOpenTelemetryConfig.class]: Failed to instantiate [io.datahubproject.metadata.context.TraceContext]: Factory method 'traceContext' threw exception with message: Cannot invoke "Object.getClass()" because "closeable" is null at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:788) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:768) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:145) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:509) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1439) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1443) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1353) at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:904) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:782) ... 52 common frames omitted Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dataHubTokenService' defined in class path resource [com/linkedin/gms/factory/auth/DataHubTokenServiceFactory.class]: Unsatisfied dependency expressed through method 'getInstance' parameter 0: Error creating bean with name 'systemOperationContext' defined in class path resource [com/linkedin/gms/factory/context/SystemOperationContextFactory.class]: Unsatisfied dependency expressed through method 'javaSystemOperationContext' parameter 10: Error creating bean with name 'traceContext' defined in class path resource [com/linkedin/gms/factory/config/GMSOpenTelemetryConfig.class]: Failed to instantiate [io.datahubproject.metadata.context.TraceContext]: Factory method 'traceContext' threw exception with message: Cannot invoke "Object.getClass()" because "closeable" is null at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:795) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:542) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1355) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1185) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1443) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1353) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:785) ... 67 common frames omitted Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'systemOperationContext' defined in class path resource [com/linkedin/gms/factory/context/SystemOperationContextFactory.class]: Unsatisfied dependency expressed through method 'javaSystemOperationContext' parameter 10: Error creating bean with name 'traceContext' defined in class path resource [com/linkedin/gms/factory/config/GMSOpenTelemetryConfig.class]: Failed to instantiate [io.datahubproject.metadata.context.TraceContext]: Factory method 'traceContext' threw exception with message: Cannot invoke "Object.getClass()" because "closeable" is null at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:795) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:542) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1355) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1185) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1443) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1353) at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:904) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:782) ... 80 common frames omitted Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'traceContext' defined in class path resource [com/linkedin/gms/factory/config/GMSOpenTelemetryConfig.class]: Failed to instantiate [io.datahubproject.metadata.context.TraceContext]: Factory method 'traceContext' threw exception with message: Cannot invoke "Object.getClass()" because "closeable" is null at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:648) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:485) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1355) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1185) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1443) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1353) at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:904) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:782) ... 94 common frames omitted Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.datahubproject.metadata.context.TraceContext]: Factory method 'traceContext' threw exception with message: Cannot invoke "Object.getClass()" because "closeable" is null at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:178) at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:644) ... 108 common frames omitted Caused by: java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "closeable" is null at io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder.build(AutoConfiguredOpenTelemetrySdkBuilder.java:517) at com.linkedin.gms.factory.system_telemetry.OpenTelemetryBaseFactory.openTelemetry(OpenTelemetryBaseFactory.java:78) at com.linkedin.gms.factory.system_telemetry.OpenTelemetryBaseFactory.traceContext(OpenTelemetryBaseFactory.java:24) at com.linkedin.gms.factory.config.GMSOpenTelemetryConfig.traceContext(GMSOpenTelemetryConfig.java:19) at com.linkedin.gms.factory.config.GMSOpenTelemetryConfig$$SpringCGLIB$$0.CGLIB$traceContext$1(<generated>) at com.linkedin.gms.factory.config.GMSOpenTelemetryConfig$$SpringCGLIB$$FastClass$$1.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:258) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:348) at com.linkedin.gms.factory.config.GMSOpenTelemetryConfig$$SpringCGLIB$$0.traceContext(<generated>) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:569) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:146) ... 109 common frames omitted 2025-03-24 17:43:49,709 [main] INFO org.eclipse.jetty.server.Server:650 - Stopped oejs.Server@3d4d2e29{STOPPING}[12.0.16,sto=0]