Oracle Connection (with Java 10 [solved]) (with Docker [?])

Hello guys,
We’re happily using Metabase for 1 year and now we want to implement with one of our new Oracle servers.
I’ve tried with one test installation of Metabase, which is running with metabase.jar file - and it worked perfect!
But our main Metabase installation is on docker - tried to create the plugins folder and put there the ojdbc7 driver - but without success (Oracle selection is missing in Databases)
Our container is not running by script and i dont know where i need to set this MB_PLUGINS env to point to external folder with the driver in it?

Hi @stefanb

Maybe StackOverflow answers like this can give a hint (-e if you do docker run):

Personally I would prefer creating a Docker compose file where you can also give it.

Please share how it goes. It might be that @watthell234 is fighting the same thing in the Snowflake driver test thread …

Unfortunately its not working with docker run -e parameter…
This is my command to run the container : docker run -d -p 3000:3000 -v /home/metabase/metabase-data/metabase.db:/metabase.db -e "MB_PLUGINS_DIR=/home/metabase/metabase-data/metabase.db/plugins" --name metabase metabase/metabase:latest

In dir /home/metabase/metabase-data/metabase.db/plugins is the ojdbc7.jar file.

Installed oracle 8 and 9 java versions and switched to all manual for the tests - but still no success.
Im little confused how easy this was with the standalone version, but with docker is such a nightmare.

I’ve still need help with this.
Created new fresh install and whole new container, but the problem persists.

I’ve tried .jar deploy with Oracle driver on plugin folder. I’ve tried versions 1.4, 6, 7 and 8. The Metabase log seems to load the driver, but Oracle didn’t show up on the database list.

Metabase log
mai 24 10:56:24 INFO metabase.plugins :: Loading plugins in directory C:\Metabase\plugins…
mai 24 10:56:24 INFO metabase.plugins :: Loading plugin C:\Metabase\plugins\ojdbc7.jar…
mai 24 10:56:27 INFO metabase.core :: Setting up and migrating Metabase DB. Please sit tight, this may take a minute…
mai 24 10:56:27 INFO metabase.db :: Verifying h2 Database Connection …
mai 24 10:56:27 INFO metabase.db :: Verify Database Connection …
mai 24 10:56:27 INFO metabase.db :: Running Database Migrations…
mai 24 10:56:27 INFO metabase.db :: Setting up Liquibase…

I don’t know what else to do.
Seems that a lot of people are having this problem without a solution so far.

With versions you mention I presume you mean Oracle JDBC driver versions.

Which Java and Metabase version are you on? There are e.g. some Java9 quirks mentioned in the official Metabase docs.

Also it was fairly recently (in v 0.29.x) found that there were some jar signing issues in relation to plugins with the SparkSQL driver in plugins mentioned on GitHub. I’m wondering if there could be something similar at play here.

Thanks jornh.

I’m using java 10.0.1
Metabase is 0.29.3
Ojdbc is 8

Metabase log shows plugin being loaded (Loading plugins in directory…Loading plugin ojdbc8.jar), but nothing else.

Tried Docker and Ubuntu and Windows through .jar deploy. Nothing works to me.

I have no idea about your issue (not using Oracle DB myself)

A quick google for it didn’t reveal anything about java 10 being supported (googling for “10” with Oracle ODBC and java typically gives a lot of hits on db version 10 :frowning:) … here’s specific mention of just Java 8 being officially supported: http://www.oracle.com/technetwork/database/features/jdbc/jdbc-ucp-122-3110062.html

I would try dropping Java back to 8.

Also, with Java 9 (so probably also 10) note the JVM option needed to load external plugins:

Thanks for the hint.

I kept Java 10, but needed to add additional dependencies, as mention in https://github.com/metabase/metabase/blob/master/docs/administration-guide/databases/oracle.md

This solved the issue.

As the original thread, maybe could it be the same problem?

Great that you got it working

I don’t think so. The Docker image is running Java 8. You’re manually installing a Java 10 with the Metabase.jar solution.

@stefanb see the post below:

I believe the reason your latest attempt with mounting the driver could be failing because the user:group metabase:metabase inside docker does not have permissions on the host volume - hence the need for chmod in the post.

Another guy just got it working with Docker like this (not sure the modified Docker layer is needed, but posting for completeness):

Hello @jornh,
When run docker exec -it metabase ls -l /app/plugins i’ve got this:
metabase

So this means that the permissions are okay…
I dont know where exactly I need to set MB_PLUGINS_DIR in Docker environment.
Already checked the permissions for plugins dir and they are 777…

This link for oracle doesnt include anything for Docker installation and its not helpful at all…

Permissions OK, yes I think so (but to be honest not 100%). I see in bkbonner’s GitHub issue above that he in his extra docker layer actually overrules the extra good practice not running Metabase as root in the container that recently got added to the official Dockerfile. Anyways, as long as you haven’t set the environment variable then that’s first issue to get sorted.

You can set environment variables with the docker -e option. Another way is adding it in an extra Dockerfile layer as bkbonner does.

Yes, I know the Oracle page isn’t helpful on this. I just saw there’s also a good Docker section in the Troubleshooting Guide - and it nether treats loading of plugins (it is a corner case with combination of both :worried:)

I hope if you can get it running it can either result in docs or code being improved.

It looks like you’re trying to set MB_PLUGINS_DIR to a directory on the Docker host (not a path accessible to the running container). Based on what you write later and the volume you have mounted, you should probably have something like MB_PLUGINS_DIR=/metabase.db/plugins (or /app/plugins if that’s where you ended up putting them).