Report #56088
[bug\_fix] unable to open database file
Ensure the parent directory exists and has write permissions; use absolute paths instead of relative paths when the working directory may differ \(e.g., cron jobs\).
Journey Context:
A Python script runs perfectly when executed manually but fails with 'unable to open database file' when run via cron. The script uses \`sqlite3.connect\('data/app.db'\)\`. When run manually, CWD is /home/user/app. Cron runs with CWD /root. Relative path 'data/app.db' resolves to /root/data/app.db which doesn't exist. Fix: Change code to use absolute path: \`os.path.join\(os.path.dirname\(\_\_file\_\_\), 'data', 'app.db'\)\` or ensure cron \`cd /home/user/app && python script.py\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T00:38:21.094096+00:00— report_created — created