Phoenix app fails to start

I’m trying to deploy an Phoenix app, and I’m getting an error and erl_crash.dump that I’m having a difficult time parsing.

First there’s this error in the logs:

2025-03-08T04:49:25Z app[6830313c736598] sin [info]{exit,terminating,[{application_controller,call,2,[{file,"application_controller.erl"},{line,511}]},{application,enqueue_or_start,6,[{file,"application.erl"},{line,380}]},{application,ensure_all_started,3,[{file,"application.erl"},{line,359}]},{elixir,start_cli,0,[{file,"src/elixir.erl"},{line,195}]},{init,start_it,1,[]},{init,start_em,1,[]},{init,do_boot,3,[]}]}

And then the erl_crash.dump begins:

Runtime terminating during boot (terminating)
Crash dump is being written to: /dev/stderr...=erl_crash_dump:0.5
Sat Mar  8 04:49:25 2025
Slogan: Runtime terminating during boot (terminating)
System version: Erlang/OTP 27 [erts-15.2] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [jit:ns]
Taints: crypto,picosat_nif,asn1rt_nif,Elixir.Bcrypt.Base,dyntrace
Atoms: 69273
Calling Thread: scheduler:1

(mix.exs, mix.lock, Dockerfile, fly.toml, logs, & erl_crash.dump here.)

Any thoughts on what to do?

Does the app run in a local Docker container?

Per your recommendation, I tried running locally, and got the following additional detail:

=ERROR REPORT==== 9-Mar-2025::02:05:37.005711 ===
Invalid -name given to erl, 
=ERROR REPORT==== 9-Mar-2025::02:05:37.005711 ===

Searching for Invalid -name given to erl, yields more results than before, but all the posts are unresolved or different from my particular case.

It appears something is generating a "" name and passing it to erl somewhere?

The node name (-name) is derived from Fly.io-specific environment variables by default, so this might not be related to your previous glitch.

The discussion starting here is probably more relevant than it seemed at first glance, for example…

https://community.fly.io/t/deploy-error-protocol-is-not-included-in-the-list/2575/4

1 Like

Well, I’d certainly try getting it working locally, before pushing it to Fly. As far as I know it has to work in Docker before it has a chance of working in Fly.

If your local container is exiting immediately, a good trick is to do docker ps --all to find the name of it, and then you can do docker logs <deadcontainer> to see if there was any stdout/stderr at the point of failure.