Failing to Connect to Local Data Warehouse

Alright this is my first real attempt at setting things up between Metabase and Hydra so I apologize if I'm not providing nearly enough information.

Basically, I've set up a local instance of both Hydra and Metabase to do some testing,

I've got both containers running in docker, Hydra is set up and connected to my Postgres DB and is listening for communications, but when I enter the host name and credentials into Metabase during the Add Database process, it attempts to connect and then sends out the following 400 Error in the logs:

ERROR metabase.api.database Cannot connect to Database
clojure.lang.ExceptionInfo: The connection attempt failed. {:message "The connection attempt failed."}

I don't have a ton of experience with environment setup so I feel like I'm likely missing something simple, but I was wondering if anyone could give me a nudge in the right direction.

Hi @zDogwatch ,
this is probably a silly question, but let's start there - are both Docker images running on the same network (i.e. can they see each other)?

Network and hosts that you're trying to use to connect would be useful info for further debugging.

So I have them running on the following, both on local host in their own separate docker containers




I've been able to connect my postgres db to Metabase, but after disconnecting it from metabase and connecting it to hydra, Metabase refuses to connect to hydra. As far as whether or not they can see each other, I'm not sure how or where to check that.

I would start here:

You can also see the official guide that shows how to connect Metabase to PG. See how both containers are explicitly instructed to connect to the same network.

I don't have much experience with the Docker but when you mentioned connection problems, the network layer was the first thing I thought of.

Btw, how did you start those containers? Feel free to share the commands if you used CLI, or the Docker compose file if you used it instead.

1 Like

Hey again,

Thanks for the help, I'm having a read through those now.

Metabase was started in docker desktop after using the quick start options here: Running Metabase on Docker

Hydra was started using docker compose as outlined in their open source repo:

git clone GitHub - HydrasDB/hydra: The open source Snowflake alternative. OLAP Postgres && cd hydra
cp .env.example .env
docker compose up
psql postgres://postgres:hydra@

I did run into an issue using the last command

psql postgres://postgres:hydra@

it just didn't appear to do anything when I ran it.

Anyway, I'm going to check out that documentation and fiddle with things a bit more. The team at hydra has me in their discord as well so I can always reach out there as well.

Hi @zDogwatch, remember that Docker has its own networking. So if you start a container on one side and then a stack of containers on the other side, they won't be able to see each other as they're in different network.

I just did a few tweaks to the compose file you're using so you can have everything into the same compose file:

    container_name: metabase
    hostname: metabase
    image: metabase/metabase:v0.45.1
      - 3000:3000
      - metanet1
    container_name: hydra
    hostname: hydra
      - ${POSTGRES_PORT}:5432
      - metanet1
      - ./volumes/db:/var/lib/postgresql/data
    driver: bridge

once the containers start, Metabase will be available in localhost:3000

1 Like

Hey Luiggi,

Thanks for that, that definitely moved me along. It looks for sure like my issue is my lack of experience with Docker then. That unstuck me and I'm understanding what you mean now by having it running in the separate stack of containers.

Thanks again for your help.

Okay so I finally got around to returning to this. After a lot of learning about Docker and some additional troubleshooting I've connected the two together.

Essentially I was running psql on my local computer, and not bashing into the container to generate the sample_data database. This was causing the Database not to be found, because well... it didn't exist.

Soooo at the end of the day it was just user error.

Thanks to Luiggi and nemanja for your help. It set me on the right path.