Skip to content

fix(node): node stats query on MySQL and MariaDB - #1132

Merged
T3ST3ST3R0N merged 1 commit into
devfrom
fix/node-stats-mysql
Oct 30, 2026
Merged

T3ST3ST3R0N merged 1 commit into
devfrom
fix/node-stats-mysql

Conversation

@T3ST3ST3R0N

Copy link
Copy Markdown
Collaborator

GET /api/node/{id}/stats returned "Database temporarily unavailable" on MySQL 9 and MariaDB:

OperationalError: (1054, "Unknown column 'node_stats.created_at' in 'having clause'")

get_node_stats had its own copy of the "drop the partial first bucket" HAVING clause, and it repeated the whole truncation expression there. MySQL 9 and MariaDB reject that. _exclude_partial_first_bucket, which the usage queries already use, compares against the period_start alias instead, so get_node_stats now calls it.

Node system stats are only recorded on PostgreSQL, so on MySQL the endpoint now returns an empty list, as on SQLite.

The MySQL skip in test_stats_endpoint_accepts_normal_range (added in #1128) is removed, so CI covers the endpoint on MySQL and MariaDB again.

get_node_stats repeated the truncation expression in its HAVING clause,
which MySQL 9 and MariaDB reject (Unknown column 'node_stats.created_at').
Use _exclude_partial_first_bucket, which compares against the period_start
alias, and drop the MySQL skip in the bucket limits test.
@coderabbitai

coderabbitai Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c08d31b2-a1e1-4326-bf6b-597f4901593b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@T3ST3ST3R0N
T3ST3ST3R0N merged commit bdce1ac into dev Oct 30, 2026
28 checks passed
@T3ST3ST3R0N
T3ST3ST3R0N deleted the fix/node-stats-mysql branch October 30, 2026 15:24
Free-Guy-IR added a commit to Free-Guy-IR/panel that referenced this pull request Nov 4, 2026
Free-Guy-IR added a commit to Free-Guy-IR/panel that referenced this pull request Nov 4, 2026
…on port/w2-chain-v, the fork's get_node_stats has no HAVING since 1519b6b
Free-Guy-IR added a commit to Free-Guy-IR/panel that referenced this pull request Nov 4, 2026
…ard#1132 fork commits on port/w2-chain-ad after the rebase onto main 2cad25c, and record the generated client fix of the PasarGuard#1127 pick
Free-Guy-IR added a commit to Free-Guy-IR/panel that referenced this pull request Nov 4, 2026
…utbounds bucket test and MySQL skip obligations that the PasarGuard#1127 and PasarGuard#1132 rows defer to it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant