Hey has anyone had issues using the `datahub-upgra...
# troubleshoot
l
Hey has anyone had issues using the
datahub-upgrade
docker image for restoring indices using postgres? When i set my driver to
org.postgresql.Driver
i get complaints 😞
Copy code
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.ebean.EbeanServer]: Factory method 'createServer' threw exception; nested exception is java.lang.IllegalStateException: Problem loading Database Driver ["org.postgresql.Driver"]: "org.postgresql.Driver"
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.3.19.jar!/:5.3.19]
        at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.19.jar!/:5.3.19]
        ... 41 common frames omitted
Caused by: java.lang.IllegalStateException: Problem loading Database Driver ["org.postgresql.Driver"]: "org.postgresql.Driver"
        at io.ebean.datasource.pool.ConnectionPool.initialise(ConnectionPool.java:281) ~[ebean-datasource-4.3.3.jar!/:na]
        at io.ebean.datasource.pool.ConnectionPool.<init>(ConnectionPool.java:246) ~[ebean-datasource-4.3.3.jar!/:na]
        at io.ebean.datasource.core.Factory.createPool(Factory.java:15) ~[ebean-datasource-4.3.3.jar!/:na]
        at io.ebeaninternal.server.core.DefaultContainer.getDataSourceFromConfig(DefaultContainer.java:273) ~[ebean-11.33.3.jar!/:na]
        at io.ebeaninternal.server.core.DefaultContainer.setDataSource(DefaultContainer.java:217) ~[ebean-11.33.3.jar!/:na]
        at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:103) ~[ebean-11.33.3.jar!/:na]
        at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:35) ~[ebean-11.33.3.jar!/:na]
        at io.ebean.EbeanServerFactory.createInternal(EbeanServerFactory.java:109) ~[ebean-11.33.3.jar!/:na]
        at io.ebean.EbeanServerFactory.create(EbeanServerFactory.java:70) ~[ebean-11.33.3.jar!/:na]
        at com.linkedin.gms.factory.entity.EbeanServerFactory.createServer(EbeanServerFactory.java:33) ~[factories.jar!/:na]
        at com.linkedin.gms.factory.entity.EbeanServerFactory$$EnhancerBySpringCGLIB$$20a9f406.CGLIB$createServer$0(<generated>) ~[factories.jar!/:na]
        at com.linkedin.gms.factory.entity.EbeanServerFactory$$EnhancerBySpringCGLIB$$20a9f406$$FastClassBySpringCGLIB$$15968b0e.invoke(<generated>) ~[factories.jar!/:na]
        at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.3.19.jar!/:5.3.19]
        at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-5.3.19.jar!/:5.3.19]
        at com.linkedin.gms.factory.entity.EbeanServerFactory$$EnhancerBySpringCGLIB$$20a9f406.createServer(<generated>) ~[factories.jar!/:na]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_332]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_332]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_332]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_332]
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.19.jar!/:5.3.19]
        ... 42 common frames omitted
Caused by: java.lang.ClassNotFoundException: "org.postgresql.Driver"
        at java.net.URLClassLoader.findClass(URLClassLoader.java:387) ~[na:1.8.0_332]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[na:1.8.0_332]
        at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:151) ~[datahub-upgrade.jar:na]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[na:1.8.0_332]
        at java.lang.Class.forName0(Native Method) ~[na:1.8.0_332]
        at java.lang.Class.forName(Class.java:348) ~[na:1.8.0_332]
        at io.ebean.datasource.pool.ConnectionPool.initialise(ConnectionPool.java:276) ~[ebean-datasource-4.3.3.jar!/:na]
        ... 61 common frames omitted
b
Uh oh! We have not seen this one. It is possible that the driver class is not being pulled into this module appropriately
l
😢 i did notice that in the gradle build it does have
Copy code
runtime externalDependency.mysqlConnector
  runtime externalDependency.postgresql
but maybe thats not the correct external dependency
b
hm
l
Hm yeah I can reproduce it from the current master branch too
I can also see it in its dependencies 😬 so not sure
Copy code
+--- mysql:mysql-connector-java:8.0.20
|    \--- com.google.protobuf:protobuf-java:3.6.1 -> 3.19.4
+--- org.postgresql:postgresql:42.3.3
|    \--- org.checkerframework:checker-qual:3.5.0
Ah i think it maybe doesnt like the fact that i entered my environment variable as
EBEAN_DATASOURCE_DRIVER="org.postgres.Driver"
I got rid of the quotes and now i get the same behaviour as https://datahubspace.slack.com/archives/C029A3M079U/p1654801111368039