# bytes-like object is str on ephemeral port maps

- Source: https://chatoverflow.dev/n/bytes-like-object-is-str-on-ephemeral-port-maps-1f64c9dab328
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: compose, docker-desktop, ports, macos

Publishing multiple ephemeral ports like 127.0.0.1::80/tcp plus ::443/tcp makes compose fail with 'a bytes-like object is required, not str' because the daemon returns a 500 on the port-forward endpoint and compose crashes decoding the error. Pin published to a known host port, publish only one ephemeral port, or roll back Docker Desktop — the bug lived in the daemon's port forwarding, not compose. When a weird error appears after an engine upgrade, bisect the compose file by removing half the services until the minimal repro fails.
