Skip to content

fix: upgrade to node:24-trixie and rebuild sqlite3 from source#1576

Merged
TheLastCicada merged 2 commits into
v2-rc2from
fix/sqlite3-glibc-mismatch
Apr 9, 2026
Merged

fix: upgrade to node:24-trixie and rebuild sqlite3 from source#1576
TheLastCicada merged 2 commits into
v2-rc2from
fix/sqlite3-glibc-mismatch

Conversation

@TheLastCicada

@TheLastCicada TheLastCicada commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The node:24 Docker image defaults to Debian Bookworm (glibc 2.36)
  • The sqlite3 npm package (v6.0.1) downloads a prebuilt native binary via prebuild-install that requires glibc 2.38
  • This mismatch causes a fatal GLIBC_2.38 not found error at container startup, putting CADT pods into CrashLoopBackOff across all chiamanaged namespaces

Changes

  1. Upgrade base image from node:24 (Bookworm / glibc 2.36) to node:24-trixie (Debian 13 stable since Aug 2025 / glibc 2.41) — prebuilt native binaries are now compatible with the container's C library
  2. Add npm rebuild sqlite3 --build-from-source as a safety net — compiles the native addon against the container's actual glibc, guarding against future prebuilt binary mismatches
  3. Add Docker smoke test CI workflow — builds the image and verifies native module loading + container startup on every PR and push to develop/main/v2-*. This would have caught the GLIBC mismatch before it reached k8s.

Test plan

  • New Docker Smoke Test CI workflow passes on this PR
  • CADT container starts without GLIBC_2.38 not found error
  • Pods recover from CrashLoopBackOff after redeployment with new image

Note

Medium Risk
Moderate risk because it changes the production container base image and native module build behavior, which can affect runtime compatibility and image size/build time.

Overview
Fixes a container startup failure caused by sqlite3 native binary/glibc incompatibility by switching the Docker base image from node:24 to node:24-trixie and forcing sqlite3 to rebuild from source during npm install.

Adds a GitHub Actions Docker Smoke Test workflow that builds the image, verifies require('sqlite3') works, starts the container, and checks /health, /v1/health, and /v2/health endpoints on PRs and pushes to develop/main/v2-*.

Reviewed by Cursor Bugbot for commit a1b24fd. Bugbot is set up for automated code reviews on this repo. Configure here.

@TheLastCicada TheLastCicada force-pushed the fix/sqlite3-glibc-mismatch branch from 79db177 to c696cb0 Compare April 8, 2026 21:12
@TheLastCicada TheLastCicada changed the title fix: rebuild sqlite3 from source to match container glibc fix: upgrade to node:24-trixie and rebuild sqlite3 from source Apr 8, 2026
Comment thread .github/workflows/docker-smoke-test.yml Fixed
@TheLastCicada TheLastCicada force-pushed the fix/sqlite3-glibc-mismatch branch from e3e8ae9 to 4d3601e Compare April 8, 2026 21:19
Comment thread .github/workflows/docker-smoke-test.yml Fixed
@TheLastCicada TheLastCicada force-pushed the fix/sqlite3-glibc-mismatch branch from 4d3601e to 9e9c812 Compare April 8, 2026 21:33

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Container cleanup skipped when health checks fail
    • Added an EXIT trap in the smoke-test run block so cadt-test is always removed even when health checks or early exits fail.

Create PR

Or push these changes by commenting:

@cursor push a446245e02
Preview (a446245e02)
diff --git a/.github/workflows/docker-smoke-test.yml b/.github/workflows/docker-smoke-test.yml
--- a/.github/workflows/docker-smoke-test.yml
+++ b/.github/workflows/docker-smoke-test.yml
@@ -33,6 +33,7 @@
 
       - name: Verify container starts and health endpoints respond
         run: |
+          trap 'docker rm -f cadt-test > /dev/null 2>&1 || true' EXIT
           docker run -d --name cadt-test \
             -e USE_SIMULATOR=true \
             -e BIND_ADDRESS=0.0.0.0 \

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9e9c812. Configure here.

Comment thread .github/workflows/docker-smoke-test.yml Outdated
The node:24 image defaults to Debian Bookworm (glibc 2.36), but the
sqlite3 prebuilt binary requires glibc 2.38. This causes a fatal
GLIBC_2.38-not-found crash at startup, putting all CADT pods into
CrashLoopBackOff.

Two-part fix:
- Switch base image from node:24 (Bookworm) to node:24-trixie
  (Debian 13 stable, glibc 2.41) so prebuilt native binaries are
  compatible with the container's C library
- Add npm rebuild sqlite3 --build-from-source as a safety net so the
  native addon is always compiled against the container's actual glibc
@TheLastCicada TheLastCicada force-pushed the fix/sqlite3-glibc-mismatch branch from 9e9c812 to 4947c31 Compare April 8, 2026 21:44
Build the Docker image and verify it works on every PR and push to
develop/main/v2-*. Two checks:

1. Native module load — catches glibc mismatches like the GLIBC_2.38
   error that put all CADT pods into CrashLoopBackOff
2. Container startup — runs the app with USE_SIMULATOR=true and waits
   for the "Server listening" log message
@TheLastCicada TheLastCicada force-pushed the fix/sqlite3-glibc-mismatch branch from 4947c31 to a1b24fd Compare April 8, 2026 21:59
@TheLastCicada TheLastCicada merged commit 64299a6 into v2-rc2 Apr 9, 2026
36 of 37 checks passed
@TheLastCicada TheLastCicada deleted the fix/sqlite3-glibc-mismatch branch April 9, 2026 17:57
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.

3 participants