louislam / uptime-kuma

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

v2 Beta - SQL Syntax error when saving Status Page #5336

Closed drewstopherlee closed 1 week ago

drewstopherlee commented 1 week ago

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

Unable to find similar issues via search.

šŸ›”ļø Security Policy

Description

When running the v2 Beta (specifically the nightly2 image, sha256:87ad383f586f9251eb6b644c45f2af3480f205d349b8bfa54c755fce323ee1b0), I get an error when trying to save changes made to a status page.

šŸ‘Ÿ Reproduction steps

Fresh install of v2 Beta, add monitors, create status page, while in edit mode, make changes and click Save.

šŸ‘€ Expected behavior

Changes should be applied to the status page and edit mode should close gracefully.

šŸ˜“ Actual Behavior

Red error popup with text that reads:

DELETE FROM `group` WHERE id NOT IN () AND status_page_id = 2 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND status_page_id = 2' at line 1

šŸ» Uptime-Kuma Version

2.0.0-beta.0-nightly-20241105100611

šŸ’» Operating System and Arch

Ubuntu Server 22.04.5 LTS x64

šŸŒ Browser

Google Chrome 130.0.6723.117 (64-bit)

šŸ–„ļø Deployment Environment

šŸ“ Relevant log output

2024-11-12T05:31:24.310916492Z 2024-11-12T00:31:24-05:00 [SOCKET] ERROR: Error: DELETE FROM `group` WHERE id NOT IN () AND status_page_id = 2 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND status_page_id = 2' at line 1
2024-11-12T05:31:24.310993811Z     at Packet.asError (/app/node_modules/mysql2/lib/packets/packet.js:738:17)
2024-11-12T05:31:24.311009959Z     at Query.execute (/app/node_modules/mysql2/lib/commands/command.js:29:26)
2024-11-12T05:31:24.311021485Z     at Connection.handlePacket (/app/node_modules/mysql2/lib/connection.js:481:34)
2024-11-12T05:31:24.311033423Z     at PacketParser.onPacket (/app/node_modules/mysql2/lib/connection.js:97:12)
2024-11-12T05:31:24.311051590Z     at PacketParser.executeStart (/app/node_modules/mysql2/lib/packet_parser.js:75:16)
2024-11-12T05:31:24.311068855Z     at Socket.<anonymous> (/app/node_modules/mysql2/lib/connection.js:104:25)
2024-11-12T05:31:24.311081174Z     at Socket.emit (node:events:519:28)
2024-11-12T05:31:24.311091473Z     at addChunk (node:internal/streams/readable:559:12)
2024-11-12T05:31:24.311101972Z     at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
2024-11-12T05:31:24.311150885Z     at Readable.push (node:internal/streams/readable:390:5) {
2024-11-12T05:31:24.311166361Z   code: 'ER_PARSE_ERROR',
2024-11-12T05:31:24.311176595Z   errno: 1064,
2024-11-12T05:31:24.311186693Z   sqlState: '42000',
2024-11-12T05:31:24.311197072Z   sqlMessage: "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND status_page_id = 2' at line 1",
2024-11-12T05:31:24.311208815Z   sql: 'DELETE FROM `group` WHERE id NOT IN () AND status_page_id = 2'
2024-11-12T05:31:24.311223323Z }
Ionys320 commented 1 week ago

Will provide a patch during the day.