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

Developing locally with PostgreSQL BTP Instance

jorrevynckier
Explorer
0 Likes
1,635

Hi,

I am trying to run my application locally with data from a deployed BTP PostgreSQL instance. I am successful in running an SSH tunnel and connecting to the DB via DBeaver.

However when I adjust the settings in my CAP Application, I do see during startup that the settings are taken into account correctly.

image.png

However when the application is launched I get an immediate 'Timeout'.

jorrevynckier_0-1724940647205.png

Would anyone be able to assist me? 

Thanks! 

View Entire Topic
Dinu
Active Contributor

Set host as 127.0.0.1; localhost does not work in this case when ip6 stack is present.

Also, you need to insist on SSL. So, you have to either provide ssl configurations from the credentials of the service

 

ssl: {
        ca: pg_cred.sslrootcert,
        servername: pg_cred.hostname
    }

 

or do not verify SSL certificates with :

 

ssl: { rejectUnauthorized: false }

 

or set environment variables:

 

NODE_TLS_REJECT_UNAUTHORIZED="0"
PGSSLMODE="require"

 

 

jorrevynckier
Explorer
0 Likes
I just added the environment variables and it worked! Thanks!
gregorw
SAP Mentor
SAP Mentor
0 Likes
Can you please check if this informaiton is available at https://github.com/cap-js/cds-dbs/tree/main/postgres and if not contribute it?