Troubleshooting
Recover from preview failures faster
Most preview bootstrap issues trace back to mismatched ports, blocked networking inside the sandbox, Dockerfile errors, or repo configuration mistakes. Work through each cluster below systematically.
Port and bind problems
- Listening only on localhost stops Fly edge routing—bind to
0.0.0.0. internal_portmust match DockerfileEXPOSEand the workload's listeners.- Previewly forcibly merges
PORT—ignore stale hard-coded literals.
Configuration mistakes
- Malformed YAML/TOML produces parse errors surfaced in Deployment build logs.
- If automatic detection guesses the wrong ecosystem, declare
runtimeplusstartup_commandexplicitly—or switch entirely to authoring a Dockerfile reference. - Python services almost always need an explicit starter because requirements vary widely.
Timeouts and bulky contexts
- Large Git contexts slow remote Docker builds—add
.dockerignoreaggressively. - Consider breaking huge monorepos into slimmer layers or shipping prebuilt artifacts when permitted.
Verify locally
When debugging an authored Dockerfile, run docker build and docker run -p with the same environment variables you expect Fly to ship. For generated builds, capture Previewly's emitted Dockerfile from build logs and reproduce locally.