Challenge 3: Diagnose a Connection Failure — Possible Solution ==================================================================== MOST LIKELY CAUSE: web and db are attached to DIFFERENT Docker networks (or one is on the default bridge and the other is on a custom network) — meaning there is genuinely no network path between them at all, regardless of whether both containers are individually "running" without any errors. This matches this chapter's own gotcha directly: "both running" only confirms each container's PROCESS started successfully — it says nothing about whether the two containers share a network that would let them reach each other. This isn't a firewall issue, a permissions issue, or an application-level bug; it's Docker's network isolation behaving exactly as designed, just not configured the way the developer assumed. HOW TO CONFIRM: run docker network inspect on the network(s) each container is attached to (or check docker network ls / the relevant Compose file's networks: configuration) and verify whether web and db actually share a common network. If they don't, the fix is either attaching both to the same network, or — if they were deliberately isolated on purpose — routing the connection through an intermediary service (like this chapter's api example) that IS attached to both.