[BUG] Cannot connect to a postgres database hosted on Amazon AWS on the "Add Data Sources" page. "Test Connection" keeps running for a while but never changes to "Add Data Source".
See original GitHub issueBug
[BUG] Cannot connect to a postgres database hosted on Amazon AWS on the “Add Data Sources” page. “Test Connection” keeps running for a while but never changes to “Add Data Source”. I have tested with a publicly available postgres database, with the details given in the chaos-genius documentation (please refer this). I was able to connect to the public dataset. However, I cannot connect to my own postgres database (hosted on Amazon AWS). I am certain I am entering the correct credentials for the database connection.
Environment
- Chaos Genius version: 0.5.1
- OS Version / Instance: Ubuntu 20.04
- Deployment type: Deployed locally by cloning the repository and using the
docker-compose up
command
Current behavior
After deploying chaos-genius locally and starting all services using the docker-compose up
command, the home page for chaos-genius shows on localhost:8080. On clicking the “Add Data Source” button on the homepage, I am taken to the “Add Data Sources” page. After entering all details correctly for my own postgres database, I click the “Test Connection” button. a “Loading…” message appears. This never changes to “Add Data Source” and just changes back to “Test Connection”.
Steps: to reproduce:
- Clone the repository:
git clone https://github.com/chaos-genius/chaos_genius
- Change into the chaos_genius directory:
cd chaos_genius
- Start services:
docker-compose up
- Navigate to localhost:8080 in browser
- Click “Add Data Source” button on homepage
- Fill in all database connection details
- Click “Test Connection” to test
Expected behavior
On clicking the “Test Connection” button, it should change to “Add Data Source”. Since the credentials are correct, “Test Connection” should be successful and this should happen.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Thanks @prathamSharma25, as the
5432
port of Postgres server was not publicly accessible and you were accessing it using port forwarding via ssh tunnel, and cg backend containers were not able to access ports on localhost outside container we were able to do following to resolve this:docker0
bridge inHost
field of Add datasource form, can get this IP by runningip -4 addr show docker0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'
ssh -L 0.0.0.0:<host port> ...
, reference for ssh tunnel =>ssh -L [LOCAL_IP:]LOCAL_PORT:DESTINATION:DESTINATION_PORT [USER@]SSH_SERVER
Hi @rjdp, thank you for your response. I have made sure to enter all database connection details correctly (with correct port number for my DB). I too beleive it is a timeout issue, but I can’t know for sure. If it really is a timeout issue, what do you suggest I do to connect to my database? I have joined the Slack channel. Thanks again.