Skip to content

fix(database): inline validated ids in Btrfs and ZFS history queries for InfluxDB OSS (#1111) - #1124

Merged
Starosdev merged 2 commits into
developfrom
fix/1111-influx-params-oss
Nov 5, 2026
Merged

Starosdev merged 2 commits into
developfrom
fix/1111-influx-params-oss

Conversation

@Starosdev

@Starosdev Starosdev commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

The Btrfs filesystem and ZFS pool detail pages never show their usage history charts on InfluxDB OSS. GetBtrfsMetricsHistory and GetZFSPoolMetricsHistory used Flux query parameters (params.uuid, params.guid), which only InfluxDB Cloud supports. OSS rejects every call with undefined identifier params, the handlers log a warning, and the API returns metrics_history: null.

GetZFSPoolMetricsHistory was fixed in #157 and regressed one day later: merge 98a1b439 resolved a conflict back to the parameterized form. The Btrfs query was added in May with the same construct. Nothing in CI caught either.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • CI/CD or infrastructure change

Related Issues

Fixes #1111
Related to #155, #157

Changes Made

Testing

  • I have tested this locally
  • I have added/updated tests that prove my fix/feature works
  • All existing tests pass

Local: go build ./webapp/backend/pkg/database/ and go vet ./webapp/backend/pkg/database/ pass; gofmt -l clean on changed files; pre-commit gofmt and vet hooks pass. The Go test suite and golangci-lint run in CI on this PR; I did not run the full suite locally. No Btrfs or ZFS host was available to verify the chart end to end; the issue reporter's reproduction (metrics_history: null plus the undefined identifier params warning) is the failing path these changes remove.

Review: not required (change ships through the develop-to-master promotion PR and a manual release, no direct production effect on merge)

Follow-up

Even with the query working, both charts are capped at the main bucket's 15-day retention: btrfs_filesystem and zfs_pool are not part of the downsampling tasks, and lookupBucketName routes month and year ranges to _weekly / _monthly buckets that hold no data for them. Not addressed here; an enhancement issue for downsampling the capacity fields and adding a range selector on both detail pages is still to be filed.

beta carries the same two params.* queries (scrutiny_repository_btrfs.go:215, scrutiny_repository_zfs.go:382) and gets this fix through the next master-into-beta sync. The forbidigo rule will flag them there until the sync lands.

Checklist

  • My code follows the project's code style
  • I have performed a self-review of my code
  • I have commented my code where necessary (particularly complex areas)
  • I have updated the documentation if needed
  • My changes generate no new warnings

…for InfluxDB OSS (#1111)

Flux query parameters (params.*) are an InfluxDB Cloud feature. InfluxDB OSS,
which the omnibus image ships, rejects them with "undefined identifier params",
so GetBtrfsMetricsHistory and GetZFSPoolMetricsHistory failed on every call
and the detail pages never showed their usage history charts.

GetZFSPoolMetricsHistory was fixed in #157 and regressed one day later when
merge 98a1b43 resolved a conflict back to the parameterized form. The Btrfs
query was added afterwards with the same construct.

- Validate the identifier inside each repository function and inline it as a
  strconv.Quote Flux string literal, the pattern GetMdadmMetricsHistory and the
  temperature queries already use.
- Add a forbidigo rule so QueryWithParams and QueryRawWithParams fail lint,
  which stops a merge-conflict resolution from restoring the pattern silently.
- Add tests that assert the generated query inlines the quoted id, never
  contains params., and that an invalid id is rejected before any query runs.

Closes #1111
@Starosdev
Starosdev merged commit b0a1c69 into develop Nov 5, 2026
19 checks passed
Starosdev pushed a commit that referenced this pull request Nov 5, 2026
## [1.80.0](v1.79.3...v1.80.0) (2026-11-05)

### Features

* **btrfs:** notify on degraded filesystems, device errors and scrub errors ([#1127](#1127)) ([36e1e23](36e1e23)), closes [#1110](#1110)
* manual release trigger ([44f3e44](44f3e44))
* **notify:** alert when Btrfs or ZFS usage reaches a configurable threshold ([#1133](#1133)) ([6e79118](6e79118)), closes [#1127](#1127) [#1132](#1132) [#1127](#1127)
* **zfs:** notify on unhealthy pools, error totals and scrub errors ([#1131](#1131)) ([9c6544c](9c6544c)), closes [#1127](#1127) [#1130](#1130) [#1127](#1127)

### Bug Fixes

* **database:** inline validated ids in Btrfs and ZFS history queries for InfluxDB OSS ([#1111](#1111)) ([#1124](#1124)) ([b0a1c69](b0a1c69)), closes [#157](#157) [#155](#155) [#157](#157) [#157](#157)
* **mdadm:** honor repeat notifications and retry failed degraded alerts ([#1128](#1128)) ([62f9cef](62f9cef)), closes [#1109](#1109)
* **notify:** notify on manufacturer SMART failures at every notify level ([#1126](#1126)) ([5cb3622](5cb3622))
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