s-stepien
Hi
I have fairly complicated Phoenix app (but it doubt that this is Phoenix related issue?). In it I have the MyApp.Application module with start(_type, _args) function. I noticed today (after long time without working on it), that the start() function isn’t called at all. In the mix.exs file, the mod: is set correctly to that module - I haven’t changed anything there.
How one can try to debug this? What is happening before call to start() - maybe something there hangs?
I’ve tried rebuild from scratch, re-get deps, etc. And nothing, the function will not be called.
When I created new project, all seems OK in it.
I’m using Erlang/OTP 28.1 and Elixir 1.18.4
Update:
If I use MIX_ENV=prod, then I can see print at the beginning of the start() function. But I want to use the dev env ![]()
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #phoenix_html
- #iex
- #ai
- #graphql
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
garrison
That start callback is what starts the Endpoint, so if it isn’t being called you have no server/app at all. Is that what you’re experiencing?
s-stepien
Well I think it is not about Endpoint (I have more children, not just the Phoenix ones). I have
IO.inspect(“here”)as 1st instruction instart()function (before the children definition). And it is not printed.And I have
mix.exswith application/server definitions that are OK (I haven’t changed them for like years now).garrison
I asked a specific question because I am trying to narrow down what is going on. If
start/2is not being called then your app must not be starting.Is your application starting? Is the web server running? Does it work?
jswanner
I believe @garrison is trying to get at is if any of the children in your application are running, if so then your application is running, and your endpoint is an easy one to test if it’s running.
How are you running your application?
mix phx.serverfrom the terminal, or some other way? Is it possible something is swallowing that IO you are using to debug? Instead ofIO.inspect("here")you can tryraise "here"s-stepien
@garrison none of the children are started. The function is not called/entered.
@jswanner even with
raise “here”it will not stop it. I’m usingiex -S mix phx.serverwith some env variables.Note that with
MIX_ENV=prodit works, every time. WithMIX_ENV=devit does not. Only thisMIX_ENVis different in invocation.garrison
That is odd. I don’t know off the top of my head anything that would cause that behavior, though perhaps someone else will think of something.
Given that the behavior is different between environments you may want to comb through the configs for anything that could be different, though again I’m not sure what that might be.
As for your question about what happens when the application starts, it’s described quite thoroughly in the Application docs.
dimitarvp
Then the culprit should be
config/prod.exsorconfig/runtime.exsor any code that branches on the environment variables.jswanner
s-stepien
It seems that the issue is with:
Without this feature configured, the dev comes up. I wonder what might be the issue here. I will double check my paths here.
dimitarvp
I take it that you redacted the app name and module namespace in the snippet above and they’re not the same in the real code? Just making sure.
Also does this code look the same in a freshly generated project?