Skip to content

chore(viewer): drop the always-on Qt debug logging from the image#2977

Merged
vpetersson merged 1 commit into
masterfrom
chore/drop-viewer-debug-logging
Jun 2, 2026
Merged

chore(viewer): drop the always-on Qt debug logging from the image#2977
vpetersson merged 1 commit into
masterfrom
chore/drop-viewer-debug-logging

Conversation

@vpetersson
Copy link
Copy Markdown
Contributor

Issues Fixed

Fleet observability: the viewer image ships unconditional Qt debug logging, which floods the device logs and makes them unreadable.

Description

Drop QT_LOGGING_RULES=*.debug=true and QT_QPA_DEBUG=1 from docker/Dockerfile.viewer.j2 (and the stale "Turn on debug logging for now" comment + commented-out qt.qpa.* rule).

These were a temporary bring-up aid ("for now", introduced in #2060, Nov 2024) that was never reverted — emitted unconditionally, on every board, in production. On a real device that's ~20+ Qt scenegraph / sh-chunk lines per second, which saturates balena's 1000-line log buffer in ~35 seconds and buries every application-level event (asset changes, errors, crashes). Observed directly while validating a live pi4 (stormy-sun): the entire 800-line log window covered only ~35s and contained zero application events under the debug spam.

No functional change to playback — only removes the firehose of qt.* debug output, restoring usable balena logs.

Checklist

  • I have performed a self-review of my own code.
  • New and existing unit tests pass locally and on CI with my changes (no code paths touched — Dockerfile ENV-only change).
  • End-to-end Pi test — N/A (removes debug ENVs only; no behavior change beyond log volume).
  • x86 — same template, debug ENVs removed for all boards.
  • Documentation — N/A.

🤖 Generated with Claude Code

- Remove `QT_LOGGING_RULES=*.debug=true` and `QT_QPA_DEBUG=1` from
  docker/Dockerfile.viewer.j2 (plus the stale "Turn on debug logging
  for now" comment + commented-out qt.qpa rule).
- These were a temporary bring-up aid ("for now", added in #2060,
  Nov 2024) that was never reverted: unconditional, every board, in
  production. On a real device that's ~20+ Qt scenegraph / sh-chunk
  log lines per second, which saturates balena's 1000-line log buffer
  in ~35 seconds and buries every application event (asset changes,
  errors, crashes) — actively harmful to fleet observability.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vpetersson vpetersson requested a review from a team as a code owner June 2, 2026 16:10
@vpetersson vpetersson self-assigned this Jun 2, 2026
@vpetersson vpetersson requested a review from Copilot June 2, 2026 16:10
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 2, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes unconditional Qt debug logging environment variables from the viewer Docker image template to prevent production devices from flooding balena logs and obscuring application-level events.

Changes:

  • Removed QT_LOGGING_RULES=*.debug=true and QT_QPA_DEBUG=1 from docker/Dockerfile.viewer.j2.
  • Removed the stale “Turn on debug logging for now” comment and the commented-out qt.qpa.* logging rule.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vpetersson vpetersson merged commit a0afeb0 into master Jun 2, 2026
8 checks passed
vpetersson added a commit that referenced this pull request Jun 2, 2026
)

With debug logging removed (#2977), two pre-existing startup warnings
became visible in the viewer logs. Both are fixed here:

- migrate_legacy_paths.sh: `set -euo pipefail` + the bare `${USER}` in
  USER_HOME aborted the script when $USER is unset — which is the case
  in-container (DATA mode, via migrate_in_container_paths.sh). On a
  legacy (screenly→anthias) device that would skip the in-container
  migration entirely. Fall back to `id -un` so it resolves without
  tripping `set -u`.
- AnthiasViewer: the MainWindow ctor called showFullScreen() AND main()
  called window->show(), showing the window twice. Under cage/wayland
  the double surface-commit tripped wlroots' "A configure is scheduled
  for an uninitialized xdg_surface" warning at startup. Show once, in
  main(), after construction.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vpetersson vpetersson mentioned this pull request Jun 2, 2026
5 tasks
vpetersson added a commit that referenced this pull request Jun 2, 2026
- CalVer (YYYY.0M.MICRO); still June 2026, micro 0 -> 1
- Ships the QML VideoOutput presentation path (#2975), the pi2/pi3
  GStreamer HW video pipeline (#2972), and the x86 WLR_DRM_NO_ATOMIC
  display-freeze fix (#2978)
- Also picks up Pi 4 eglfs rotation (#2971, #2973), the armv7 viewer
  spawn retry (#2969), the Writeback-connector headless guard (#2968),
  and viewer log cleanups (#2977, #2979)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

2 participants