Oracle database not working using Metabase in GCP

Hello,

I have written below Dockerfile for Metabase installation in GCP for connecting to Oracle database.

FROM metabase/metabase
COPY ./ojdbc8.jar /plugins/
RUN chmod 777 /plugins/ojdbc8.jar
ENTRYPOINT ["/app/run_metabase.sh"]
EXPOSE 3000

I have build this dockerfile and deployed the image to GKE(Google Kubernetes Engine), but the Oracle database is not getting connected and getting below exceptions,

[eb5ac13a-5bdd-4525-a28a-e487c736758c] 2022-09-08T18:41:34+05:30 ERROR metabase.api.database Cannot connect to Database clojure.lang.ExceptionInfo: IO Error: Connection closed, connect lapse 237 ms., Authentication lapse 0 ms. {:message "IO Error: Connection closed, connect lapse 237 ms., Authentication lapse 0 ms."} at metabase.driver.util$can_connect_with_details_QMARK_.invokeStatic(util.clj:153) at metabase.driver.util$can_connect_with_details_QMARK_.doInvoke(util.clj:126) at clojure.lang.RestFn.invoke(RestFn.java:442) at metabase.api.database$test_database_connection.invokeStatic(database.clj:540) at metabase.api.database$test_database_connection.doInvoke(database.clj:530)

I also tried configuring Mongo DB in Metabase and its working fine. But only issue is with this Oracle DB in Metabase.

Also, i tried deploying same image in my local machine and its working fine there.

The oracle port is open in GCP and also we checked connectivity between GCP and Oracle DB server, its fine.

Can anyone please assist ASAP as to why we are facing issues with Oracle DB in Metabase in GCP.

Hi @techietalkie007
Post "Diagnostic Info" from Admin > Troubleshooting.
And which version of ojdbc you are using.
If it is working on your local machine, but not on GKE, then there must be something that is different, so look through the entire log and compare.

Hi,

Thanks for your response!

I am using ojdbc8.jar as shown in above Dockerfile.

{
"browser-info": {
"language": "en-IN",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.16.1+1",
"java.vendor": "Eclipse Adoptium",
"java.vendor.url": "https://adoptium.net/",
"java.version": "11.0.16.1",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.16.1+1",
"os.name": "Linux",
"os.version": "5.4.188+",
"user.language": "en",
"user.timezone": "GMT"
},
"metabase-info": {
"databases": [
"h2",
"oracle"
],
"hosting-env": "unknown",
"application-database": "h2",
"application-database-details": {
"database": {
"name": "H2",
"version": "1.4.197 (2018-03-18)"
},
"jdbc-driver": {
"name": "H2 JDBC Driver",
"version": "1.4.197 (2018-03-18)"
}
},
"run-mode": "prod",
"version": {
"date": "2022-08-31",
"tag": "v0.44.2",
"branch": "release-x.44.x",
"hash": "8d9de8a"
},
"settings": {
"report-timezone": null
}
}
}

@techietalkie007 How can I see which version of ojdbc you are using?
https://www.oracle.com/database/technologies/appdev/jdbc-downloads.html

Are you sure that GKE is allowed to connect to the database?

If it works on any other platform besides GKE, then use another platform. I cannot tell what the problem is.

I am using below jar file
ojdbc8.jar

Also i see below error messages in the metabase logs. I already checked the network connectivity between Metabase in GKE(Google Kubernetes Engine) and Oracle DB, connectivity is fine.

[eb5ac13a-5bdd-4525-a28a-e487c736758c] 2022-09-08T18:41:34+05:30 ERROR metabase.api.database Cannot connect to Database clojure.lang.ExceptionInfo: IO Error: Connection closed, connect lapse 237 ms., Authentication lapse 0 ms. {:message "IO Error: Connection closed, connect lapse 237 ms., Authentication lapse 0 ms."} at metabase.driver.util$can_connect_with_details_QMARK_.invokeStatic(util.clj:153) at metabase.driver.util$can_connect_with_details_QMARK_.doInvoke(util.clj:126) at clojure.lang.RestFn.invoke(RestFn.java:442) at metabase.api.database$test_database_connection.invokeStatic(database.clj:540) at metabase.api.database$test_database_connection.doInvoke(database.clj:530) at clojure.lang.RestFn.invoke(RestFn.java:425) at metabase.api.setup$fn__77030.invokeStatic(setup.clj:177) at metabase.api.setup$fn__77030.invoke(setup.clj:171) at compojure.core$wrap_response$fn__28102.invoke(core.clj:160) at compojure.core$wrap_route_middleware$fn__28086.invoke(core.clj:132) at compojure.core$wrap_route_info$fn__28091.invoke(core.clj:139) at compojure.core$wrap_route_matches$fn__28095.invoke(core.clj:151) at compojure.core$routes$fn__28114$f__28115.invoke(core.clj:198) at compojure.core$routes$fn__28114$f__28115$respond_SINGLEQUOTE___28116.invoke(core.clj:197) at compojure.core$wrap_route_matches$fn__28095.invoke(core.clj:152) at compojure.core$routes$fn__28114$f__28115.invoke(core.clj:198) at compojure.core$routes$fn__28114$f__28115$respond_SINGLEQUOTE___28116.invoke(core.clj:197) at compojure.core$wrap_route_matches$fn__28095.invoke(core.clj:153) at compojure.core$routes$fn__28114$f__28115.invoke(core.clj:198) at compojure.core$routes$fn__28114.invoke(core.clj:200) at compojure.core$routes$fn__28114$f__28115.invoke(core.clj:198) at compojure.core$routes$fn__28114.invoke(core.clj:200) at compojure.core$make_context$handler__28142.invoke(core.clj:289) at compojure.core$make_context$fn__28146.invoke(core.clj:299)

@techietalkie007
Have a look here https://stackoverflow.com/questions/58319173/cant-connect-to-oracle-19-3-with-19-3-jdbc-driver or https://support.oracle.com/knowledge/Middleware/2747530_1.html
If that doesn't help, then I don't know and connect help - use another platform.