Repository navigation
fix(docker): disable Prisma's update check so it stops leaving zombie processes - #52642
Conversation
|
bugbot run |
[Medium impact] The reviewed changes appear safe to merge.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merging this PR will not alter performance1 warning
Comparing Footnotes |
|
bugbot run |
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 348a9d3. Configure here.
Ports CHECKPOINT_DISABLE=1 from main's Dockerfile (#52642), so the FIPS image stops leaving zombie Prisma processes the same way.
* feat(docker): add FIPS 140-3 image with build-time crypto verification Dockerfile.fips builds on chainguard-base-fips with FIPS-provider-linked python/node/openssl from the org apk repo (CMVP #5132). A fips-check stage runs openssl-fips-test and an ELF allowlist gate: every native binary must be in the reviewed fips_elf_inventory.txt or carry an explicit bundled-crypto waiver, so new native deps fail the build until reviewed. Known offenders are waived pending the dependency-fix workstream and the report ships at /fips-scan-report.txt * fix(docker): bring the FIPS image up to today's Dockerfile Ports main's Dockerfile changes since #41802 was written: pgbouncer 1.26.0, the dashboard vendor folder, rust for the maturin build, libssl3, the packaging/litellm-proxy workspace member, the admin-mcp group and LITELLM_RELEASE_TAG. litellm-proxy, the opt-in Rust forwarding server, stays out of this image. The Wolfi base now ships OpenSSL 4, so the scan also counts a binary linked against the system libcrypto.so.4 as system-linked. The inventory adds the amd64 binaries from today's lock and keeps #41802's arm64 entries. * ci: list the FIPS Dockerfile in the CI coverage allowlist No pull request job holds the Chainguard token its base image and apk repo need. * fix(fips): fail the ELF scan on a missing root and add its tests The scan now stops when a root is missing, find cannot read a directory, or no ELF binary is found, instead of printing PASS for zero binaries. The enterprise admin UI build step gets the Chainguard apk login like every other apk call in this Dockerfile. * revert(fips): keep the Chainguard login out of the admin UI build The pinned virtualapk repo answers without a login, so build_admin_ui.sh installs curl as is, and exporting the token there would hand it to the nvm installer and the npm build. * refactor(fips): pin scan waivers to exact binaries, move scan tests to their mirrored path Each waiver now names the one binary seen in the image, so a new package next to a waived one fails the scan. The unused xmlsec and libsodium waivers are gone. Build steps move from Dockerfile comments to the docker README. * test(fips): run the scan tests with main's other shell-script tests in test-linting tests/unit forbids subprocesses, so the scan tests move next to test_e2e_idp_stack.py, which already exercises a shell script the same way, and get their own test-linting step. * docs(fips): note the PBMAC1 requirement for a PKCS#12 sslidentity in the FIPS image * test(fips): pin the scan's match on wheel libs that carry an upstream and an auditwheel hash * fix(fips): disable Prisma's update check in the FIPS image too Ports CHECKPOINT_DISABLE=1 from main's Dockerfile (#52642), so the FIPS image stops leaving zombie Prisma processes the same way. * fix(fips): close the crypto scan's path, name and symlink gaps - Waivers match one exact path under the venv's site-packages or /opt/prisma, so a waived name nested deeper or inside a look-alike folder still fails - Names with leading or trailing spaces are scanned, and a newline anywhere in a path fails the scan before it starts - A symlink that points outside the roots is scanned at its own path; one that dangles or points at a folder outside the roots fails the scan - A crypto library is flagged by its file name too, so psycopg-binary's libssl, libk5crypto and libcrypt are now waived by name instead of listed as clean - The venv's three python links join the inventory --------- Co-authored-by: Oliver Jensen <oliver@berri.ai>
Handwritten 1-3 sentence description
Stops the Docker image from leaving zombie processes after startup with a database attached, by turning off a background update check in our database tool that we never used.
Details
Link to Devin session: https://app.devin.ai/sessions/396be2cf2c7c4dccbb2a5234010ae9db
Open in Devin Desktop: https://app.devin.ai/desktop/session/396be2cf2c7c4dccbb2a5234010ae9db?variant=devin
Requested by: @kenneth-berri
TLDR
Problem this solves:
[node-MainThread] <defunct>processes after startupHow it solves it:
CHECKPOINT_DISABLE=1in the imageUser Flow
Before: someone running the Docker image with a database sees zombie processes on the host after every start
DATABASE_URLset and wait forGET http://localhost:4000/health/livelinessto return 200ps -eo pid,ppid,stat,cmdon the host[node-MainThread] <defunct>rows whose parent is the litellm process, and their monitoring reports zombie processesAfter: the same start leaves no zombie processes
DATABASE_URLset and wait forGET http://localhost:4000/health/livelinessto return 200ps -eo pid,ppid,stat,cmdon the hostRelevant issues
Fixes #33414
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or moreScreenshots / Proof of Fix
Both images were built from this checkout with the same command, and the only difference is the Dockerfile. Before uses the Dockerfile at the merge base and After uses the one at the PR tip. Each image was started next to a fresh
postgres:16container, with no init process, and the host process list was read 15 seconds after the liveliness check returned 200.Build, run from the repo root:
The Before image used the same command with
-fpointing at the output ofgit show 0e62b0690249755e3d3bfa2c97d2a31f3d4b4155:litellm/deploy/docker/Dockerfileand the taglitellm-33414:before.config.yaml:
run.sh, used as
./run.sh <image> <name>. Env vars passed to the proxy are DATABASE_URL, LITELLM_MASTER_KEY and OPENAI_API_KEYBefore (0e62b06)
./run.sh litellm-33414:before beforeAfter (a849057)
./run.sh litellm-33414:after afterRegression test
test_proxy_startup_leaves_no_zombie_processesboots the built image against a fresh Postgres and fails if any defunct process is left after startup. It was run against both images withLITELLM_IMAGE=<image> python -m pytest --noconftest -q tests/integration/database/image/test_offline_image_migration.py -k zombie.Against
litellm-33414:before:Against
litellm-33414:after:Type
🐛 Bug Fix
Caveats (if any)
Low
Final Attestation
Note
Low Risk
Single env var in the Docker image plus an integration test gated on LITELLM_IMAGE; no runtime application logic changes.
Overview
Sets
CHECKPOINT_DISABLE=1in the runtime Docker image so Prisma does not run its background update/checkpoint path, which was spawning detachednodehelpers during startup migrations.Because the proxy runs as PID 1 with no init, those children were reparented to it and showed up as
[node-MainThread] <defunct>on the host after liveliness succeeded.Adds an image-gated integration test (
test_proxy_startup_leaves_no_zombie_processes) that boots the built image against Postgres, waits for/health/liveliness, then asserts no zombie processes remain in/proc.Reviewed by Cursor Bugbot for commit 348a9d3. Bugbot is set up for automated code reviews on this repo. Configure here.