Knex timeouts with newest Ghost version

  • What’s your URL? https://blog.golemproject.net/
  • What version of Ghost are you using? 3.30.2
  • How was Ghost installed and configured? It’s running from a ghost:alpine docker image, behind nginx reverse proxy.
  • What Node version, database, OS & browser are you using?
    • node: 12 (it’s included in the docker image)
    • database: MySQL Community on AWS RDS
    • OS & browser: I think it’s not important in this case.
  • What errors or information do you see in the console?
[2020-08-24 09:42:26] ERROR "GET /" 500 60006ms
Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?

Error ID:
    1e9c0520-e5ee-11ea-bc1f-17c31bedff22

----------------------------------------

InternalServerError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
    at new GhostError (/var/lib/ghost/versions/3.30.2/node_modules/@tryghost/errors/lib/errors.js:10:26)
    at _private.prepareError (/var/lib/ghost/versions/3.30.2/core/server/web/shared/middlewares/error-handler.js:53:19)
    at Layer.handle_error (/var/lib/ghost/versions/3.30.2/node_modules/express/lib/router/layer.js:71:5)
    at trim_prefix (/var/lib/ghost/versions/3.30.2/node_modules/express/lib/router/index.js:315:13)
    at /var/lib/ghost/versions/3.30.2/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/lib/ghost/versions/3.30.2/node_modules/express/lib/router/index.js:335:12)
    at next (/var/lib/ghost/versions/3.30.2/node_modules/express/lib/router/index.js:275:10)
    at handle404 (/var/lib/ghost/versions/3.30.2/core/frontend/apps/private-blogging/lib/middleware.js:166:20)
    at Layer.handle_error (/var/lib/ghost/versions/3.30.2/node_modules/express/lib/router/layer.js:71:5)
    at trim_prefix (/var/lib/ghost/versions/3.30.2/node_modules/express/lib/router/index.js:315:13)
    at /var/lib/ghost/versions/3.30.2/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/lib/ghost/versions/3.30.2/node_modules/express/lib/router/index.js:335:12)
    at next (/var/lib/ghost/versions/3.30.2/node_modules/express/lib/router/index.js:275:10)
    at Layer.handle_error (/var/lib/ghost/versions/3.30.2/node_modules/express/lib/router/layer.js:67:12)
    at trim_prefix (/var/lib/ghost/versions/3.30.2/node_modules/express/lib/router/index.js:315:13)
    at /var/lib/ghost/versions/3.30.2/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/lib/ghost/versions/3.30.2/node_modules/express/lib/router/index.js:335:12)
    at Immediate.next (/var/lib/ghost/versions/3.30.2/node_modules/express/lib/router/index.js:275:10)
    at Immediate._onImmediate (/var/lib/ghost/versions/3.30.2/node_modules/express/lib/router/index.js:635:15)
    at processImmediate (internal/timers.js:458:21)

KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
    at Client_MySQL.acquireConnection (/var/lib/ghost/versions/3.30.2/node_modules/knex/lib/client.js:349:26)
  • What steps could someone else take to reproduce the issue you’re having? I don’t know.

Additional info:
With latest ghost version after few minutes of running I get the error pasted above and browser gets a “504 Gateway Time-out” error from nginx.
If I downgrade to the previously used version 3.21.1 it works smoothly and without errors.

Update: actually no, downgrade doesn’t help. I still get timeouts.

@etam given that you’re still seeing timeouts, even after a downgrade, I’d imagine this issue isn’t with Ghost. More likely it’s a network connection issue between the Docker container itself and your AWS RDS instance.

I see no connection issues. Or at least I don’t know how to spot them.

In the mean time I’ve added caching in nginx, following this guide: Caching Ghost with Nginx - Stan's blog.

In the guide I linked above, the nginx rule location ~ ^/(ghost/|p/)/ is not doing what it is supposed to do. I don’t know how to make it work as it should, so I just made two rules location ^~ /ghost/ and location ^~ /p/.

I would say, that the issue is resolved for now.