s-stepien

s-stepien

Application module `start` function not called?

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 :slight_smile:

Most Liked

jswanner

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.server from the terminal, or some other way? Is it possible something is swallowing that IO you are using to debug? Instead of IO.inspect("here") you can try raise "here"

s-stepien

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 using iex -S mix phx.server with some env variables.

Note that with MIX_ENV=prod it works, every time. With MIX_ENV=dev it does not. Only this MIX_ENV is different in invocation.

jswanner

jswanner

diff _build/{dev,prod}/lib/<app_name>/ebin/<app_name>.app

Where Next?

Popular in Questions Top

sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New

Other popular topics Top

Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43591 214
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
hariharasudhan94
Lets say i have map like this fetching from my database %{"_id" =&gt; #BSON.ObjectId&lt;58eb1a7a9ad169198c3dXXXX&gt;, "email" =&gt; "XX...
New

We're in Beta

About us Mission Statement