Skip to content

bug(infra): backend image floats on python:3.13-slim — Debian release drift (bookworm→trixie) shipped libmagic 5.46 unnoticed, pin the codename or add a capability parity test #3079

Closed

Description

@vybe

Summary

#3046 was closed by a code-side workaround in upload_service.py (PR #3066: trust the ZIP container signature for a declared application/zip). The underlying cause is still live: docker/backend/Dockerfile builds FROM python:3.13-slim with no Debian codename, so a rebuild on any host silently follows Docker Hub when the tag is repointed. That is how bookworm→trixie brought in libmagic1t64 1:5.46-5 (buffer-detection regression, Debian bug #1115393) and, earlier, dropped the tzdata backward-compat links (#1823).

Two occurrences of the same class within one release cycle. Each was patched at the symptom; nothing stops the third.

Options (either closes this)

  1. Pin the codename in docker/{backend,scheduler,base-image}/Dockerfile — python:3.13-slim-bookworm (or -trixie deliberately, once trixie's libmagic is verified) — so a base-image change is a reviewed diff, not a rebuild side effect. Pair with the Python-version parity guard so the pin has one home (tests/unit/test_1891_python_version_parity.py is the precedent).
  2. Capability parity test for libmagic, the shape bug: legacy IANA timezone aliases (Europe/Kiev et al.) crash schedule creation with a 500 — pytz accepts, APScheduler's zoneinfo lookup can't resolve them inside the shipped image #1823 used for tz: a test that runs inside the built backend image (the prod-image-smoke / backend-image-smoke job is the natural host) builds a real in-memory ZIP and asserts magic.from_buffer(data, mime=True) == "application/zip", so the next libmagic regression fails CI instead of production.

The #3046 unit test test_real_zip_accepted_with_unmocked_magic runs on the CI runner's libmagic, not the image's, so it does not cover this — it passes on ubuntu-latest regardless of what the shipped image resolves.

Related

Activity

  1. harimaruthachalam commented on Sep 29, 2026

    @harimaruthachalam

    @vybe PR for this: #3082

    • backend and scheduler are pinned to python:3.13-slim-trixie. Trixie rather than bookworm, because both already install trixie-only packages (tzdata-legacy, postgresql-client-17). The tag resolves to the same image ID as today's python:3.13-slim, so nothing rebuilds differently.
    • The new guard requires every image FROM python: to name a codename (not a specific one, per test_1823), and requires backend and scheduler to share it, so validator and executor keep one tz database. It handles --platform, multi-stage AS, digest and alpine tags.
    • I didn't take option 2: a libmagic capability assert inside the trixie image would fail today because 5.46 has the bug, and ZIP handling is covered at code level by fix: accept declared ZIP uploads by signature when libmagic 5.46 misdetects them (#3046) #3066 and fix: classify shared ZIPs as application/zip when libmagic 5.46 misdetects them (#3080) #3081. The other images are Alpine, so this Debian drift doesn't apply to them. Details are in the PR.

    #3081 and #3082 each add an entry at the top of tests/registry.json. Whichever merges second, I'll resolve that with a follow-up commit.

  2. removed
    status-in-devMerged to dev, awaiting release cut to main
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions