Job Monitor Fixes — 2026-06-24
Section titled “Job Monitor Fixes — 2026-06-24”Three jobs alerting CRITICAL. Three distinct root causes. All fixed.
Jobs Fixed
Section titled “Jobs Fixed”| Job | Root Cause | Fix |
|---|---|---|
| Full Maintenance (my_backup) | set PYTHONUTF8=1 && in WSL cron — trailing space corrupts the value, Python fatal crash | Removed set PYTHONUTF8=1 && from both monthly cmd.exe cron entries |
| Asset History Weekly Update | stooq.com added JS bot-verification ~2026-06-14 — Python requests gets 404, unhandled HTTPError crashes entire update | Added RequestException handler in bank_of_canada._fetch() to return [] gracefully — commit eff8754 |
| System Image (my_backup) | Path("D:") / "WindowsImageBackup" resolves CWD-relative, not D:\ root — script couldn’t find the image wbAdmin created; also returned True (false success) when folder not found | Fixed path to Path("D:/WindowsImageBackup"); changed false-success return to False — commit 4d0e3a1 |
System Image — Additional Context
Section titled “System Image — Additional Context”wbAdmin ran fine (Task Scheduler task has RunLevel: Highest). The image was created at D:\WindowsImageBackup but the Python script missed it due to the path bug. Talbot manually moved it to D:\bak\System_Images\2026JN24. Drive root clean for July 1.
Watch: July 1 — first fully-fixed end-to-end run. Expect D:\bak\System_Images\2026JL01 to appear and job monitor to stay green.
Files Changed
Section titled “Files Changed”| File | Repo |
|---|---|
src/asset_history/sources/bank_of_canada.py | asset-history (eff8754) |
src/my_backup/create_system_image.py | my_backup (4d0e3a1) |
crontab (WSL) | removed set PYTHONUTF8=1 && from 2 monthly cmd.exe entries |
Gotchas
Section titled “Gotchas”set VAR=value && in cmd.exe — the space before && is included in the value. Python’s PYTHONUTF8 only accepts exactly "0" or "1" — "1 " (with space) causes a fatal crash before any Python runs. Use set "VAR=value" && (quoted form strips trailing space) or just drop the set if not needed.
Path("D:") is CWD-relative in Python — resolves to D:<current-working-directory>, not D:\. Use Path("D:/") or Path("D:\\") when addressing a drive root explicitly.
stooq.com is no longer usable as a data source — JS bot-verification wall as of ~2026-06-14. Any tool using https://stooq.com/q/d/l/ via requests will get 404 or a JS challenge page. Bank of Canada TSX data now unavailable from this source.
Job monitor heartbeat traces the exit code, not the error — when diagnosing alerts, work backwards: heartbeats/<job>.json → script exit code → what the script did → what the underlying tool did. The alert subject tells you nothing about the root cause.