question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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 issue

Bug

[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:

  1. Clone the repository: git clone https://github.com/chaos-genius/chaos_genius
  2. Change into the chaos_genius directory: cd chaos_genius
  3. Start services: docker-compose up
  4. Navigate to localhost:8080 in browser
  5. Click “Add Data Source” button on homepage
  6. Fill in all database connection details
  7. 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:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
rjdpcommented, Mar 26, 2022

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:

  • Used IP of docker0 bridge in Host field of Add datasource form, can get this IP by running ip -4 addr show docker0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'
  • while ssh tunneling bind source port to 0.0.0.0 instead of localhost, by default ssh tunnel will port forward to localhost, cmd to use ssh -L 0.0.0.0:<host port> ... , reference for ssh tunnel => ssh -L [LOCAL_IP:]LOCAL_PORT:DESTINATION:DESTINATION_PORT [USER@]SSH_SERVER
1reaction
prathamSharma25commented, Mar 25, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolve problems connecting to an Amazon RDS DB instance
There are a number of root causes for the inability to connect to an Amazon RDS DB instance. Here are a few of...
Read more >
Troubleshooting for Amazon RDS - AWS Documentation
Use the following sections to help troubleshoot problems you have with DB instances in Amazon RDS and Amazon Aurora. Topics. Can't connect to...
Read more >
Connecting to a DB instance running the PostgreSQL ...
If you created your DB instance as private, only Amazon EC2 instances and devices inside the Amazon VPC can connect to your database....
Read more >
Troubleshooting migration tasks in AWS Database Migration ...
The most common reason for a migration task running slowly is that there are inadequate resources allocated to the AWS DMS replication instance....
Read more >
Data source connectivity issues for Amazon QuickSight
Use the following section to help you troubleshoot connections to data sources. Before you continue, verify that your database is currently available.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found