Fix builds for Ubuntu 22.04#1582
Conversation
V1's prepareDb() crashed with ECONNREFUSED when the MySQL mirror sidecar wasn't ready, causing the entire CADT process to exit. V2's prepareV2Db() already handled this gracefully with a try-catch. This aligns V1 with V2's behavior: log the error and continue with the main SQLite database. The mirror will reconnect on the next sync cycle via safeMirrorDbHandler. Also adds the missing connection.end() call in a finally block to prevent connection leaks on any failure path.
…rash fix: handle MySQL mirror connection failure gracefully in v1 prepareDb
Ubuntu 24.04 runners (GLIBC 2.39) produce sqlite3 native addons that require GLIBC_2.38, which is unavailable on Ubuntu 22.04 deployment targets (GLIBC 2.35). Pinning to 22.04 runners ensures the compiled node_sqlite3.node is compatible with all non-EOL Ubuntu LTS releases.
npm install downloads prebuilt node_sqlite3.node binaries compiled against GLIBC 2.38+. Force source compilation on Ubuntu runners so the native addon links against the runner's GLIBC (2.35 on ubuntu-22.04).
Explain why Linux runners are pinned to ubuntu-22.04, why sqlite3 is rebuilt from source, and when the runner version can be updated. Also fix stale "Setup Node 20.x" step name.
fix(CI): use Ubuntu 22.04 runners for Linux builds
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8ce837d. Configure here.
| build-command: npm run create-linux-x64-dist | ||
| sqlite-path: ./node_modules/sqlite3/build/Release/ | ||
| - runs-on: ubuntu-24.04-arm | ||
| - runs-on: ubuntu-22.04-arm |
There was a problem hiding this comment.
ARM runner may not provide expected GLIBC version
Medium Severity
The ubuntu-22.04-arm GitHub Actions runner has a known, unresolved issue (actions/partner-runner-images#134) where it actually runs an Ubuntu 24.04 image with GLIBC 2.39 instead of the expected 22.04 image with GLIBC 2.35. If still present, the ARM build would still produce binaries incompatible with Ubuntu 22.04, defeating the purpose of this change. The x64 ubuntu-22.04 runner is unaffected. It's worth verifying the actual GLIBC version on the ARM runner (e.g., via ldd --version) before relying on this for compatibility.
Reviewed by Cursor Bugbot for commit 8ce837d. Configure here.


Note
Medium Risk
Changes the release build pipeline to pin Linux runners and rebuild native
sqlite3from source, which directly affects produced artifacts. Also makes mirror-DB setup errors non-fatal, which could hide mirror connectivity issues while improving startup resilience.Overview
Build workflow now pins Linux GitHub Actions runners to
ubuntu-22.04/ubuntu-22.04-armand upgrades to Node24, with an addednpm rebuild sqlite3 --build-from-sourcestep to ensure thesqlite3native addon is GLIBC-compatible with Ubuntu 22.04+.Database initialization now wraps MySQL mirror DB creation/migrations in
try/finallyto always close the connection, and treats mirror setup failures as non-blocking (logging an error but continuing main DB startup).Reviewed by Cursor Bugbot for commit 8ce837d. Bugbot is set up for automated code reviews on this repo. Configure here.