Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ship Google cloud (GCP) socket factories for MySQL and Postgres with Metabase #27117

Open
camsaul opened this issue Dec 9, 2022 · 7 comments

Comments

@camsaul
Copy link
Member

camsaul commented Dec 9, 2022

Creating this meta-issue to track shipping com.google.cloud.sql.mysql.SocketFactory (com.google.cloud.sql/mysql-socket-factory) and com.google.cloud.sql/postgres-socket-factory with Metabase.

We tried to do this in #19302 and #25345 but had to revert it in #23976 because it broke BigQuery support. We can't really do anything about this until Google fixes their own stuff so their socket factories don't break BigQuery support if they're used together. But I'm opening this issue so we have a central place to track this problem going forward so we can close out other stuff that's only tangentially related to solving this specific problem.

@camsaul camsaul changed the title Ship Google cloud socket factories for MySQL and Postgres with Metabase Ship Google cloud (GCP) socket factories for MySQL and Postgres with Metabase Dec 9, 2022
@camsaul
Copy link
Member Author

camsaul commented Dec 9, 2022

See also #27116. To use this for MySQL for data warehouse databases we'll want to address that issue first

@vr
Copy link

vr commented Jan 10, 2023

Hi @camsaul is there a ticket on google side which report what is breaking ? should i ask myself ?

@camsaul
Copy link
Member Author

camsaul commented Jan 11, 2023

I don't know if there's an upstream ticket, if you want to open one that would be great!

@e-gaulue
Copy link

e-gaulue commented Feb 3, 2023

Hi @camsaul and @paoliniluis,

I'm coming from #28044 but I don't really agree those are linked.

This issue states:

Creating this meta-issue to track shipping com.google.cloud.sql.mysql.SocketFactory (com.google.cloud.sql/mysql-socket-factory) and com.google.cloud.sql/postgres-socket-factory with Metabase.

Mine is:
Use MariaDB "localSocket" jdbc parameter to connect localhost MariaDB server through "internal" unix socket.

I'm not even sure SocketFactory is involved. As metabase use MariaDB jdbc driver (alias MariaDB Connector/J), unix socket to the local machine is included. You just need those JNA deps according to the documentation. (example with phpstorm if you don't include them: https://youtrack.jetbrains.com/issue/DBE-13645/JDBC-connection-to-local-MariaDB-socket-verified-shell-command-line-FAILs-from-within-Idea-IDE-FAILED-connect-The-address-cant).

BigQuery should not be a problem to local unix socket.

Could anyone confirm?

@e-gaulue
Copy link

Hi @camsaul and @paoliniluis,

Just to say that when you do:

--- a/deps.edn
+++ b/deps.edn
@@ -125,6 +125,9 @@
   org.liquibase/liquibase-core              {:mvn/version "4.10.0"              ; migration management (Java lib)
                                              :exclusions  [ch.qos.logback/logback-classic]}
   org.mariadb.jdbc/mariadb-java-client      {:mvn/version "2.7.6"}              ; MySQL/MariaDB driver
+  net.java.dev.jna/jna                     {:mvn/version "5.13.0"}
+  net.java.dev.jna/jna-platform                    {:mvn/version "5.13.0"}
   org.mindrot/jbcrypt                       {:mvn/version "0.4"}                ; Crypto library
   org.postgresql/postgresql                 {:mvn/version "42.5.0"}             ; Postgres driver
   org.quartz-scheduler/quartz               {:mvn/version "2.3.2"}              ; Quartz job scheduler, provided by quartzite but this is a newer version.

and then build, you can use local unix socket connection to MySQL/MariaDB.

If the metabase user is configure to access MariaDB through unix_socket (that is recommended on localhost or through SSH), then no need to expose any password in the system service file. It's also good for performance.

It solve #28044 that has been closed to link it here.

Regards,

@paoliniluis
Copy link
Contributor

I'll leave the response to @camsaul here as adding dependencies to the project needs a holistic approach

@camsaul
Copy link
Member Author

camsaul commented Mar 13, 2023

I've reopened #28044, it should be a separate issue since this is Google Cloud specific

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants