Deploy to AWS error: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?

System Information
  • Strapi Version:
  • Operating System: Windows 10
  • Database:
  • Node Version:
  • NPM Version:
  • Yarn Version:

I was finally able to figure out the AWS configuration, and got the database online(?) as shown in the picture below


However, I cannot view the deployed strapi site so I think something must go wrong

Here’s the error code I got from the log:

0|freeopenu_backend  | [2021-01-27T00:27:37.057Z] debug ⛔️ Server wasn't able to start properly.
0|freeopenu_backend  | [2021-01-27T00:27:37.061Z] error TimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
0|freeopenu_backend  |     at /home/ubuntu/freeopenu_backend/node_modules/knex/lib/client.js:318:17
0|freeopenu_backend  |     at tryCatcher (/home/ubuntu/freeopenu_backend/node_modules/bluebird/js/release/util.js:16:23)
0|freeopenu_backend  |     at /home/ubuntu/freeopenu_backend/node_modules/bluebird/js/release/catch_filter.js:17:41
0|freeopenu_backend  |     at tryCatcher (/home/ubuntu/freeopenu_backend/node_modules/bluebird/js/release/util.js:16:23)
0|freeopenu_backend  |     at Promise._settlePromiseFromHandler (/home/ubuntu/freeopenu_backend/node_modules/bluebird/js/release/promise.js:547:31)
0|freeopenu_backend  |     at Promise._settlePromise (/home/ubuntu/freeopenu_backend/node_modules/bluebird/js/release/promise.js:604:18)
0|freeopenu_backend  |     at Promise._settlePromise0 (/home/ubuntu/freeopenu_backend/node_modules/bluebird/js/release/promise.js:649:10)
0|freeopenu_backend  |     at Promise._settlePromises (/home/ubuntu/freeopenu_backend/node_modules/bluebird/js/release/promise.js:725:18)
0|freeopenu_backend  |     at _drainQueueStep (/home/ubuntu/freeopenu_backend/node_modules/bluebird/js/release/async.js:93:12)
0|freeopenu_backend  |     at _drainQueue (/home/ubuntu/freeopenu_backend/node_modules/bluebird/js/release/async.js:86:9)
0|freeopenu_backend  |     at Async._drainQueues (/home/ubuntu/freeopenu_backend/node_modules/bluebird/js/release/async.js:102:5)
0|freeopenu_backend  |     at Immediate.Async.drainQueues [as _onImmediate] (/home/ubuntu/freeopenu_backend/node_modules/bluebird/js/release/async.js:15:14)
0|freeopenu_backend  |     at processImmediate (internal/timers.js:461:21)

You will most likely need to tweak the tarn pooling options for knex: https://strapi.io/documentation/developer-docs/latest/concepts/configurations.html#database

See the examples, you’ll place the options in the options.pool.x there is a link to some examples straight from Knex’s own documentation here: Knex.js - A SQL Query Builder for Javascript

1 Like

So I added the ‘pool’ option in /config/database.js as you suggested, the error still exists, unfortunately, was there something else I missed?

If anyone comes across this issue now, we managed to fix it by allowing inbound access via AWS RDS. More details can be found here: amazon web services - AWS RDS to PgAdmin Error saving properties Unable to connect to server: timeout expired - Server Fault