hasura / hasura/graphql-engine

Hasura with postgres connection

Open
#9,417 5 comments 0 reactions 0 assignees View on GitHub
k/bug
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

Hello I was trying to connect Hasura to an already existing database of postgres. I tried all three methods as ENV variables, URL, and connection parameters. note that I have docker of both Hasura and postgres in different
![Screenshot from 2023-02-06 17-52-53](https://user-images.githubusercontent.com/69847543/216973784-dd849ad8-24b3-45bd-856a-419c827e75b0.png)
docker-compose: Following are specifications [ { "definition": "name", "message": "connection to the server at "localhost" (127.0.0.1), port 5432 failed: Connection refused\n\tIs the server running on that host and accepting TCP/IP connections?\nconnection to server at "localhost" (::1), port 5432 failed: Cannot assign requested address\n\tIs the server running on that host and accepting TCP/IP connections?\n", "name": "source name", "reason": "Inconsistent object: connection error", "type": "source" } ]

Both docker containers are running and even with the same parameters I was able to connect pgadmin 4 Also I tried with different posts such as 172.17.0.4 because I was showing this IP too for IPv4 even tried with localhost.[enter image description here](https://i.stack.imgur.com/LE3lX.png)

I wanted to get connected with Hasura and postgres who both are running as independent containers in docker.

Contributor guide

Open the contributing guide

Research direction

Start with the docker-compose setup and the reported connection-refused error. Check how Hasura resolves the PostgreSQL host when the containers are separate, using the stated ENV, URL, and connection-parameter configurations. Done means Hasura connects successfully to the existing PostgreSQL database.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, postgres
Domain
databases, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.