hassio-addons / addon-uptime-kuma

Uptime Kuma - Home Assistant Community Add-ons
MIT License
84 stars 19 forks source link

Uptime Kuma entities not available in HA #156

Closed xelemorf closed 9 months ago

xelemorf commented 9 months ago

Problem/Motivation

UptimeKuma sensor entities dissapeared in HA, showing "Error in describing condition: can't access property "entity_id" of undefined"; manual check for entity availability shows no custom UptimeKuma monitors are populated into HA.

Expected behavior

Custom UptimeKuma monitors should be auto-populated after addon-start

Actual behavior

UptimeKuma sensor entities dissapeared in HA, only the below are available, none of the custom monitors are available

Steps to reproduce

Let UptimeKuma run for over 90 days with 28 monitor entities, wait for the database to grow over 2GB (2397.6 GB) While settings are configured to keep only 1 day history.

Proposed changes

Vacuum function clearly not working: "Trigger database VACUUM for SQLite. If your database is created after 1.10.0, AUTO_VACUUM is already enabled and this action is not needed." This is a re-occurring issue once the database grows above 2GB, having a setting to keep history for 1 days does not do anything.

Current workaround (reinstall UptimeKuma addon)

  1. Export all settings manually (since the backup feature does not work and you cannot access the data folder for UptimeKuma on HAOS)
  2. Completely uninstall UptimeKuma addon
  3. Reboot HAOS
  4. Reinstall Uptime Kuma Addon (HA integration can stay as it was), reboot HAOS
  5. Reconfigure everything from scratch using the same monitor names and settings
  6. Configure database to keep only 1 days of history, observe the second day that th setting is not respected
  7. Wait for some time to the database to grow above 2GB then rinse and repeat all the steps

System details:

HomeAssistant Addon version: 0.12.0 HAOS OVA (VMware) - The issue is independent from HAOS and HA versions. Core 2024.2.2 Supervisor 2024.01.1 Operating System 11.5 Frontend 20240207.1 CPU: 2 vCPU (Intel Core i7-8700T @ 2.40GHz) RAM: 4GB (DDR4)

frenck commented 9 months ago

I think you are mixing up things.

This is the Uptime Kuma add-on, not integration...

Please report your issue with the integration author instead.

../Frenck

xelemorf commented 9 months ago

I think you are mixing up things.

This is the Uptime Kuma add-on, not integration...

Please report your issue with the integration author instead.

../Frenck

This seems to me an issue with the addon, not the integration. If I perform a clean reinstall of the addon that solves the issue. I suspect this is related to the database size on the addon side, this is my second time with this issue, seems to trigged when database is above 2GB (despite having 1 day retention configured), manual "shrink database" or "clear all statistics" buttons are ineffective. image

xelemorf commented 9 months ago

Can you please advise what logs to provide to be able to effectively investigate the issue before I do a clean reinstall of the addon and losing all the relevant logs?

Sharing the addon logs below:

--- 192.168.69.29 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2081ms
pipe 3
 | Interval: 20 seconds | Type: ping | Down Count: 0 | Resend Interval: 0
2024-02-18T13:22:25+01:00 [MANAGE] INFO: Clear Statistics User ID: 1
2024-02-18T13:24:20+01:00 [MONITOR] WARN: Monitor #4 'livingroom-ac': Failing: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Interval: 20 seconds | Type: ping | Down Count: 0 | Resend Interval: 0
2024-02-18T13:24:22+01:00 [MONITOR] WARN: Monitor #9 'mobile-rencsi-a71': Pending: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Max retries: 1 | Retry: 1 | Retry Interval: 20 seconds | Type: ping
2024-02-18T13:24:22+01:00 [MONITOR] WARN: Monitor #5 'livingroom-cam1': Pending: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Max retries: 1 | Retry: 1 | Retry Interval: 20 seconds | Type: ping
2024-02-18T13:24:24+01:00 [MONITOR] WARN: Monitor #6 'livingroom-cam2': Pending: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Max retries: 1 | Retry: 1 | Retry Interval: 20 seconds | Type: ping
2024-02-18T13:24:24+01:00 [MONITOR] WARN: Monitor #7 'livingroom-tv-wifi': Failing: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Interval: 20 seconds | Type: ping | Down Count: 0 | Resend Interval: 0
2024-02-18T13:24:24+01:00 [MONITOR] WARN: Monitor #8 'lobby-cam': Pending: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Max retries: 1 | Retry: 1 | Retry Interval: 20 seconds | Type: ping
2024-02-18T13:24:26+01:00 [MONITOR] WARN: Monitor #24 'livingroom-soundbar': Failing: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Interval: 20 seconds | Type: ping | Down Count: 0 | Resend Interval: 0
2024-02-18T13:24:28+01:00 [MONITOR] WARN: Monitor #17 'Optiplex - Plex IP4': Pending: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Max retries: 1 | Retry: 1 | Retry Interval: 60 seconds | Type: http
2024-02-18T13:24:28+01:00 [MONITOR] WARN: Monitor #27 'rpi-printer': Failing: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Interval: 20 seconds | Type: ping | Down Count: 0 | Resend Interval: 0
2024-02-18T13:24:29+01:00 [MONITOR] WARN: Monitor #11 'Optiplex IP4': Pending: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Max retries: 1 | Retry: 1 | Retry Interval: 20 seconds | Type: ping
2024-02-18T13:24:29+01:00 [MONITOR] WARN: Monitor #18 'Optiplex - Plex IP5': Pending: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Max retries: 1 | Retry: 1 | Retry Interval: 60 seconds | Type: http
Trace: KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
    at Client_SQLite3.acquireConnection (/opt/uptime-kuma/node_modules/knex/lib/client.js:312:26)
    at async Runner.ensureConnection (/opt/uptime-kuma/node_modules/knex/lib/execution/runner.js:287:28)
    at async Runner.run (/opt/uptime-kuma/node_modules/knex/lib/execution/runner.js:30:19)
    at async RedBeanNode.normalizeRaw (/opt/uptime-kuma/node_modules/redbean-node/dist/redbean-node.js:572:22)
    at async RedBeanNode.getRow (/opt/uptime-kuma/node_modules/redbean-node/dist/redbean-node.js:558:22)
    at async RedBeanNode.getCell (/opt/uptime-kuma/node_modules/redbean-node/dist/redbean-node.js:593:19)
    at async Settings.get (/opt/uptime-kuma/server/settings.js:54:21)
    at async UptimeKumaServer.getClientIPwithProxy (/opt/uptime-kuma/server/uptime-kuma-server.js:313:13)
    at async Object.allowRequest (/opt/uptime-kuma/server/uptime-kuma-server.js:122:34) {
  sql: 'SELECT `value` FROM setting WHERE `key` = ?  limit ?',
  bindings: [ 'trustProxy', 1 ]
}
    at process.unexpectedErrorHandler (/opt/uptime-kuma/server/server.js:1899: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
2024-02-18T13:24:30+01:00 [MONITOR] WARN: Monitor #23 'WAN DNS': Pending: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Max retries: 1 | Retry: 1 | Retry Interval: 60 seconds | Type: dns
2024-02-18T13:24:30+01:00 [MONITOR] WARN: Monitor #30 'xelmsrv': Failing: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Interval: 20 seconds | Type: ping | Down Count: 0 | Resend Interval: 0
2024-02-18T13:24:30+01:00 [MONITOR] WARN: Monitor #22 'Pi-Hole WebUI': Pending: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Max retries: 1 | Retry: 1 | Retry Interval: 60 seconds | Type: http
2024-02-18T13:24:31+01:00 [MONITOR] WARN: Monitor #13 'Router ping': Pending: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Max retries: 1 | Retry: 1 | Retry Interval: 20 seconds | Type: ping
2024-02-18T13:24:32+01:00 [MONITOR] WARN: Monitor #10 'mobile-xelmobile-a71': Pending: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Max retries: 1 | Retry: 1 | Retry Interval: 20 seconds | Type: ping
2024-02-18T13:24:33+01:00 [MONITOR] WARN: Monitor #14 'rpi-weather-wifi': Pending: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Max retries: 1 | Retry: 1 | Retry Interval: 20 seconds | Type: ping
2024-02-18T13:24:34+01:00 [MONITOR] WARN: Monitor #15 'WAN PING': Pending: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Max retries: 1 | Retry: 1 | Retry Interval: 20 seconds | Type: ping
2024-02-18T13:24:34+01:00 [MONITOR] WARN: Monitor #32 'xelpc-eth': Failing: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Interval: 20 seconds | Type: ping | Down Count: 0 | Resend Interval: 0
2024-02-18T13:24:35+01:00 [MONITOR] WARN: Monitor #19 'Optiplex - qBittorrent': Pending: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Max retries: 1 | Retry: 1 | Retry Interval: 20 seconds | Type: http
2024-02-18T13:24:35+01:00 [MONITOR] WARN: Monitor #26 'Pi-Hole VM': Pending: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Max retries: 1 | Retry: 1 | Retry Interval: 20 seconds | Type: ping
2024-02-18T13:24:36+01:00 [MONITOR] WARN: Monitor #16 'Optiplex - Everything web': Pending: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Max retries: 1 | Retry: 1 | Retry Interval: 20 seconds | Type: http
2024-02-18T13:24:36+01:00 [MONITOR] WARN: Monitor #29 'bedroom-tvbox-eth': Pending: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Max retries: 1 | Retry: 1 | Retry Interval: 20 seconds | Type: ping
2024-02-18T13:24:37+01:00 [MONITOR] WARN: Monitor #31 'Optiplex IP5': Pending: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Max retries: 1 | Retry: 1 | Retry Interval: 20 seconds | Type: ping
2024-02-18T13:24:37+01:00 [MONITOR] WARN: Monitor #36 'pihole-vmw': Pending: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Max retries: 1 | Retry: 1 | Retry Interval: 20 seconds | Type: ping
2024-02-18T13:24:39+01:00 [MONITOR] WARN: Monitor #35 'rpi-nups': Pending: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Max retries: 1 | Retry: 1 | Retry Interval: 20 seconds | Type: ping
2024-02-18T13:24:40+01:00 [MONITOR] WARN: Monitor #1 'andi-android': Failing: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Interval: 20 seconds | Type: ping | Down Count: 0 | Resend Interval: 0
2024-02-18T13:24:40+01:00 [MONITOR] WARN: Monitor #3 'corridor-ac': Failing: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? | Interval: 20 seconds | Type: ping | 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 (/opt/uptime-kuma/node_modules/knex/lib/client.js:312:26)
    at async Runner.ensureConnection (/opt/uptime-kuma/node_modules/knex/lib/execution/runner.js:287:28)
    at async Runner.run (/opt/uptime-kuma/node_modules/knex/lib/execution/runner.js:30:19)
    at async RedBeanNode.normalizeRaw (/opt/uptime-kuma/node_modules/redbean-node/dist/redbean-node.js:572:22)
    at async RedBeanNode.getRow (/opt/uptime-kuma/node_modules/redbean-node/dist/redbean-node.js:558:22)
    at async RedBeanNode.getCell (/opt/uptime-kuma/node_modules/redbean-node/dist/redbean-node.js:593:19)
    at async Settings.get (/opt/uptime-kuma/server/settings.js:54:21)
    at async UptimeKumaServer.getClientIPwithProxy (/opt/uptime-kuma/server/uptime-kuma-server.js:313:13)
    at async Object.allowRequest (/opt/uptime-kuma/server/uptime-kuma-server.js:122:34) {
  sql: 'SELECT `value` FROM setting WHERE `key` = ?  limit ?',
  bindings: [ 'trustProxy', 1 ]
}
    at process.unexpectedErrorHandler (/opt/uptime-kuma/server/server.js:1899: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 (/opt/uptime-kuma/node_modules/knex/lib/client.js:312:26)
    at async Runner.ensureConnection (/opt/uptime-kuma/node_modules/knex/lib/execution/runner.js:287:28)
    at async Runner.run (/opt/uptime-kuma/node_modules/knex/lib/execution/runner.js:30:19)
    at async RedBeanNode.normalizeRaw (/opt/uptime-kuma/node_modules/redbean-node/dist/redbean-node.js:572:22)
    at async RedBeanNode.getRow (/opt/uptime-kuma/node_modules/redbean-node/dist/redbean-node.js:558:22)
    at async RedBeanNode.getCell (/opt/uptime-kuma/node_modules/redbean-node/dist/redbean-node.js:593:19)
    at async Settings.get (/opt/uptime-kuma/server/settings.js:54:21)
    at async UptimeKumaServer.getClientIPwithProxy (/opt/uptime-kuma/server/uptime-kuma-server.js:313:13)
    at async Object.allowRequest (/opt/uptime-kuma/server/uptime-kuma-server.js:122:34) {
  sql: 'SELECT `value` FROM setting WHERE `key` = ?  limit ?',
  bindings: [ 'trustProxy', 1 ]
}
    at process.unexpectedErrorHandler (/opt/uptime-kuma/server/server.js:1899: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
frenck commented 9 months ago

Any error in the integration is not a concern for that add-on.

As said, if you have issue with the integration, please report it with the custom integration author.

../Frenck

xelemorf commented 9 months ago

Bugreport created for the integration: https://github.com/louislam/uptime-kuma/issues/4502