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

Crashes if mix dependencies dont have .formatter.exs file #401

Closed
1 of 2 tasks
LukasKnuth opened this issue Nov 13, 2020 · 0 comments
Closed
1 of 2 tasks

Crashes if mix dependencies dont have .formatter.exs file #401

LukasKnuth opened this issue Nov 13, 2020 · 0 comments

Comments

@LukasKnuth
Copy link

Environment

  • Elixir & Erlang versions (elixir --version): Erlang/OTP 22 / Elixir 1.11.1
  • Operating system: Mac OS X 10.15.7
  • Editor or IDE name (e.g. Emacs/VSCode): VSCode
  • Editor Plugin/LSP Client name: jakebecker.elixir-ls

Troubleshooting

  • Restart your editor (which will restart ElixirLS) sometimes fixes issues
  • Stop your editor, remove the entire .elixir_ls directory, then restart your editor
    • NOTE: This will cause you to have to re-run the dialyzer build for your project

If you're experiencing high CPU usage, it is most likely Dialyzer building the PLTs; after it's done the CPU usage should go back to normal. You could also disable Dialyzer in the settings.

Logs

  1. If using a client other than VS Code, please try VSCode's "ElixirLS: Elixir support and debugger" extension. Does it reproduce your failure?

Yes

  1. Create a new Mix project with mix new empty, then open that project with VS Code and open an Elixir file. Is your issue reproducible on the empty project? If not, please publish a repo on Github that does reproduce it.

As far as I can tell, this happens at seemingly random intervals when dependencies dont have a .formatter.exs file present. It works for a good while, then randomly crashes.

  1. Check the output log by opening View > Output and selecting "ElixirLS" in the dropdown. Please include any output that looks relevant. (If ElixirLS isn't in the dropdown, the server failed to launch.)
11:49:41.568 [error] GenServer ElixirLS.LanguageServer.Server terminating
** (Code.LoadError) could not load /project/deps/hackney/.formatter.exs
    (elixir 1.11.1) lib/code.ex:1452: Code.find_file/2
    (elixir 1.11.1) lib/code.ex:876: Code.eval_file/2
    (mix 1.11.1) lib/mix/tasks/format.ex:310: Mix.Tasks.Format.eval_file_with_keyword_list/1
    (mix 1.11.1) lib/mix/tasks/format.ex:172: Mix.Tasks.Format.eval_dot_formatter/1
    (mix 1.11.1) lib/mix/tasks/format.ex:157: Mix.Tasks.Format.formatter_opts_for_file/2
    (language_server 0.6.0) lib/language_server/source_file.ex:221: ElixirLS.LanguageServer.SourceFile.formatter_opts/1
    (language_server 0.6.0) lib/language_server/server.ex:486: ElixirLS.LanguageServer.Server.handle_request/2
    (language_server 0.6.0) lib/language_server/server.ex:332: ElixirLS.LanguageServer.Server.handle_request_packet/3
Last message: {:"$gen_cast", {:receive_packet, %{"id" => 893, "jsonrpc" => "2.0", "method" => "textDocument/completion", "params" => %{"context" => %{"triggerKind" => 1}, "position" => %{"character" => 27, "line" => 4}, "textDocument" => %{"uri" => "file:///project/test/authorizer_web/api/controllers/access_controller_test.exs"}}}}}
State: %ElixirLS.LanguageServer.Server{analysis_ready?: false, awaiting_contracts: [{{#PID<0.14222.0>, #Reference<0.4077192245.1193017350.20603>}, "file:///project/test/authorizer_web/api/controllers/access_controller_test.exs"}, {{#PID<0.13906.0>, #Reference<0.4077192245.1193017351.5286>}, "file:///project/test/authorizer_web/api/controllers/access_controller_test.exs"}, {{#PID<0.13867.0>, #Reference<0.4077192245.1192755212.212411>}, "file:///project/test/authorizer_web/api/controllers/access_controller_test.exs"}, {{#PID<0.13498.0>, #Reference<0.4077192245.1192755207.259261>}, "file:///project/test/authorizer_web/api/controllers/groups_controller_test.exs"}, {{#PID<0.13455.0>, #Reference<0.4077192245.1193017350.16505>}, "file:///project/test/authorizer_web/api/controllers/access_controller_test.exs"}, {{#PID<0.13153.0>, #Reference<0.4077192245.1193017350.16412>}, "file:///project/test/authorizer_web/api/controllers/access_controller_test.exs"}, {{#PID<0.13140.0>, #Reference<0.4077192245.1192755209.250326>}, "file:///project/test/authorizer_web/api/controllers/groups_controller_test.exs"}, {{#PID<0.12796.0>, #Reference<0.4077192245.1193017346.172273>}, "file:///project/config/dev.exs"}, {{#PID<0.12407.0>, #Reference<0.4077192245.1193279489.89083>}, "file:///project/config/dev.exs"}, {{#PID<0.12405.0>, #Reference<0.4077192245.1193279489.89049>}, "file:///project/config/dev.exs"}, {{#PID<0.12403.0>, #Reference<0.4077192245.1193279489.89013>}, "file:///project/config/dev.exs"}, {{#PID<0.12400.0>, #Reference<0.4077192245.1193279489.88967>}, "file:///project/config/dev.exs"}, {{#PID<0.12398.0>, #Reference<0.4077192245.1193279489.88931>}, "file:///project/config/dev.exs"}, {{#PID<0.12396.0>, #Reference<0.4077192245.1193279489.88885>}, "file:///project/config/dev.exs"}, {{#PID<0.12393.0>, #Reference<0.4077192245.1193279489.88833>}, "file:///project/config/dev.exs"}, {{#PID<0.12388.0>, #Reference<0.4077192245.1193279489.88593>}, "file:///project/config/dev.exs"}, {{#PID<0.12383.0>, #Reference<0.4077192245.1193279489.87975>}, "file:///project/lib/authorizer_web/router.ex"}, {{#PID<0.12377.0>, #Reference<0.4077192245.1193279489.80517>}, "file:///project/deps/betterdoc_containerservice/lib/betterdoc/container_service/plugs/auth.ex"}, {{#PID<0.12375.0>, #Reference<0.4077192245.1193279489.80483>}, "file:///project/deps/betterdoc_containerservice/lib/betterdoc/container_service/plugs/auth.ex"}, {{#PID<0.12356.0>, #Reference<0.4077192245.1193017347.116473>}, "file:///project/deps/betterdoc_containerservice/lib/betterdoc/container_service/plugs/auth.ex"}, {{#PID<0.12354.0>, #Reference<0.4077192245.1193017347.116445>}, "file:///project/lib/authorizer_web/router.ex"}, {{#PID<0.12349.0>, #Reference<0.4077192245.1193017347.116390>}, "file:///project/lib/authorizer_web/api/controllers/groups_controller.ex"}, {{#PID<0.12347.0>, #Reference<0.4077192245.1193017347.116362>}, "file:///project/lib/authorizer_web/router.ex"}, {{#PID<0.12344.0>, #Reference<0.4077192245.1193017347.113859>}, "file:///project/deps/betterdoc_containerservice/lib/betterdoc/container_service/plugs/auth.ex"}, {{#PID<0.12337.0>, #Reference<0.4077192245.1193017347.107762>}, "file:///project/lib/authorizer_web/router.ex"}, {{#PID<0.12334.0>, #Reference<0.4077192245.1193017347.107734>}, "file:///project/lib/authorizer_web/api/controllers/groups_controller.ex"}, {{#PID<0.12331.0>, #Reference<0.4077192245.1193017347.107698>}, "file:///project/lib/authorizer_web/api/controllers/groups_controller.ex"}, {{#PID<0.12327.0>, #Reference<0.4077192245.1193017347.104432>}, "file:///project/lib/authorizer_web/api/controllers/access_controller.ex"}, {{#PID<0.12322.0>, #Reference<0.4077192245.1193017347.103579>}, "file:///project/lib/authorizer/rules/yaml_parser.ex"}, {{#PID<0.12282.0>, #Reference<0.4077192245.1193279489.64770>}, "file:///project/lib/authorizer_web/router.ex"}, {{#PID<0.11948.0>, #Reference<0.4077192245.1192755207.257744>}, "file:///project/lib/authorizer_web/api/controllers/access_controller.ex"}, {{#PID<0.11946.0>, #Reference<0.4077192245.1192755207.257739>}, "file:///project/lib/authorizer_web/router.ex"}, {{#PID<0.11944.0>, #Reference<0.4077192245.1192755207.257734>}, "file:///project/lib/authorizer_web/api/controllers/access_controller.ex"}, {{#PID<0.11942.0>, #Reference<0.4077192245.1192755207.257729>}, "file:///project/lib/authorizer_web/router.ex"}, {{#PID<0.11940.0>, #Reference<0.4077192245.1192755207.257724>}, "file:///project/lib/authorizer_web/api/controllers/access_controller.ex"}, {{#PID<0.11924.0>, #Reference<0.4077192245.1192755207.255886>}, "file:///project/lib/authorizer_web/router.ex"}, {{#PID<0.11576.0>, #Reference<0.4077192245.1193017347.90483>}, "file:///project/test/authorizer_web/api/controllers/access_controller_test.exs"}, {{#PID<0.11552.0>, #Reference<0.4077192245.1192755207.254569>}, "file:///project/test/authorizer_web/api/controllers/access_controller_test.exs"}, {{#PID<0.10911.0>, #Reference<0.4077192245.1192755210.218849>}, "file:///project/test/authorizer_web/api/controllers/access_controller_test.exs"}, {{#PID<0.10892.0>, #Reference<0.4077192245.1193279489.46640>}, "file:///projec (truncated)
[Warn  - 11:49:41 AM] ** (exit) exited in: GenServer.call(ElixirLS.LanguageServer.JsonRpc, {:packet, %{"jsonrpc" => "2.0", "method" => "textDocument/didChange", "params" => %{"contentChanges" => [%{"range" => %{"end" => %{"character" => 27, "line" => 4}, "start" => %{"character" => 27, "line" => 4}}, "rangeLength" => 0, "text" => "r"}], "textDocument" => %{"uri" => "file:///project/test/authorizer_web/api/controllers/access_controller_test.exs", "version" => 41}}}}, 5000)
    ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
    (elixir 1.11.1) lib/gen_server.ex:1017: GenServer.call/3
    (elixir 1.11.1) lib/stream.ex:441: anonymous fn/4 in Stream.each/2
    (elixir 1.11.1) lib/stream.ex:1449: Stream.do_element_resource/6
    (elixir 1.11.1) lib/stream.ex:1609: Enumerable.Stream.do_each/4
    (elixir 1.11.1) lib/stream.ex:649: Stream.run/1
    (stdlib 3.12.1) erl_eval.erl:680: :erl_eval.do_apply/6
[Info  - 11:49:41 AM] Connection to server got closed. Server will restart.
  1. Check the developer console by opening Help > Toggle Developer Tools and include any errors that look relevant.
notificationsAlerts.ts:40 ElixirLS has crashed. See Output panel.
onDidChangeNotification @ breadcrumbsModel.ts:39
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

1 participant