Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugger fails to start (elixir 1.17.2/ OTP 27.0.1 #3629

Open
psteininger opened this issue Aug 14, 2024 · 6 comments
Open

Debugger fails to start (elixir 1.17.2/ OTP 27.0.1 #3629

psteininger opened this issue Aug 14, 2024 · 6 comments

Comments

@psteininger
Copy link

I tried running a mix phx.server configuration in debug mode . I have OTP 27.0.1 and elixir 1.17.2-otp-27 installed via mise/asdf.
The erlang and Elixir SDKs are the only ones in the list and the elixir 1.17.2-otp-27 is the selected SDK.

To Reproduce
Steps to reproduce the behavior:

  1. Setup a run configuration as a mix task with phx.server as mix arguments
  2. Run the configuration in debug
  3. Scroll down to '....'
  4. See error

Expected behavior
Debugger starts and attaches to the process

Screenshots
image

Logs

Waiting for debugger to attach...
Interpreting modules under /Users/piotr/.local/share/mise/installs/elixir/1.17.2-otp-27/lib/eex/ebin...  ...skipped
Interpreting modules under /Users/piotr/.local/share/mise/installs/elixir/1.17.2-otp-27/lib/elixir/ebin...  ...skipped
Interpreting modules under /Users/piotr/.local/share/mise/installs/elixir/1.17.2-otp-27/lib/ex_unit/ebin...  ...skipped
Interpreting modules under /Users/piotr/.local/share/mise/installs/elixir/1.17.2-otp-27/lib/iex/ebin...  ...skipped
Interpreting modules under /Users/piotr/.local/share/mise/installs/elixir/1.17.2-otp-27/lib/logger/ebin...  ...skipped
Interpreting modules under /Users/piotr/.local/share/mise/installs/elixir/1.17.2-otp-27/lib/mix/ebin...  ...skipped
Interpreting modules under /Users/piotr/.local/share/mise/installs/erlang/27.0.1/lib/asn1-5.3/ebin...

23:11:18.169 [error] GenServer IntelliJElixir.Debugger.Server terminating
** (UndefinedFunctionError) function :int.interpretable/1 is undefined (module :int is not available)
    :int.interpretable(:asn1_db)
    /private/var/folders/br/smkky7lx2zlf42fz6fh6yv280000gn/T/intellij_elixir11/debugger/lib/intellij_elixir/debugger/server.ex:400: anonymous fn/1 in IntelliJElixir.Debugger.Server.interpret_modules_in/2
    (elixir 1.17.2) lib/stream.ex:523: anonymous fn/4 in Stream.filter/2
    (elixir 1.17.2) lib/enum.ex:4858: Enumerable.List.reduce/3
    (elixir 1.17.2) lib/stream.ex:1891: Enumerable.Stream.do_each/4
    (elixir 1.17.2) lib/enum.ex:4423: Enum.each/2
    /private/var/folders/br/smkky7lx2zlf42fz6fh6yv280000gn/T/intellij_elixir11/debugger/lib/intellij_elixir/debugger/server.ex:401: IntelliJElixir.Debugger.Server.interpret_modules_in/2
    /private/var/folders/br/smkky7lx2zlf42fz6fh6yv280000gn/T/intellij_elixir11/debugger/lib/intellij_elixir/debugger/server.ex:133: anonymous fn/3 in IntelliJElixir.Debugger.Server.handle_call/3
Last message (from #PID<11621.4.0>): {:interpret, %{sdk_paths: ["/Users/piotr/.local/share/mise/installs/elixir/1.17.2-otp-27/lib/logger/ebin", "/Users/piotr/.local/share/mise/installs/elixir/1.17.2-otp-27/lib/elixir/ebin", "/Users/piotr/.local/share/mise/installs/elixir/1.17.2-otp-27/lib/ex_unit/ebin", "/Users/piotr/.local/share/mise/installs/elixir/1.17.2-otp-27/lib/mix/ebin", "/Users/piotr/.local/share/mise/installs/elixir/1.17.2-otp-27/lib/eex/ebin", "/Users/piotr/.local/share/mise/installs/elixir/1.17.2-otp-27/lib/iex/ebin"], reject_elixir_module_name_patterns: [":cow*", ":crypto", ":elixir_*", ":erocksdb", ":lz4", ":ranch*", ":re2", "Access", "Agent", "Agent.*", "Application", "Atom", "Base", "Bcrypt.Base", "Behaviour", "Benchee", "Benchee.*", "Bitwise", "Calendar", "Calendar.*", "Code", "Code.*", "Collectable", "Collectable.*", "Connection", "Credo", "Credo.*", "DBConnection", "DBConnection.*", "Date", "Date.*", "DateTime", "Decimal", "Dict", "DynamicSupervisor", "ESpec", "ESpec.*", "Earmark", "Earmark.*", "Ecto", "Ecto.*", "Enum", "Enumerable", "Enumerable.*", "ExCoveralls", "ExCoveralls.*", ...]}}
State: %IntelliJElixir.Debugger.Server{attached: nil, evaluate_meta_pid_to_froms: %{}}
Client #PID<11621.4.0> is remote on node :"debugger8b0874dd-fab3-4517-b03c-0378eff29bfc@127.0.0.1"

Desktop:

  • OS: macOS
  • Version 14.0

Erlang:

  • Installer mise/asdf
  • Version 27.0.1

Elixir:

  • Installer mise
  • Version 1.17.2-otp-27

Plugin:

  • Version 18.0.1 (installed from disk)
@psteininger
Copy link
Author

psteininger commented Aug 14, 2024

this is quite odd, because when I run iex, the module :int and all the functions are there. Also running the line below returns true

% iex   
Erlang/OTP 27 [erts-15.0.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]

Interactive Elixir (1.17.2) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)>  :int.interpretable(:asn1_db)
true
iex(2)> 

@psteininger
Copy link
Author

Small Update:
I managed to get further by adding :* to the list of interpreted modules:
image

However, I got a different error:

23:33:49.981 [error] GenServer IntelliJElixir.Debugger.Server terminating
** (UndefinedFunctionError) function :int.auto_attach/2 is undefined (module :int is not available)
    :int.auto_attach([:break], {IntelliJElixir.Debugger.Server, :breakpoint_reached, []})
    /private/var/folders/br/smkky7lx2zlf42fz6fh6yv280000gn/T/intellij_elixir9/debugger/lib/intellij_elixir/debugger/server.ex:94: IntelliJElixir.Debugger.Server.handle_call/3
    (stdlib 6.0.1) gen_server.erl:2209: :gen_server.try_handle_call/4
    (stdlib 6.0.1) gen_server.erl:2238: :gen_server.handle_msg/6
    (stdlib 6.0.1) proc_lib.erl:329: :proc_lib.init_p_do_apply/3
Last message (from #PID<12153.4.0>): :attach
State: %IntelliJElixir.Debugger.Server{attached: nil, evaluate_meta_pid_to_froms: %{}}
Client #PID<12153.4.0> is remote on node :"debuggerff782bc2-b96a-469a-80a5-c5f434e80272@127.0.0.1"

Would anyone suggest other things to try or a workaround?

@joshuataylor
Copy link
Collaborator

I'll write a guide about this, it is a pain to get to work as you need to juggle modules.

@amplexdenmark
Copy link

I am having the exact same issue. The setup guide would be much appreciated

@ativ97
Copy link

ativ97 commented Sep 14, 2024

Did anyone find a workaround yet? Been struggling with this issue for a few days. I'm also fairly new to elixir.

@Fahani
Copy link

Fahani commented Sep 23, 2024

Having the same issue, I posted it here https://elixirforum.com/t/error-while-debugging-phoenix-app-ubuntu-24-intellij-ultimate/66239

Were you able to work on that guide @joshuataylor ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants