Undefined binding on DNS monitor update #2491

Closed
opened 2026-02-28 02:56:36 -05:00 by deekerman · 5 comments
Owner

Originally created by @bt90 on GitHub (Aug 18, 2023).

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

  • I checked and didn't find similar issue

🛡️ Security Policy

Description

My log is full of these:

Trace: Error: Undefined binding(s) detected for keys [0] when compiling RAW query: UPDATE `monitor` SET dns_
last_result = ? WHERE id = ?
    at Raw.toSQL (/app/node_modules/knex/lib/raw.js:110:13)
    at ensureConnectionCallback (/app/node_modules/knex/lib/execution/internal/ensure-connection-callback.js
:4:30)
    at Runner.ensureConnection (/app/node_modules/knex/lib/execution/runner.js:300:20)
    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.exec (/app/node_modules/redbean-node/dist/redbean-node.js:536:9)
    at process.<anonymous> (/app/server/server.js:1879:13)
    at process.emit (node:events:513:28)
    at emit (node:internal/process/promises:140:20)
    at processPromiseRejections (node:internal/process/promises:274:27)
    at processTicksAndRejections (node:internal/process/task_queues:97:32)

👟 Reproduction steps

I'm unsure what exactly is causing this

👀 Expected behavior

No errors

😓 Actual Behavior

Errors

🐻 Uptime-Kuma Version

1.23.0

💻 Operating System and Arch

Ubuntu 22.04

🌐 Browser

Firefox 116

🐋 Docker Version

No response

🟩 NodeJS Version

No response

📝 Relevant log output

No response

Originally created by @bt90 on GitHub (Aug 18, 2023). ### ⚠️ Please verify that this bug 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) ### Description My log is full of these: ``` Trace: Error: Undefined binding(s) detected for keys [0] when compiling RAW query: UPDATE `monitor` SET dns_ last_result = ? WHERE id = ? at Raw.toSQL (/app/node_modules/knex/lib/raw.js:110:13) at ensureConnectionCallback (/app/node_modules/knex/lib/execution/internal/ensure-connection-callback.js :4:30) at Runner.ensureConnection (/app/node_modules/knex/lib/execution/runner.js:300:20) 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.exec (/app/node_modules/redbean-node/dist/redbean-node.js:536:9) at process.<anonymous> (/app/server/server.js:1879:13) at process.emit (node:events:513:28) at emit (node:internal/process/promises:140:20) at processPromiseRejections (node:internal/process/promises:274:27) at processTicksAndRejections (node:internal/process/task_queues:97:32) ``` ### 👟 Reproduction steps I'm unsure what exactly is causing this ### 👀 Expected behavior No errors ### 😓 Actual Behavior Errors ### 🐻 Uptime-Kuma Version 1.23.0 ### 💻 Operating System and Arch Ubuntu 22.04 ### 🌐 Browser Firefox 116 ### 🐋 Docker Version _No response_ ### 🟩 NodeJS Version _No response_ ### 📝 Relevant log output _No response_
deekerman 2026-02-28 02:56:36 -05:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@bt90 commented on GitHub (Aug 18, 2023):

All my DNS monitors seem to work though.

@bt90 commented on GitHub (Aug 18, 2023): All my DNS monitors seem to work though.
Author
Owner

@chakflying commented on GitHub (Aug 19, 2023):

This could be caused by invalid data returned by the DNS Server. Are you using the "CAA" resolve type?

@chakflying commented on GitHub (Aug 19, 2023): This could be caused by invalid data returned by the DNS Server. Are you using the "CAA" resolve type?
Author
Owner

@bt90 commented on GitHub (Aug 19, 2023):

I'm running three DNS monitors:

  • A
  • AAAA
  • CNAME
@bt90 commented on GitHub (Aug 19, 2023): I'm running three DNS monitors: * A * AAAA * CNAME
Author
Owner

@bt90 commented on GitHub (Aug 19, 2023):

I missed one and that seems to be the offender here.

grafik

@bt90 commented on GitHub (Aug 19, 2023): I missed one and that seems to be the offender here. ![grafik](https://github.com/louislam/uptime-kuma/assets/1926175/4b51f14a-476b-45b1-8892-8d63525d9204)
Author
Owner

@bt90 commented on GitHub (Aug 19, 2023):

The output looks valid though?

dig -x 127.0.0.1 @192.168.178.2
; <<>> DiG 9.18.12-0ubuntu0.22.04.2-Ubuntu <<>> -x 127.0.0.1 @192.168.178.2
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13115
;; flags: qr rd ra; QUERY: 1, ANSWER: 11, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;1.0.0.127.in-addr.arpa.                IN      PTR

;; ANSWER SECTION:
1.0.0.127.in-addr.arpa. 60      IN      PTR     localhost.
1.0.0.127.in-addr.arpa. 60      IN      PTR     proliant.
1.0.0.127.in-addr.arpa. 60      IN      PTR     proliant.fritz.box.
1.0.0.127.in-addr.arpa. 60      IN      PTR     xxxxxxxxx.info.
1.0.0.127.in-addr.arpa. 60      IN      PTR     bitwarden.xxxxxxxxx.info.
1.0.0.127.in-addr.arpa. 60      IN      PTR     cockpit.xxxxxxxxx.info.
1.0.0.127.in-addr.arpa. 60      IN      PTR     jellyfin.xxxxxxxxx.info.
1.0.0.127.in-addr.arpa. 60      IN      PTR     nzbget.xxxxxxxxx.info.
1.0.0.127.in-addr.arpa. 60      IN      PTR     photoprism.xxxxxxxxx.info.
1.0.0.127.in-addr.arpa. 60      IN      PTR     status.xxxxxxxxx.info.
1.0.0.127.in-addr.arpa. 60      IN      PTR     syncthing.xxxxxxxxx.info.

;; Query time: 0 msec
;; SERVER: 192.168.178.2#53(192.168.178.2) (UDP)
;; WHEN: Sat Aug 19 15:10:09 CEST 2023
;; MSG SIZE  rcvd: 304

I'm not sure why the code only stores the first one?

github.com/louislam/uptime-kuma@9564550d5f/server/model/monitor.js (L587-L588)

 dnsMessage += dnsRes.join(" | ")

Would be also valid for PTR records.

@bt90 commented on GitHub (Aug 19, 2023): The output looks valid though? ```sh dig -x 127.0.0.1 @192.168.178.2 ``` ``` ; <<>> DiG 9.18.12-0ubuntu0.22.04.2-Ubuntu <<>> -x 127.0.0.1 @192.168.178.2 ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13115 ;; flags: qr rd ra; QUERY: 1, ANSWER: 11, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;1.0.0.127.in-addr.arpa. IN PTR ;; ANSWER SECTION: 1.0.0.127.in-addr.arpa. 60 IN PTR localhost. 1.0.0.127.in-addr.arpa. 60 IN PTR proliant. 1.0.0.127.in-addr.arpa. 60 IN PTR proliant.fritz.box. 1.0.0.127.in-addr.arpa. 60 IN PTR xxxxxxxxx.info. 1.0.0.127.in-addr.arpa. 60 IN PTR bitwarden.xxxxxxxxx.info. 1.0.0.127.in-addr.arpa. 60 IN PTR cockpit.xxxxxxxxx.info. 1.0.0.127.in-addr.arpa. 60 IN PTR jellyfin.xxxxxxxxx.info. 1.0.0.127.in-addr.arpa. 60 IN PTR nzbget.xxxxxxxxx.info. 1.0.0.127.in-addr.arpa. 60 IN PTR photoprism.xxxxxxxxx.info. 1.0.0.127.in-addr.arpa. 60 IN PTR status.xxxxxxxxx.info. 1.0.0.127.in-addr.arpa. 60 IN PTR syncthing.xxxxxxxxx.info. ;; Query time: 0 msec ;; SERVER: 192.168.178.2#53(192.168.178.2) (UDP) ;; WHEN: Sat Aug 19 15:10:09 CEST 2023 ;; MSG SIZE rcvd: 304 ``` I'm not sure why the code only stores the first one? https://github.com/louislam/uptime-kuma/blob/9564550d5fd01daade5b9d0935ca2ac065ea1068/server/model/monitor.js#L587-L588 ```js dnsMessage += dnsRes.join(" | ") ``` Would be also valid for PTR records.
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#2491
No description provided.