Closed rickythefox closed 4 years ago
Experiencing exactly the same issues. Looks like it's not related to Phoenix, because I see the same behavior with just mix run
command.
I have a somewhat similar behavior, though the debugger dies with the following error message in my case:
Started ElixirLS debugger
Elixir version: "1.9.1 (compiled with Erlang/OTP 21)"
Erlang version: "22"
13:23:04.326 [info] Application debugger exited: ElixirLS.Debugger.start(:normal, []) returned an error: shutdown: failed to start child: ElixirLS.Debugger.Server
** (EXIT) an exception was raised:
** (UndefinedFunctionError) function :int.start/0 is undefined (module :int is not available)
:int.start()
(debugger) lib/debugger/server.ex:56: ElixirLS.Debugger.Server.init/1
(stdlib) gen_server.erl:374: :gen_server.init_it/2
(stdlib) gen_server.erl:342: :gen_server.init_it/6
(stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Have you tried disabling phoenix live reload? It's recompiling modules on the fly and my guess is it's interfering with the debugger.
Have you tried disabling phoenix live reload? It's recompiling modules on the fly and my guess is it's interfering with the debugger.
I'm not using Phoenix at all, and no live reload of any kind, and the issue is still present.
Have you tried disabling phoenix live reload? It's recompiling modules on the fly and my guess is it's interfering with the debugger.
I am using Phoenix in this project, but only as a pure JSON api.
Disabling the live reloading changed nothing - but thanks for the suggestion.
Environments:
Mac OSX 10.14.5
Elixir 1.9.0
Erlang/OTP 22
Windows 10 w/WSL (Ubuntu 18.04) (and Remote: WSL extension)
Elixir 1.8.2 and 1.9.1
Erlang/OTP 20 and 22
Steps to repeat:
mix phx.new vscode_test
cd vscode_test
mix deps.get
mix compile
mix test
- Just to verify the tests run normally.code .
{
"type": "mix_task",
"name": "mix phx.server",
"request": "launch",
"projectDir": "${workspaceRoot}",
"task": "phx.server"
},
mix phx.server
from dropdown and click the Debug/play icon.Well, well, well.
Turns out my variant of the issue was the Ubuntu packaging. The debugger had gone missing in an Erlang/OTP upgrade.
sudo apt install erlang-debugger
was my friend, at least. :+1:
Well, well, well.
Turns out my variant of the issue was the Ubuntu packaging. The debugger had gone missing in an Erlang/OTP upgrade.
sudo apt install erlang-debugger
was my friend, at least. 👍
For me erl -s debugger start
launches the debugger, so that's probably not the issue here.
I spoke too soon, it would seem. Got distracted and didn't get back to this debugging until now, and now I find my self with https://github.com/JakeBecker/vscode-elixir-ls/issues/120, then the debugger abruptly terminating.
Side note: this is an API Phoenix project, using the Commanded framework. Ubuntu 19.04 on a Thinkpad T470s, everything up to date.
Started ElixirLS debugger
Elixir version: "1.9.1 (compiled with Erlang/OTP 21)"
Erlang version: "22"
[debug] Attempting to start Postgrex
[debug] Successfully started Postgrex (#PID<0.325.0>)
[debug] Attempting to start Postgrex.Notifications
[debug] Successfully started Postgrex.Notifications (#PID<0.336.0>)
[debug] Attempting to start Postgrex
[debug] Successfully started Postgrex (#PID<0.338.0>)
[debug] Subscription "XXXX"@"$all" attempting to connect subscriber #PID<0.428.0>
[debug] Subscription "XXXX"@"$all" attempting to connect subscriber #PID<0.427.0>
[debug] Subscription "XXXX"@"$all" catching-up
[debug] XXXX has successfully subscribed to event store
[debug] Subscription "XXXX"@"$all" catching-up
[debug] XXXX has successfully subscribed to event store
(a bit of a pause, while the debugger is in starting up mode)
[error] 'File operation error: eacces. Target: /root/deb/elixir_1.9.1-1/lib/elixir/lib/collectable.ex. Function: read_file_info. '
[error] 'File operation error: eacces. Target: /root/deb/elixir_1.9.1-1/lib/elixir/lib/enum.ex. Function: read_file_info. '
[error] 'File operation error: eacces. Target: /root/deb/elixir_1.9.1-1/lib/iex/lib/iex/info.ex. Function: read_file_info. '
[error] 'File operation error: eacces. Target: /root/deb/elixir_1.9.1-1/lib/elixir/lib/inspect.ex. Function: read_file_info. '
[error] 'File operation error: eacces. Target: /root/deb/elixir_1.9.1-1/lib/elixir/lib/list/chars.ex. Function: read_file_info. '
[error] 'File operation error: eacces. Target: /root/deb/elixir_1.9.1-1/lib/elixir/lib/string/chars.ex. Function: read_file_info. '
same problem here... for the eacces error you can use asdf version of erlang/elixir...
but that does not help with the main problem of this thread.
@phpcitizen nope - just an observation in case it somehow was related. (though the env-var tricks do not seem to work for me)
Another observation is that Cowboy seems to never start.
Starting on the command line Cowboy logs info
messages just after Postgrex.
In the elixirls console in vscode, those log messages are never logged:
[info] Running xxx.Endpoint with cowboy 2.6.3 at 0.0.0.0:4000 (http)
[info] Access xxx.Endpoint at http://localhost:4000
I experience the same too! Hope this issue be resolved soon
I just published version 0.2.28 of the ElixirLS fork that solves this issue: https://github.com/elixir-lsp/elixir-ls
Well, well, well.
Turns out my variant of the issue was the Ubuntu packaging. The debugger had gone missing in an Erlang/OTP upgrade.
sudo apt install erlang-debugger
was my friend, at least. 👍
Thanks! This reminded me that I "upgraded" my macos to Catalina yesterday. I reinstall erlang and elixir and it's all working again and I can debug. :)
@axelson any chance you can PR against this plugin to get this one working again?
@dealloc A PR hasn't been merged in this repo since march of last year (not including the license PR) so I doubt a PR that I made would be merged.
@axelson Ah yes I see, that's rather unfortunate. I installed the fork for now :)
This project has moved!
It's now being maintained by proactive volunteers from the Elixir community over at elixir-lsp/elixir-ls. Updates will continue to be published from that repo to the original VS Code extension, so no need to switch plugins if you're using VS Code.
To avoid inundating the new maintainers with issues, please verify that your issue persists with the latest version of the extension (which is published from the new repo) before re-filing your issue there.
Thanks for using ElixirLS!
Trying to debug my Phoenix project in VSCode using ElixirLS. The launch config is defined as
The debugger starts and displays call stack for a fraction of a second but then immediately stops after "[info] Access TestAppWeb.Endpoint at http://localhost:4000". Has anyone gotten this to work?
Demo: https://i.stack.imgur.com/VMrkG.gif
Erlang/OTP 22 [erts-10.4.4] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] [dtrace] Elixir 1.9.1 (compiled with Erlang/OTP 22)