cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BTP Cloudfoundry PostgreSQL connection issue

rupambecs999
Explorer

Accepted Solutions (1)

Accepted Solutions (1)

xionghe
Advisor
Advisor

I remembered one thing.
I've ever met some extreme scenario, the remote Pg instance can't be connected via remote ssh tunnel.

If it's not a prod env, maybe you can create a new pg instance to test the remote connection.

rupambecs999
Explorer
0 Likes

I have deleted and created a new pg instance now I am able to connect.

Thank You!

Answers (4)

Answers (4)

xionghe
Advisor
Advisor

Hi,

Please use a small local port in the cf ssh.

like:

cf ssh -L 4744:pg*****tral-1.rds.amazonaws.com:4744 your_app -T -N

I always add -T -N in the end of this command line.

And you can fill 4744 in your pgadmin form window.

In your case, maybe the 63306 is too big. As I know, there is restriction in the local port range in some OS.

rupambecs999
Explorer
0 Likes

Still it is showing the same

Is accept request from all ip is enable by default as I am accessing from local system. Do I have to add anything else? or any extra configuration?

xionghe
Advisor
Advisor
0 Likes

You can try : telnet localhost 4744 to test whether it rejects on this port?

just check whether there is firewall to block the connection.

And, anyway, you can use some other 3rdpart client tools to connect, too. like dbeaver etc.

But I assume this is an environment issue.

xionghe
Advisor
Advisor
0 Likes

1. ensure the app: approuter-tmp is enabled. From the description, you already get it enabled in advance.

cf ssh-enabled approuter-tmp

2. From the last step, looks like there is other issue after the tunnenlling.

Could you try restaging the app: approuter-tmp?
And then double check the bound pg instance credentials part? Just make it consistent with the information you filled in for each item:
username, password, etc.

rupambecs999
Explorer
0 Likes

I tried to re-build and did all those but getting

ssh: rejected: connect failed (dial tcp IP_ADDRESS:3534: connect: connection refused)

xionghe
Advisor
Advisor
0 Likes

I noticed that you are using cf ssh <app> ....

And it's successful? right?

The pg instance should be bound with the <app> in advance. the username and password should be in the uri part of the bound pg instance: credentials information part.

rupambecs999
Explorer
0 Likes

Yes, I am using cf ssh <app> ....

The app is already bound with the PostgreSQL instance. I have deployed the node.js app there the connection is working fine.