Skip to content

fix: drop unused libpq-dev to restore the automation image build - #546

Merged
hieptl merged 1 commit into
mainfrom
fix/automation-image-libssl-conflict
Oct 2, 2026
Merged

hieptl merged 1 commit into
mainfrom
fix/automation-image-libssl-conflict

Conversation

@hieptl

@hieptl hieptl commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Why

Build and Push Automation Image has failed on every build since 2026-10-02 03:18 UTC, starting with the push to main for #541 and then on the release PR #545, so no automation image can be built or released:

libssl-dev : Depends: libssl3t64 (= 3.5.7-1~deb13u2) but 3.5.7-1~deb13u3 is to be installed
E: Unable to correct problems, you have held broken packages.

containers/Dockerfile starts from the floating python:3.12-slim-trixie tag but installs packages from the Debian snapshot pinned in #513 (20260913T000000Z). On 2026-10-01 the tag was republished (sha256:dddfd7e…) with libssl3t64 3.5.7-1~deb13u3 installed, from the Debian security update of 2026-09-30. The snapshot only has libssl-dev 3.5.7-1~deb13u2, which needs libssl3t64 at exactly that version, and apt will not downgrade the one in the base image. libpq-dev is what pulls libssl-dev in. The builds before it used sha256:f77ac9e…, which ships deb13u2.

Two things in that step are wrong:

  • libpq-dev is not used. The service connects with asyncpg and the migrations with pg8000; neither links against libpq, nothing in uv.lock does, and the image has no compiler that could use the headers. It has been in the Dockerfile since the code moved here in Migrate automation source code from deploy repo #3.
  • Security updates come from bookworm-security, Debian 12's suite, in a Debian 13 image. The SDK agent-server image this step follows uses trixie-security. As it is, the image gets no trixie security fixes from the snapshot, and moving the snapshot forward would not have fixed this build: libssl-dev 3.5.7-1~deb13u3 is only in trixie-security.

Summary

  • Install only git. libpq-dev, and with it libssl-dev, is no longer installed.
  • Read security updates from trixie-security. At the pinned snapshot this changes no installed package.
  • Update the comment on the step to match.

The image keeps the base image's OpenSSL (3.5.7-1~deb13u3); nothing is downgraded.

Not in this PR: the base image tag still floats while the snapshot is kept at least seven days old, so a later base image can conflict the same way. For example, git needs perl, which requires perl-base at its exact version, and perl-base comes with the base image. Pinning the base image by digest and moving it with the weekly snapshot update would close that.

How to Test

All builds use docker build --platform linux/amd64 --pull --no-cache -f containers/Dockerfile ., which pulls python:3.12-slim-trixie@sha256:dddfd7e…, the image CI fails on.

  • On main: fails with the error above.
  • On this branch: builds. apt installs 31 packages and upgrades none. docker buildx build --check: no warnings.
  • In the built image:
    • libssl3t64 and openssl are 3.5.7-1~deb13u3; libpq5, libpq-dev and libssl-dev are not installed.
    • git --version: 2.47.3. ddtrace-run works. The container runs as automation (42420).
  • Against Postgres 16 (postgres:16-alpine):
    • alembic upgrade head (pg8000) migrates an empty database to 029.
    • A direct asyncpg query reads alembic_version.
    • The image's own command, with AUTOMATION_DB_HOST pointing at it, starts, and GET /health returns 200 {"status":"ok"} with no errors in the log.
  • With AUTOMATION_DB_URL=sqlite+aiosqlite:////tmp/automations.db, the same start and /health check pass.

python:3.12-slim-trixie was republished with libssl3t64 3.5.7-1~deb13u3,
newer than the pinned Debian snapshot, so installing libpq-dev failed:
the snapshot's libssl-dev requires libssl3t64 3.5.7-1~deb13u2 exactly.

- Drop libpq-dev. Nothing uses libpq: the service connects with asyncpg
  and the migrations with pg8000, and the image has no compiler that
  could use the headers.
- Read security updates from trixie-security, the suite for this
  Debian 13 image, instead of bookworm-security.
@github-actions github-actions Bot added the type: fix A bug fix label Oct 2, 2026
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Coverage

Warning

Your comment is too long (maximum is 65536 characters), so the coverage report was not added. See the job log for how to reduce it.

@hieptl
hieptl requested a review from all-hands-bot October 2, 2026 04:40

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This review was posted by an AI agent (OpenHands).

Scope. The change belongs here: containers/Dockerfile is owned by this repository (per AGENTS.md repository structure), and it fixes a build regression in this repo's own automation image.

What I verified on the current head (9663964)

  • The diff is exactly the three intended edits: libpq-dev dropped from the install line, the security suite changed from bookworm-security to trixie-security, and the step comment updated. No unrelated changes.
  • libpq-dev/libpq is not used anywhere in the repo. The service connects via asyncpg and migrations via pg8000 (pyproject.toml, openhands/automation/db.py, migrations/env.py); no psycopg/libpq dependency exists in uv.lock, and the runtime image installs no compiler. Dropping it removes only the libssl-dev pull-in, not a runtime library (libpq5 was only present as a dependency of libpq-dev).
  • trixie-security is the correct suite for this Debian 13 (trixie) base image; the previous bookworm-security was the Debian 12 suite. Both suites exist at the pinned snapshot, and the actual trixie-security snapshot suite directory and Release file resolve with HTTP 200, so the apt-get update step will succeed.
  • git and its dependencies still install, and the base image's OpenSSL is retained (apt-get upgrade, not downgrade).
  • CI on this exact head is green, including Build and Push Automation Image (the workflow this PR repairs), plus unit-tests, backend, and pr-title.
  • Focused local tests pass: tests/test_update_debian_snapshot.py, tests/test_migration_history.py, tests/test_db.py (35 passed).

Note (non-blocking). The PR correctly documents that the python:3.12-slim-trixie base tag still floats while the snapshot is held at least seven days old, so a future base-image republish can reintroduce the same class of conflict (e.g. git -> perl -> perl-base). Pinning the base image by digest alongside the weekly snapshot update would close that; it is reasonably deferred as follow-up rather than a merge blocker.

✅ APPROVED

@hieptl
hieptl merged commit 1107213 into main Oct 2, 2026
12 checks passed
@openhands-release-bot openhands-release-bot Bot added the released: 1.17.0 Shipped in 1.17.0 label Oct 2, 2026
@openhands-release-bot

Copy link
Copy Markdown
Contributor

🚀 Released in 1.17.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released: 1.17.0 Shipped in 1.17.0 type: fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants