metabase / metabase

The simplest, fastest way to get business intelligence and analytics to everyone in your company :yum:
https://metabase.com
Other
38.08k stars 5.05k forks source link

Unable to Change SSH Tunnel Port for Metabase Database Connection #33107

Open HenriqueOtsuka opened 1 year ago

HenriqueOtsuka commented 1 year ago

Describe the bug

I'm experiencing an issue when attempting to change the SSH Tunnel Port to connect to my database with Metabase. Other applications are connecting successfully through the newly specified port, but Metabase seems unable to establish the connection.

Metabase fails to connect to the database using the new port, while other applications, including my RDBMS and scripts, are able to connect without issues.

To Reproduce

1 - Navigate to Metabase Administration and attempt to change the SSH Port via GUI. Note: I encountered an issue here and was unable to change the port through the GUI.

2 - Modified the JSON configuration in the database used by Metabase to manually update the SSH Port. Attempt to establish the connection using the new port.

Expected behavior

Metabase should successfully connect to the database via the newly specified SSH Tunnel Port.

Logs

[e490d0bb-08a2-4e7b-b90b-2e1663648991] 2023-08-10T16:00:46-03:00 ERROR metabase.models.field-values Error fetching field values org.apache.sshd.common.SshException: DefaultConnectFuture[my-user@/my-ip:my-sshport]: Failed to get operation result within specified timeout: 30000

Information about your Metabase installation

{
  "browser-info": {
    "language": "pt-BR",
    "platform": "Linux x86_64",
    "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.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.19+7",
    "java.vendor": "Eclipse Adoptium",
    "java.vendor.url": "https://adoptium.net/",
    "java.version": "11.0.19",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.19+7",
    "os.name": "Linux",
    "os.version": "4.14.252-195.483.amzn2.x86_64",
    "user.language": "en",
    "user.timezone": "GMT"
  },
  "metabase-info": {
    "databases": [
      "googleanalytics",
      "postgres"
    ],
    "hosting-env": "unknown",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "11.20 (Ubuntu 11.20-1.pgdg18.04+1)"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.5.1"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2023-07-24",
      "tag": "v0.46.6.2",
      "branch": "patch-google-sso-button",
      "hash": "a4c740a"
    },
    "settings": {
      "report-timezone": null
    }
  }
}

Severity

Highest

Additional context

I was able to revert to port 22, but I'm still seeking a solution to utilize a different port.

I've run extensive tests to verify that the problem is specific to Metabase.

I've checked logs for specific error messages (please include any relevant logs or error messages if applicable).

I am currently undergoing an audit process, and compliance with security rules is essential. One of these rules mandates not using the default SSH port (22). This requirement is critical to our security posture, and resolving this issue is urgent to ensure compliance.

darksciencebase commented 1 year ago

@HenriqueOtsuka thank you for the report, we'll triage the issue. In the meantime: I couldn't help but notice that you're running version 0.46.6.2. Please upgrade to 0.46.7, as per the security advisory: https://www.metabase.com/blog/security-advisory-h2

HenriqueOtsuka commented 1 year ago

@darksciencebase Thank you for the advise! I will perform this upgrade now.

paoliniluis commented 1 year ago

What issue did you see when changing the port through the gui?

image

HenriqueOtsuka commented 1 year ago

I don't see any error in the GUI, but my database doesn't connect with other SSH Tunnel Port and don't change into the internal Metabase database.

Even if I change the value directly into the database, the tunnel can't be connected.

perivamsi commented 2 months ago

@HenriqueOtsuka are you still facing this issue? which version of Metabase are you using right now?

metamben commented 2 months ago

@HenriqueOtsuka, I cannot reproduce the problem, see the screenshot about a connection to a postgresql DB via SSH over port 23. Can you give more details what and how you are doing?

Image