s-stepien

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

First Post!

garrison

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?

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 OP

@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

Last Post!

s-stepien

s-stepien OP

Hmmm

In fail case:

iex(2)> Application.started_applications()
[
{:myapp, [], []},
{:hex, ~c"hex", ~c"2.2.2"},
{:inets, ~c"INETS  CXC 138 49", ~c"9.4.2"},
{:ssl, ~c"Erlang/OTP SSL application", ~c"11.4"},
{:public_key, ~c"Public key infrastructure", ~c"1.18.3"},
{:asn1, ~c"The Erlang ASN1 compiler version 5.4.2", ~c"5.4.2"},
{:crypto, ~c"CRYPTO", ~c"5.7"},
{:mix, ~c"mix", ~c"1.18.4"},
{:iex, ~c"iex", ~c"1.18.4"},
{:elixir, ~c"elixir", ~c"1.18.4"},
{:compiler, ~c"ERTS  CXC 138 10", ~c"9.0.2"},
{:stdlib, ~c"ERTS  CXC 138 10", ~c"7.1"},
{:kernel, ~c"ERTS  CXC 138 10", ~c"10.4"}
]

iex(4)> Application.ensure_started(:phoenix_live_reload)
{:error, {:not_started, :logger}}
iex(5)> Application.ensure_started(:logger)
:ok
iex(6)> Application.ensure_started(:phoenix_live_reload)
{:error, {:not_started, :phoenix}}
iex(7)> Application.ensure_started(:phoenix)
{:error, {:not_started, :eex}}
iex(8)> Application.ensure_started(:eex)
:ok
iex(9)> Application.ensure_started(:phoenix)
{:error, {:not_started, :plug}}
iex(10)> Application.ensure_started(:plug)
{:error, {:not_started, :mime}}
iex(11)> Application.ensure_started(:mime)
:ok
iex(12)> Application.ensure_started(:plug)
{:error, {:not_started, :plug_crypto}}
iex(13)> Application.ensure_started(:plug_crypto)
:ok
iex(14)> Application.ensure_started(:plug)
{:error, {:not_started, :telemetry}}
iex(15)> Application.ensure_started(:telemetry)
:ok
iex(16)> Application.ensure_started(:plug)
:ok
iex(17)> Application.ensure_started(:phoenix)
{:error, {:not_started, :phoenix_pubsub}}
iex(18)> Application.ensure_started(:phoenix_pubsub)
:ok
iex(19)> Application.ensure_started(:phoenix)
{:error, {:not_started, :phoenix_template}}
iex(20)> Application.ensure_started(:phoenix_templete)
{:error, {~c"no such file or directory", ~c"phoenix_templete.app"}}

Update: in the end I was able to start them all and made sure that the file is there. So I do not know if this is related (or if I’m doing it correctly anyway).

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
jaybe78
Hello, I’m developing a online persistent chat system (what’s app) like using elixir/dynamodb/aws for a mobile app(flutter). The diffic...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New

Other Trending Topics Top

garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New
aseigo
ICal is a library for interacting with iCalendar data. It parses iCalendars into typed Elixir structs via ICal.from_ics, and can prepare ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews