Skip to content

Fix VIRTNBD_FALSE_SUCCESS false-positive on Windows VMs with BitLocker#2

Open
hostarts wants to merge 1 commit into
doutsis:mainfrom
hostarts:fix/windows-bitlocker-false-positive
Open

Fix VIRTNBD_FALSE_SUCCESS false-positive on Windows VMs with BitLocker#2
hostarts wants to merge 1 commit into
doutsis:mainfrom
hostarts:fix/windows-bitlocker-false-positive

Conversation

@hostarts
Copy link
Copy Markdown

Summary

perform_backup()'s post-backup ERROR-line scan used a case-insensitive substring match (grep -qi "ERROR"), which fires on any occurrence of the word "ERROR" in the captured virtnbdbackup log — including INFO/WARN payloads. On Windows VMs the QEMU guest agent surfaces BitLocker status text that legitimately contains the word "ERROR" during normal operation, so otherwise-successful backups are flagged as VIRTNBD_FALSE_SUCCESS, retried, and generate spurious alert noise.

The check is now anchored to the timestamped severity prefix:

^[YYYY-MM-DD HH:MM:SS] ERROR 

so only real ERROR-level log records trigger the guard. ANSI colour escapes emitted by virtnbdbackup are stripped before the anchor match so coloured output still matches. The same fix is applied to the diagnostic-snippet extraction that follows.

What changed

  • vmbackup.sh (perform_backup, ~line 3590): switched the false-success guard and the snippet extractor to sed -E 's/\x1b\[[0-9;]*m//g' | grep -qE '^\[[0-9-]{10} [0-9:]{8}\] ERROR '.
  • CHANGELOG.md: added [Unreleased] entry under ### Fixed.

Test plan

  • In production, the failing run was a Windows VM whose guest-agent output contained the substring ERROR inside a BitLocker status line; old grep matched, new grep does not.
  • Verified anchored regex still catches real [2026-05-01 12:34:56] ERROR ... lines emitted by virtnbdbackup.
  • bash -n vmbackup.sh passes.

🤖 Generated with Claude Code

The post-backup ERROR-line scan in perform_backup() used a case-
insensitive substring match (grep -qi "ERROR"), which fired on the
word "ERROR" appearing inside INFO/WARN payloads. On Windows VMs the
QEMU guest agent surfaces BitLocker status text that contains the word
during normal operation, marking otherwise-successful backups as failed
and triggering retries and spurious alert noise.

The check is now anchored to the timestamped severity prefix
(^[YYYY-MM-DD HH:MM:SS] ERROR ) so only real ERROR-level records trigger
the guard. ANSI colour escapes from virtnbdbackup are stripped before
the anchor match so coloured output still matches. Same fix applied to
the diagnostic snippet extraction.
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