Site database connection fails to Digital Ocean Managed database

Just having the same problem with a new target.

Wappler 6.7.0
Digital Ocean docker + DO Postgres.

All configured using Resource Manager.
I can query and see all the tables in the remote database inside wappler and on PG Admin.

Deployment with no errors, but when try to run an server connect using the remote IP:

{
  "status": "500",
  "message": "Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?",
  "stack": "KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?\n    at Client_PG.acquireConnection (/opt/node_app/node_modules/knex/lib/client.js:332:26)\n    at async Runner.ensureConnection (/opt/node_app/node_modules/knex/lib/execution/runner.js:305:28)\n    at async Runner.run (/opt/node_app/node_modules/knex/lib/execution/runner.js:30:19)\n    at async App.custom (/opt/node_app/lib/modules/dbupdater.js:367:23)\n    at async App._exec (/opt/node_app/lib/core/app.js:636:30)\n    at async App.exec (/opt/node_app/lib/core/app.js:572:9)\n    at async App.define (/opt/node_app/lib/core/app.js:554:9)"
}

This just indicates that your database connection between the server connect and the database connection failed.

So you should check the database connection in the workflows, server connect panel

Thanks @George!

I can open database manager:

Screenshot 2024-06-20 at 11.17.36

I can see/edit data in the DB Manager

Screenshot 2024-06-20 at 11.17.57

I can query in a Server Action

Screenshot 2024-06-20 at 11.18.43

But when deploy, I got the ´Knex timeout error´

My database is a cloud database, SSL is set. Docker container is in the database's trusted source list.

Both DB Manager and Global DB configs are using the "private" host, this can be an issue?

well the Database manager is using the public connection to the DO database, while server connect (which now fails with error) is using the private one.

Normally private one should be fine between servers when your server and DO managed database server - if those are in the same data center.

Do you have them somewhere else?

In short make sure that your server (droplet) and the managed database are in the same VPC (private network) so they can be accessed via the private connection.

You can do all this in the Digital Ocean admin.

See:

yep...it is in different VPC....as an staging environment, I set the database connection to "public".
Will set VPC for the production env.

Thanks @George!!