fahani

fahani

Hello!

I am a PHP and Go developer. This weekend I wanted to give it a try to Elixir & Phoenix but I run into some debugging issues that I am not able to resolve.

These are the versions of my current OS and tools:

  • Ubuntu 24.04.1 LTS
  • asdf v0.14.1-f00f759
  • Erlang 27.1
  • Elixir 1.17.3
  • Mix 1.17.3
  • IntelliJ IDEA 2024.2.2 (Ultimate Edition) Build #IU-242.22855.74, built on September 18, 2024
  • KronicDeth/intellij-elixir v19.0.1

I created a hello_elixir Phoenix project mix phx.new hello_elixir, I configured the db mix ecto.create and I started the app mix phx.server. I went to http://localhost:4000 and the app loaded correctly, here is the terminal output :

[info] Running HelloElixirWeb.Endpoint with Bandit 1.5.7 at 127.0.0.1:4000 (http)
[info] Access HelloElixirWeb.Endpoint at http://localhost:4000
[watch] build finished, watching for changes...

Rebuilding...

Done in 451ms.
[info] GET /
[debug] Processing with HelloElixirWeb.PageController.home/2
  Parameters: %{}
  Pipelines: [:browser]
[info] Sent 200 in 120ms

I made sure the app could run using Interactive Elixir iex -S mix phx.server, it ran correctly.

I went ahead and opened the project in the IDE and configure the Project Structure, here some screenshots (as a new user in the forum it won’t let me paste image directly):

Here is the debug configuration I tried:

Result of running the configuration:

/home/nico/.asdf/installs/erlang/27.1/bin/erl -pa /home/nico/.asdf/installs/erlang/27.1/lib/observer-2.16/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/tftp-1.2.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/kernel-10.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/megaco-4.6/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/wx-2.4.3/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/parsetools-2.6/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/os_mon-2.10/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/ssh-5.2.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/mnesia-4.23.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/tools-4.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/stdlib-6.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/inets-9.3/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/snmp-5.17/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/diameter-2.4.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/edoc-1.3.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/asn1-5.3.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/odbc-2.15/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/syntax_tools-3.2.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/crypto-5.5.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/public_key-1.16.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/eldap-1.2.13/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/runtime_tools-2.1.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/eunit-2.9.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/debugger-5.4/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/erts-15.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/xmerl-2.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/et-1.7.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/sasl-4.2.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/ssl-11.2.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/common_test-1.27.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/compiler-8.5.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/erl_interface-5.5.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/jinterface-1.14.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/ftp-1.2.3/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/dialyzer-5.2.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/reltool-1.0.1/ebin iex -S mix -name debuggeda68c5c05-5494-44b7-9ad8-8364f3aeb56a@127.0.0.1 -setcookie a68c5c05-5494-44b7-9ad8-8364f3aeb56a -eval application:ensure_all_started(elixir) -eval 'Elixir.Code':require_file(<<\"/tmp/intellij_elixir10/debugger/lib/intellij_elixir/debugger/server.ex\">>) -eval 'Elixir.Code':require_file(<<\"/tmp/intellij_elixir10/debugger/lib/intellij_elixir/debugged.ex\">>) -eval 'Elixir.Code':require_file(<<\"/tmp/intellij_elixir10/debugger/lib/mix/tasks/intellij_elixir/debug.ex\">>) -pa /home/nico/.asdf/installs/elixir/1.17.3/lib/elixir/ebin -pa /home/nico/.asdf/installs/elixir/1.17.3/lib/ex_unit/ebin -pa /home/nico/.asdf/installs/elixir/1.17.3/lib/iex/ebin -pa /home/nico/.asdf/installs/elixir/1.17.3/lib/mix/ebin -pa /home/nico/.asdf/installs/elixir/1.17.3/lib/logger/ebin -pa /home/nico/.asdf/installs/elixir/1.17.3/lib/eex/ebin -noshell -s elixir start_cli -elixir ansi_enabled true -extra /home/nico/.asdf/installs/elixir/1.17.3/bin/mix do intellij_elixir.debug, phx.server
Error! Failed to load module 'mix' because it cannot be found.
Make sure that the module name is correct and that its .beam file
is in the code path.

Runtime terminating during boot ({undef,[{init,start_it,1,[]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

Crash dump is being written to: erl_crash.dump...done
  • Unable to connect when going to http://localhost:4000/

Followed this Medium article or this post to create the debug configuration

If I run the configuration without erl arguments iex -S mix, this is the result:

/home/nico/.asdf/installs/erlang/27.1/bin/erl -pa /home/nico/.asdf/installs/erlang/27.1/lib/observer-2.16/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/tftp-1.2.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/kernel-10.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/megaco-4.6/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/wx-2.4.3/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/parsetools-2.6/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/os_mon-2.10/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/ssh-5.2.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/mnesia-4.23.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/tools-4.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/stdlib-6.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/inets-9.3/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/snmp-5.17/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/diameter-2.4.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/edoc-1.3.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/asn1-5.3.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/odbc-2.15/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/syntax_tools-3.2.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/crypto-5.5.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/public_key-1.16.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/eldap-1.2.13/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/runtime_tools-2.1.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/eunit-2.9.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/debugger-5.4/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/erts-15.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/xmerl-2.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/et-1.7.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/sasl-4.2.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/ssl-11.2.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/common_test-1.27.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/compiler-8.5.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/erl_interface-5.5.2/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/jinterface-1.14.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/ftp-1.2.3/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/dialyzer-5.2.1/ebin -pa /home/nico/.asdf/installs/erlang/27.1/lib/reltool-1.0.1/ebin -name debuggede1784c9d-1d27-42b1-b06d-dbbdabade8eb@127.0.0.1 -setcookie e1784c9d-1d27-42b1-b06d-dbbdabade8eb -eval application:ensure_all_started(elixir) -eval 'Elixir.Code':require_file(<<\"/tmp/intellij_elixir3/debugger/lib/intellij_elixir/debugger/server.ex\">>) -eval 'Elixir.Code':require_file(<<\"/tmp/intellij_elixir3/debugger/lib/intellij_elixir/debugged.ex\">>) -eval 'Elixir.Code':require_file(<<\"/tmp/intellij_elixir3/debugger/lib/mix/tasks/intellij_elixir/debug.ex\">>) -pa /home/nico/.asdf/installs/elixir/1.17.3/lib/elixir/ebin -pa /home/nico/.asdf/installs/elixir/1.17.3/lib/ex_unit/ebin -pa /home/nico/.asdf/installs/elixir/1.17.3/lib/iex/ebin -pa /home/nico/.asdf/installs/elixir/1.17.3/lib/mix/ebin -pa /home/nico/.asdf/installs/elixir/1.17.3/lib/logger/ebin -pa /home/nico/.asdf/installs/elixir/1.17.3/lib/eex/ebin -noshell -s elixir start_cli -elixir ansi_enabled true -extra /home/nico/.asdf/installs/elixir/1.17.3/bin/mix do intellij_elixir.debug, phx.server
     warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead
     │
 111 │       |> Stream.reject(&(&1 == '.'))
     │                                ~
     │
     └─ /tmp/intellij_elixir3/debugger/lib/intellij_elixir/debugger/server.ex:111:32

Waiting for debugger to attach...

11:57:02.776 [error] GenServer IntelliJElixir.Debugger.Server terminating
** (UndefinedFunctionError) function :int.interpreted/0 is undefined (module :int is not available)
    :int.interpreted()
    /tmp/intellij_elixir3/debugger/lib/intellij_elixir/debugger/server.ex:166: IntelliJElixir.Debugger.Server.handle_call/3
    (stdlib 6.1) gen_server.erl:2381: :gen_server.try_handle_call/4
    (stdlib 6.1) gen_server.erl:2410: :gen_server.handle_msg/6
    (stdlib 6.1) proc_lib.erl:329: :proc_lib.init_p_do_apply/3
Last message (from #PID<9302.4.0>): {:set_breakpoint, HelloElixirWeb.PageController, 7}
State: %IntelliJElixir.Debugger.Server{attached: nil, evaluate_meta_pid_to_froms: %{}}
Client #PID<9302.4.0> is remote on node :"debuggere1784c9d-1d27-42b1-b06d-dbbdabade8eb@127.0.0.1"

The break point is placed under the render in this module:

defmodule HelloElixirWeb.PageController do
  use HelloElixirWeb, :controller

  def home(conn, _params) do
    # The home page is often custom made,
    # so skip the default app layout.
    render(conn, :home, layout: false)
  end
end

Any guidance will be much appreciated.

Thank you!

Showing Posts 1 to 1

fahani

fahani OP

Tagging you @KronicDeth, in case you faced this before :pray:

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
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
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
ryanwinchester
apply_graft/2 doesn’t rewrite an add_many sub-workflow’s deps on an add step. Grafted jobs cancel with “upstream job was deleted” Version...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
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

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews