louislam / uptime-kuma

A fancy self-hosted monitoring tool
https://uptime.kuma.pet
MIT License
55.46k stars 4.99k forks source link

SQLite errors after a while #2307

Closed kalpik closed 1 year ago

kalpik commented 1 year ago

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

πŸ›‘οΈ Security Policy

Description

After a while of running Uptime Kuma (on a Synology diskstation as a docker container), it becomes extremely slow, and I start seeing the following error messages:

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:305:26) at async Runner.ensureConnection (/app/node_modules/knex/lib/execution/runner.js:259: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:166:26) at async RedBeanNode.store (/app/node_modules/redbean-node/dist/redbean-node.js:126:20) at async beat (/app/server/model/monitor.js:639:13) at async Timeout.safeBeat [as _onTimeout] (/app/server/model/monitor.js:658:17) { sql: undefined, bindings: undefined } at consoleCall (<anonymous>) at Timeout.safeBeat [as _onTimeout] (/app/server/model/monitor.js:660:25) 2022-11-11T03:15:34.556Z [MONITOR] ERROR: Please report to https://github.com/louislam/uptime-kuma/issues 2022-11-11T03:15:34.556Z [MONITOR] INFO: Try to restart the monitor Trace: [Error: insert intoheartbeat(down_count,duration,important,monitor_id,msg,ping,status,time) values (0, 20, false, 10, 'Records: 142.251.36.14', 5, 1, '2022-11-11 03:14:34.065') - SQLITE_BUSY: database is locked] { errno: 5, code: 'SQLITE_BUSY' } at consoleCall (<anonymous>) at Timeout.safeBeat [as _onTimeout] (/app/server/model/monitor.js:660:25) 2022-11-11T03:15:36.157Z [MONITOR] ERROR: Please report to https://github.com/louislam/uptime-kuma/issues 2022-11-11T03:15:36.157Z [MONITOR] INFO: Try to restart the monitor Trace: [Error: UPDATEmonitorSET dns_last_result = 'Records: 142.250.186.110' WHERE id = 6 - SQLITE_BUSY: database is locked] { errno: 5, code: 'SQLITE_BUSY' } at process.<anonymous> (/app/server/server.js:1728:13) at process.emit (node:events:390:28) at emit (node:internal/process/promises:136:22) at processPromiseRejections (node:internal/process/promises:242:25) at processTicksAndRejections (node:internal/process/task_queues:97:32) If you keep encountering errors, please report to https://github.com/louislam/uptime-kuma/issues

πŸ‘Ÿ Reproduction steps

There is no reproduction step, this just happens after a while. The only way to resolve this is to clear the history of all monitors.

πŸ‘€ Expected behavior

These errors don't appear automatically.

πŸ˜“ Actual Behavior

Errors appear.

🐻 Uptime-Kuma Version

uptime-kuma:1.18.5-alpine

πŸ’» Operating System and Arch

Alpine Docker container

🌐 Browser

Chrome

πŸ‹ Docker Version

No response

🟩 NodeJS Version

No response

πŸ“ Relevant log output

No response

kalpik commented 1 year ago

I see this is a duplicate of https://github.com/louislam/uptime-kuma/issues/1397