Metabase not connecting to Redshift DB

Hi,
We are not able to connect with Redshift DB on AWS, we have tried the same using a local machine, a docker container as well but it is not connecting with the Redshift DB,
We are able to connect to the Redshift db using other clients like Postico (postgres db) and quick sight.
but metabase seems to be failing.
We are also able to telnet to the redshift db , but with metabase it is an issue.
We are not able to debug this, need a quick help on this.

@flamber

we are using the latest version of metabase,
https://hub.docker.com/r/metabase/metabase

Hi @rahul.bhatia
Do not tag me, when you create new topics. This forum is for everyone to answer.

  1. Post "Diagnostic Info" from Admin > Troubleshooting
  2. Post the full stacktrace from Admin > Troubleshooting > Logs.

Diagnostic info
{
"browser-info": {
"language": "en-IN",
"platform": "MacIntel",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15",
"vendor": "Apple Computer, Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.12+7",
"java.vendor": "Eclipse Foundation",
"java.vendor.url": "https://adoptium.net/",
"java.version": "11.0.12",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.12+7",
"os.name": "Linux",
"os.version": "4.14.246-187.474.amzn2.x86_64",
"user.language": "en",
"user.timezone": "GMT"
},
"metabase-info": {
"databases": [
"h2",
"redshift"
],
"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": "2021-10-21",
"tag": "v0.41.1",
"branch": "release-x.41.x",
"hash": "76aa4a5"
},
"settings": {
"report-timezone": null
}
}
}

metabase admin troubleshooting logs

@rahul.bhatia It says the host does not exist. Either you have input a wrong hostname or you're having DNS problems.

Not exactly sure why it would say that, we are able to connect with the same host via postico, telnet and quick sight in the same network.
Metabase was synched with the database until yesterday. The issue seems to have come in today.

Also we have specified IP, instead of a DNS hostname to connect to the db.

@rahul.bhatia
Let's start completely over, since it sounds like you are not providing all the information.

  1. How long have you used Metabase for? Specify version.
  2. Did you upgrade and then only then you started having problems? From which version? If it only happened after you upgraded, then revert to your backup.
  3. If everything was running file yesterday, but not today, then it's likely a problem with networking. That can be DNS, firewalls, etc.
How long have you used Metabase for? Specify version.

Answer: Using it since September 2018.
Current version: v0.40.4
We upgraded it to v0.41.0 18 days ago, but we were facing issues after the upgrade so we rolled back to v0.40.4

Did you upgrade and then only then you started having problems? From which version? If it only happened after you upgraded, then revert to your backup.

Answer: No. Redshift had a minor upgrade last night and we are facing issues since that.
Redshift changelog: https://forums.aws.amazon.com/ann.jspa?annID=8958

If everything was running file yesterday, but not today, then it's likely a problem with networking. That can be DNS, firewalls, etc.

Answer: Everything was running fine yesterday, but not today.
It's not an issue with networking we have ensured that. We did not changed anything at networking and firewall side. We are able to connect to the datasource(redshift) using other clients like postico. We are able to telnet to redshift from metabase.

Edit: Downgrading Redshift to older version fixed the issue.

@rahul.bhatia Okay, you should have started out with all the information.
So the problem wasn't changes to Metabase, but changes to Redshift.

We also faced the same issue when our redshift cluster upgraded.
Its incompatibility of metabase with latest redshift version.
@flamber all other read/write queries were happening to redshift, only metabase queries weren't getting passed.
It seems issue is with redshift.
https://forums.aws.amazon.com/thread.jspa?messageID=998245
I have still not found any solution.

@prakhar Try using DBeaver.io with Redshift driver version 2.0.0.3 (which is the version Metabase uses), and then try one of the newer drivers. If it works with one of the newer drivers, then please report back which versions are working.

Currently it seems like it's an issue with Redshift that they need to solve. Nothing in the driver changelog indicate that one of the newer drivers has addressed anything related to connection problems.

@flamber From this release Postgres JDBC driver version 42.2.13 is no longer working.
The error recieved is:

Cannot connect: Cannot create PoolableConnectionFactory (isValid() returned false)

https://forums.aws.amazon.com/thread.jspa?threadID=347270&tstart=0

Can we change the driver of redshift in newer metabase version, and not use the Redshift driver version 2.0.0.3 as used in DBeaver.io

@prakhar Metabase uses the Redshift driver, not the Postgres driver. (unless you manually selected it)

I don't understand if you are asking a question or making a statement.

I'm saying: DBeaver and Metabase are both Java applications, so they're based on the same drivers. If you can test with DBeaver and see if a newer driver works, then there's a chance that we can upgrade the driver and make a release.

Though, it seems like it's problems with Redshift.

@prakhar We've created an issue, so everything is contained in one place - follow the issue: