Skip to content

Pin local Python services to linux/amd64#415

Merged
duckduckgrayduck merged 1 commit into
masterfrom
fix-local-pdfium-arch
Jun 15, 2026
Merged

Pin local Python services to linux/amd64#415
duckduckgrayduck merged 1 commit into
masterfrom
fix-local-pdfium-arch

Conversation

@eyeseast

Copy link
Copy Markdown
Contributor

Problem

Loading documentcloud/documents/processing/info_and_image/libpdfium.so2 fails inside the local Docker containers on Apple Silicon, with a misleading "unable to access the file" error. The file is present — the real issue is an architecture mismatch:

  • The vendored libpdfium.so2 is an x86-64 ELF binary.
  • On Apple Silicon, Docker runs the Python containers natively as arm64 (aarch64), so ctypes.cdll.LoadLibrary cannot load the wrong-architecture library.

Fix

Pin the Django/Celery services to linux/amd64 via the shared &django anchor in local.yml. This covers documentcloud_django, documentcloud_celeryworker, and documentcloud_celerybeat, matching the vendored binary and the production/Lambda x86-64 environment.

Verification

After rebuilding and recreating the services:

  • uname -m inside the container now reports x86_64 (was aarch64).
  • cdll.LoadLibrary('.../libpdfium.so2') succeeds.

Tradeoff

These three services now run under QEMU emulation on Apple Silicon, so they will be somewhat slower. Other services (postgres, redis, solr, minio) are unchanged and stay native arm64.

🤖 Generated with Claude Code

The vendored libpdfium.so2 is an x86-64 ELF binary, but on Apple
Silicon Docker runs the containers natively as arm64, so ctypes
cannot load the library. Pin the django/celery services to
linux/amd64 (via the &django anchor) to match the vendored binary
and the production/Lambda environment.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@duckduckgrayduck duckduckgrayduck merged commit e0c247c into master Jun 15, 2026
3 checks passed
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.

2 participants