Can't clear statistics - "The pool is probably full. Are you missing a .transacting(trx) call?" #4016

Closed
opened 2026-02-28 03:48:17 -05:00 by deekerman · 2 comments
Owner

Originally created by @patienttruth on GitHub (Mar 4, 2025).

⚠️ Please verify that this question has NOT been raised before.

  • I checked and didn't find similar issue

🛡️ Security Policy

📝 Describe your problem

I'm trying to remove old history as my .db file is quite large (retention was set at 180 days which is more than I need). Though Uptime Kuma appeared functional I was getting corrupted database errors when I clicked "Settings > Monitor History > Clear All Statistics". I'm sure that was caused by a couple times I've let me HD run out of space over the past few months. I used sqlite3 to recover the database, however now I'm getting the following error Trace: KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? when I try clear statistics.

Any suggestions?

Thanks in advance for any assistance and for the excellent project that has been quite useful in keeping me informed about homelab status.

📝 Error Message(s) or Log

Log ``` 2025-03-04T22:11:50Z [MANAGE] INFO: Clear Statistics User ID: 1

2025-03-04T22:12:00Z [RATE-LIMIT] INFO: remaining requests: 60

2025-03-04T22:12:21Z [RATE-LIMIT] INFO: remaining requests: 60

2025-03-04T22:12:42Z [RATE-LIMIT] INFO: remaining requests: 60

2025-03-04T22:13:03Z [RATE-LIMIT] INFO: remaining requests: 60

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:312:26)

at async Runner.ensureConnection (/app/node_modules/knex/lib/execution/runner.js:287:28)

at async Runner.run (/app/node_modules/knex/lib/execution/runner.js:30:19)

at async RedBeanNode.findOne (/app/node_modules/redbean-node/dist/redbean-node.js:499:19)

at async verifyAPIKey (/app/server/auth.js:52:16) {

sql: undefined,

bindings: undefined

}

at process.unexpectedErrorHandler (/app/server/server.js:1905:13)

at process.emit (node:events:517:28)

at emit (node:internal/process/promises:149:20)

at processPromiseRejections (node:internal/process/promises:283:27)

at process.processTicksAndRejections (node:internal/process/task_queues:96:32)

If you keep encountering errors, please report to https://github.com/louislam/uptime-kuma/issues

2025-03-04T22:14:04Z [MONITOR] WARN: Monitor #19 'Far Garage Door Opener': Pending: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Max retries: 2 | Retry: 1 | Retry Interval: 20 seconds | Type: ping

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:312:26)

at async Runner.ensureConnection (/app/node_modules/knex/lib/execution/runner.js:287:28)

at async Runner.run (/app/node_modules/knex/lib/execution/runner.js:30:19)

at async RedBeanNode.findOne (/app/node_modules/redbean-node/dist/redbean-node.js:499:19)

at async verifyAPIKey (/app/server/auth.js:52:16) {

sql: undefined,

bindings: undefined

}

at process.unexpectedErrorHandler (/app/server/server.js:1905:13)

at process.emit (node:events:517:28)

at emit (node:internal/process/promises:149:20)

at processPromiseRejections (node:internal/process/promises:283:27)

at process.processTicksAndRejections (node:internal/process/task_queues:96:32)

If you keep encountering errors, please report to https://github.com/louislam/uptime-kuma/issues

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:312:26)

at async Runner.ensureConnection (/app/node_modules/knex/lib/execution/runner.js:287:28)

at async Runner.run (/app/node_modules/knex/lib/execution/runner.js:30:19)

at async RedBeanNode.findOne (/app/node_modules/redbean-node/dist/redbean-node.js:499:19)

at async verifyAPIKey (/app/server/auth.js:52:16) {

sql: undefined,

bindings: undefined

}

at process.unexpectedErrorHandler (/app/server/server.js:1905:13)

at process.emit (node:events:517:28)

at emit (node:internal/process/promises:149:20)

at processPromiseRejections (node:internal/process/promises:283:27)

at process.processTicksAndRejections (node:internal/process/task_queues:96:32)

If you keep encountering errors, please report to https://github.com/louislam/uptime-kuma/issues

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:312:26)

at async Runner.ensureConnection (/app/node_modules/knex/lib/execution/runner.js:287:28)

at async Runner.run (/app/node_modules/knex/lib/execution/runner.js:30:19)

at async RedBeanNode.findOne (/app/node_modules/redbean-node/dist/redbean-node.js:499:19)

at async verifyAPIKey (/app/server/auth.js:52:16) {

sql: undefined,

bindings: undefined

}

at process.unexpectedErrorHandler (/app/server/server.js:1905:13)

at process.emit (node:events:517:28)

at emit (node:internal/process/promises:149:20)

at processPromiseRejections (node:internal/process/promises:283:27)

at process.processTicksAndRejections (node:internal/process/task_queues:96:32)

If you keep encountering errors, please report to https://github.com/louislam/uptime-kuma/issues

2025-03-04T22:15:23Z [MANAGE] INFO: Clear Events Monitor: 22 User ID: 1

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:312:26)

at async Runner.ensureConnection (/app/node_modules/knex/lib/execution/runner.js:287:28)

at async Runner.run (/app/node_modules/knex/lib/execution/runner.js:30:19)

at async RedBeanNode.normalizeRaw (/app/node_modules/redbean-node/dist/redbean-node.js:572:22)

at async RedBeanNode.getRow (/app/node_modules/redbean-node/dist/redbean-node.js:558:22)

at async RedBeanNode.getCell (/app/node_modules/redbean-node/dist/redbean-node.js:593:19)

at async Settings.get (/app/server/settings.js:54:21)

at async exports.apiAuth (/app/server/auth.js:154:10) {

sql: 'SELECT value FROM setting WHERE key = ? limit ?',

bindings: [ 'disableAuth', 1 ]

}

at process.unexpectedErrorHandler (/app/server/server.js:1905:13)

at process.emit (node:events:517:28)

at emit (node:internal/process/promises:149:20)

at processPromiseRejections (node:internal/process/promises:283:27)

at process.processTicksAndRejections (node:internal/process/task_queues:96:32)

If you keep encountering errors, please report to https://github.com/louislam/uptime-kuma/issues

</details>

### 🐻 Uptime-Kuma Version

1.23.15

### 💻 Operating System and Arch

Ubuntu 22.04.5 LTS

### 🌐 Browser

Brave is up to date Version 1.75.181 Chromium: 133.0.6943.141 (Official Build) (64-bit)

### 🖥️ Deployment Environment

- Runtime: Docker 27.5.0
- Database: default (sqlite I think)
- Filesystem used to store the database on: EXT4
- number of monitors: headless server - remote PC has 3
Originally created by @patienttruth on GitHub (Mar 4, 2025). ### ⚠️ Please verify that this question has NOT been raised before. - [x] I checked and didn't find similar issue ### 🛡️ Security Policy - [x] I agree to have read this project [Security Policy](https://github.com/louislam/uptime-kuma/security/policy) ### 📝 Describe your problem I'm trying to remove old history as my .db file is quite large (retention was set at 180 days which is more than I need). Though Uptime Kuma appeared functional I was getting corrupted database errors when I clicked "Settings > Monitor History > Clear All Statistics". I'm sure that was caused by a couple times I've let me HD run out of space over the past few months. I used sqlite3 to recover the database, however now I'm getting the following error `Trace: KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?` when I try clear statistics. Any suggestions? Thanks in advance for any assistance and for the excellent project that has been quite useful in keeping me informed about homelab status. ### 📝 Error Message(s) or Log <details> <summary>Log</summary> ``` 2025-03-04T22:11:50Z [MANAGE] INFO: Clear Statistics User ID: 1 2025-03-04T22:12:00Z [RATE-LIMIT] INFO: remaining requests: 60 2025-03-04T22:12:21Z [RATE-LIMIT] INFO: remaining requests: 60 2025-03-04T22:12:42Z [RATE-LIMIT] INFO: remaining requests: 60 2025-03-04T22:13:03Z [RATE-LIMIT] INFO: remaining requests: 60 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:312:26) at async Runner.ensureConnection (/app/node_modules/knex/lib/execution/runner.js:287:28) at async Runner.run (/app/node_modules/knex/lib/execution/runner.js:30:19) at async RedBeanNode.findOne (/app/node_modules/redbean-node/dist/redbean-node.js:499:19) at async verifyAPIKey (/app/server/auth.js:52:16) { sql: undefined, bindings: undefined } at process.unexpectedErrorHandler (/app/server/server.js:1905:13) at process.emit (node:events:517:28) at emit (node:internal/process/promises:149:20) at processPromiseRejections (node:internal/process/promises:283:27) at process.processTicksAndRejections (node:internal/process/task_queues:96:32) If you keep encountering errors, please report to https://github.com/louislam/uptime-kuma/issues 2025-03-04T22:14:04Z [MONITOR] WARN: Monitor #19 'Far Garage Door Opener': Pending: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Max retries: 2 | Retry: 1 | Retry Interval: 20 seconds | Type: ping 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:312:26) at async Runner.ensureConnection (/app/node_modules/knex/lib/execution/runner.js:287:28) at async Runner.run (/app/node_modules/knex/lib/execution/runner.js:30:19) at async RedBeanNode.findOne (/app/node_modules/redbean-node/dist/redbean-node.js:499:19) at async verifyAPIKey (/app/server/auth.js:52:16) { sql: undefined, bindings: undefined } at process.unexpectedErrorHandler (/app/server/server.js:1905:13) at process.emit (node:events:517:28) at emit (node:internal/process/promises:149:20) at processPromiseRejections (node:internal/process/promises:283:27) at process.processTicksAndRejections (node:internal/process/task_queues:96:32) If you keep encountering errors, please report to https://github.com/louislam/uptime-kuma/issues 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:312:26) at async Runner.ensureConnection (/app/node_modules/knex/lib/execution/runner.js:287:28) at async Runner.run (/app/node_modules/knex/lib/execution/runner.js:30:19) at async RedBeanNode.findOne (/app/node_modules/redbean-node/dist/redbean-node.js:499:19) at async verifyAPIKey (/app/server/auth.js:52:16) { sql: undefined, bindings: undefined } at process.unexpectedErrorHandler (/app/server/server.js:1905:13) at process.emit (node:events:517:28) at emit (node:internal/process/promises:149:20) at processPromiseRejections (node:internal/process/promises:283:27) at process.processTicksAndRejections (node:internal/process/task_queues:96:32) If you keep encountering errors, please report to https://github.com/louislam/uptime-kuma/issues 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:312:26) at async Runner.ensureConnection (/app/node_modules/knex/lib/execution/runner.js:287:28) at async Runner.run (/app/node_modules/knex/lib/execution/runner.js:30:19) at async RedBeanNode.findOne (/app/node_modules/redbean-node/dist/redbean-node.js:499:19) at async verifyAPIKey (/app/server/auth.js:52:16) { sql: undefined, bindings: undefined } at process.unexpectedErrorHandler (/app/server/server.js:1905:13) at process.emit (node:events:517:28) at emit (node:internal/process/promises:149:20) at processPromiseRejections (node:internal/process/promises:283:27) at process.processTicksAndRejections (node:internal/process/task_queues:96:32) If you keep encountering errors, please report to https://github.com/louislam/uptime-kuma/issues 2025-03-04T22:15:23Z [MANAGE] INFO: Clear Events Monitor: 22 User ID: 1 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:312:26) at async Runner.ensureConnection (/app/node_modules/knex/lib/execution/runner.js:287:28) at async Runner.run (/app/node_modules/knex/lib/execution/runner.js:30:19) at async RedBeanNode.normalizeRaw (/app/node_modules/redbean-node/dist/redbean-node.js:572:22) at async RedBeanNode.getRow (/app/node_modules/redbean-node/dist/redbean-node.js:558:22) at async RedBeanNode.getCell (/app/node_modules/redbean-node/dist/redbean-node.js:593:19) at async Settings.get (/app/server/settings.js:54:21) at async exports.apiAuth (/app/server/auth.js:154:10) { sql: 'SELECT `value` FROM setting WHERE `key` = ? limit ?', bindings: [ 'disableAuth', 1 ] } at process.unexpectedErrorHandler (/app/server/server.js:1905:13) at process.emit (node:events:517:28) at emit (node:internal/process/promises:149:20) at processPromiseRejections (node:internal/process/promises:283:27) at process.processTicksAndRejections (node:internal/process/task_queues:96:32) If you keep encountering errors, please report to https://github.com/louislam/uptime-kuma/issues ``` </details> ### 🐻 Uptime-Kuma Version 1.23.15 ### 💻 Operating System and Arch Ubuntu 22.04.5 LTS ### 🌐 Browser Brave is up to date Version 1.75.181 Chromium: 133.0.6943.141 (Official Build) (64-bit) ### 🖥️ Deployment Environment - Runtime: Docker 27.5.0 - Database: default (sqlite I think) - Filesystem used to store the database on: EXT4 - number of monitors: headless server - remote PC has 3
deekerman 2026-02-28 03:48:17 -05:00
  • closed this issue
  • added the
    help
    label
Author
Owner

@Jezza34000 commented on GitHub (Mar 6, 2025):

+1

@Jezza34000 commented on GitHub (Mar 6, 2025): +1
Author
Owner

@patienttruth commented on GitHub (Mar 6, 2025):

@Jezza34000 what I did, and maybe this will help you is:

cp kuma.db kuma.db.bak - make backup

sqlite3 kuma.db .recovery >data.sql - recover db to recovery file

sqlite3 kuma.db <data.sql - restore recovered data to database file.

Then I opened the file with https://sqlitestudio.pl/ and deleted the data in the heartbeat array.

That solved my corrupt database problem as well as the database size problem. Then I set my history retention to a day or two. Hope this helps!

Edit to add:
You need to have write permissions for the directory where kuma.db is located. You can just use sudo as sqlite3 makes temp files when it has the .db open to recover it, and it won't work if you don't have write permissions. Probably took me 30-45 mins to figure that out. Just chown -R the folder to you, and then to whatever it was when you're done

@patienttruth commented on GitHub (Mar 6, 2025): @Jezza34000 what I did, and maybe this will help you is: `cp kuma.db kuma.db.bak` - make backup `sqlite3 kuma.db .recovery >data.sql` - recover db to recovery file `sqlite3 kuma.db <data.sql` - restore recovered data to database file. Then I opened the file with https://sqlitestudio.pl/ and deleted the data in the heartbeat array. That solved my corrupt database problem as well as the database size problem. Then I set my history retention to a day or two. Hope this helps! Edit to add: You need to have write permissions for the directory where kuma.db is located. You can just use `sudo` as sqlite3 makes temp files when it has the .db open to recover it, and it won't work if you don't have write permissions. Probably took me 30-45 mins to figure that out. Just `chown -R` the folder to you, and then to whatever it was when you're done
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/uptime-kuma#4016
No description provided.