Skip to main content

Posts

Showing posts with the label Linux

Solved: "exec user process caused: exec format error" in Docker Containers

  You have just finished building a Docker image on your local machine. It runs perfectly in your local environment. You push it to your registry, deploy it to a Kubernetes cluster or a standard EC2 Linux instance, and the pod immediately enters a   CrashLoopBackOff . Checking the logs reveals the fatal error: standard_init_linux.go:228: exec user process caused: exec format error If you are working on an Apple Silicon machine (M1, M2, or M3) and deploying to a standard cloud environment (AWS, GCP, Azure), this is not a script error. It is a CPU architecture mismatch. The Root Cause: Binary Incompatibility This error message comes directly from the Linux kernel, not Docker itself. When a container starts, Docker invokes the entrypoint command. The kernel attempts to load the binary executable defined in that entrypoint. The kernel reads the file's  ELF (Executable and Linkable Format)  header to determine which instruction set architecture (ISA) the binary was compil...

Why `RPi.GPIO` Fails on Raspberry Pi 5 (And How to Fix It)

  If you recently unboxed a Raspberry Pi 5, flashed Raspberry Pi OS Bookworm, and attempted to run your trusty Python scripts, you likely hit a wall. Scripts that have run reliably on the Pi 3 and 4 for years are suddenly throwing   RuntimeError: No access to /dev/mem ,   ModuleNotFoundError , or worse—running silently without actually toggling any pins. The industry-standard library  RPi.GPIO  is dead on the Raspberry Pi 5. Here is the architectural reason why, and the code-complete paths to get you back up and running. The Root Cause: The RP1 Southbridge To understand why your code broke, you have to look at the silicon. On Raspberry Pi models 1 through 4, the GPIO pins were controlled directly by the main Broadcom System-on-Chip (SoC). Libraries like  RPi.GPIO  worked by memory-mapping ( mmap ) specific physical addresses on the SoC to toggle bits directly. This was fast, but it was a "dirty" hack that bypassed the Linux kernel's subsystems. The Ras...