Skip to content

Trace: KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?Β #6486

@jakeaturner

Description

@jakeaturner

πŸ“‘ I have found these related issues/pull requests

Possibly related to #6331 and #6166 , but those seem to be related to acquiring a database connection in general, not pooling issues

πŸ›‘οΈ Security Policy

πŸ“ Description

Hello,

We upgraded to v2 about 8 weeks ago and since then, about once or twice a week all of our monitors will start cascading with DOWN reports and the message Trace: KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?. After a minute or two, they all start coming back UP.

Again, it's not constant nor predictable, just randomly seems to happen. Though, it does seem to be occuring a little more frequently the longer we've been running v2. We do have quite a few monitors (~124) so wondering if it's some kind of leaky connection or missing transaction flush?

Thanks so much for any help you can provide

πŸ‘Ÿ Reproduction steps

A bit difficult to reproduce since it doesn't seem to be tied to any specific action. We just have to wait until it springs up again πŸ€·β€β™‚οΈ

πŸ‘€ Expected behavior

Monitors will not report DOWN if this happens

πŸ˜“ Actual Behavior

All monitors report DOWN and then come back UP after a few minutes

🐻 Uptime-Kuma Version

2.0.0

πŸ’» Operating System and Arch

Ubuntu Server LTS 22.10

🌐 Browser

Google Chrome Version 143.0.7499.42 (Official Build) (64-bit)

πŸ–₯️ Deployment Environment

  • Runtime Environment:
    • Docker: Version 24.0.5, build ced0996
    • Docker Compose: Version 2.20.2
    • Portainer (BE/CE): N/A
    • MariaDB: N/A
    • Node.js: N/A (Docker)
    • Kubernetes: N/A
  • Database:
    • SQLite: Embedded
  • Database Storage:
    • Filesystem:
      • Linux: ext4
    • Storage Medium: SSD
  • Uptime Kuma Setup:
    • Number of monitors: 124

πŸ“ Relevant log output

2025-12-12T13:15:48-08:00 [MONITOR] ERROR: Please report to https://github.com/louislam/uptime-kuma/issues
2025-12-12T13:15:48-08:00 [MONITOR] INFO: Try to restart the monitor
Trace: KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
    at Client_SQLite3.acquireConnection (/app/node_modules/knex/lib/client.js:332:26)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at process.processTimers (node:internal/timers:516:9)
    at async Runner.ensureConnection (/app/node_modules/knex/lib/execution/runner.js:305:28)
    at async Runner.run (/app/node_modules/knex/lib/execution/runner.js:30:19)
    at async RedBeanNode.storeCore (/app/node_modules/redbean-node/dist/redbean-node.js:141:17)
    at async RedBeanNode.store (/app/node_modules/redbean-node/dist/redbean-node.js:110:20)
    at async UptimeCalculator.update (/app/server/uptime-calculator.js:309:9)
    at async beat (/app/server/model/monitor.js:979:32)
    at async Timeout.safeBeat [as _onTimeout] (/app/server/model/monitor.js:1019:17) {
  sql: undefined,
  bindings: undefined
}
    at Timeout.safeBeat [as _onTimeout] (/app/server/model/monitor.js:1021:25)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at process.processTimers (node:internal/timers:516:9)
2025-12-12T13:15:48-08:00 [MONITOR] ERROR: Please report to https://github.com/louislam/uptime-kuma/issues
2025-12-12T13:15:48-08:00 [MONITOR] INFO: Try to restart the monitor
Trace: KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
    at Client_SQLite3.acquireConnection (/app/node_modules/knex/lib/client.js:332:26)
    at async Runner.ensureConnection (/app/node_modules/knex/lib/execution/runner.js:305:28)
    at async Runner.run (/app/node_modules/knex/lib/execution/runner.js:30:19)
    at async RedBeanNode.storeCore (/app/node_modules/redbean-node/dist/redbean-node.js:141:17)
    at async RedBeanNode.store (/app/node_modules/redbean-node/dist/redbean-node.js:110:20)
    at async UptimeCalculator.update (/app/server/uptime-calculator.js:309:9)
    at async beat (/app/server/model/monitor.js:979:32)
    at async Timeout.safeBeat [as _onTimeout] (/app/server/model/monitor.js:1019:17) {
  sql: undefined,
  bindings: undefined
}
    at Timeout.safeBeat [as _onTimeout] (/app/server/model/monitor.js:1021:25)
2025-12-12T13:15:48-08:00 [MONITOR] ERROR: Please report to https://github.com/louislam/uptime-kuma/issues
2025-12-12T13:15:49-08:00 [MONITOR] INFO: Try to restart the monitor
2025-12-12T13:17:40-08:00 [MONITOR] ERROR: Cannot send notification to Email Alert Service
2025-12-12T13:17:41-08:00 [MONITOR] ERROR: Error: write EPIPE
    at afterWriteDispatched (node:internal/stream_base_commons:161:15)
    at writeGeneric (node:internal/stream_base_commons:152:3)
    at Socket._writeGeneric (node:net:958:11)
    at Socket._write (node:net:970:8)
    at writeOrBuffer (node:internal/streams/writable:572:12)
    at _write (node:internal/streams/writable:501:10)
    at Writable.write (node:internal/streams/writable:510:10)
    at SMTPConnection._sendCommand (/app/node_modules/nodemailer/lib/smtp-connection/index.js:1023:22)
    at SMTPConnection._actionEHLO (/app/node_modules/nodemailer/lib/smtp-connection/index.js:1301:18)
    at SMTPConnection._processResponse (/app/node_modules/nodemailer/lib/smtp-connection/index.js:991:20) {
  errno: -32,
  code: 'ESOCKET',
  syscall: 'write',
  command: 'CONN'
}
2025-12-12T13:17:46-08:00 [MONITOR] WARN: Monitor #99 '[redacted]': Failing: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Interval: 120 seconds | Type: http | Down Count: 0 | Resend Interval: 0
Trace: KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
    at Client_SQLite3.acquireConnection (/app/node_modules/knex/lib/client.js:332:26)
    at async Runner.ensureConnection (/app/node_modules/knex/lib/execution/runner.js:305:28)
    at async Runner.run (/app/node_modules/knex/lib/execution/runner.js:30:19)
    at async RedBeanNode.storeCore (/app/node_modules/redbean-node/dist/redbean-node.js:150:26)
    at async RedBeanNode.store (/app/node_modules/redbean-node/dist/redbean-node.js:110:20)
    at async beat (/app/server/model/monitor.js:989:13)
    at async Timeout.safeBeat [as _onTimeout] (/app/server/model/monitor.js:1019:17) {
  sql: undefined,
  bindings: undefined
}
    at Timeout.safeBeat [as _onTimeout] (/app/server/model/monitor.js:1021:25)
2025-12-12T13:18:17-08:00 [MONITOR] ERROR: Please report to https://github.com/louislam/uptime-kuma/issues
2025-12-12T13:18:17-08:00 [MONITOR] INFO: Try to restart the monitor

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions