Search code examples
postgresqlloopbackjsloopback4

Loopback 4 unable to connect to Postgres 13


I am trying to connect with Postgres 13 from loopback 4 but its showing error

Cannot migrate database schema Error: Timeout in connecting after 5000 ms
at Timeout._onTimeout (/Users/mohammad/Work/prithu/prithuPlatform/node_modules/loopback-datasource-juggler/lib/datasource.js:2654:10)
at listOnTimeout (internal/timers.js:554:17)
at processTimers (internal/timers.js:497:7)

I tried connecting with pgadmin and its connecting fine and I also tried connecting it with express and its also connecting. It was connecting with earlier system but after changing system and installing Postgres 13 it's not working.

Here is the snapshot of app-db.datasource.config.json

{
 "name": "app_db",
 "connector": "postgresql",
 "debug": true,
 "host": "localhost",
 "port": 5432,
 "user": "adminuser",
 "password": "password123",
 "database": "testdb",
 "ssl": false
}

Solution

  • Finally I figured out what was the problem. It was because I was using node 14. There was no problem with the database. I then install the node 12 and it's working now.