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

ElixirLS keeps trying to build core Dialyzer Elixir PLT #530

Closed
2 tasks done
JakobHeubl opened this issue Apr 12, 2021 · 2 comments
Closed
2 tasks done

ElixirLS keeps trying to build core Dialyzer Elixir PLT #530

JakobHeubl opened this issue Apr 12, 2021 · 2 comments

Comments

@JakobHeubl
Copy link

JakobHeubl commented Apr 12, 2021

Environment

  • Elixir & Erlang versions (elixir --version):
    Erlang/OTP 23 [erts-11.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe]
    Elixir 1.11.4 (compiled with Erlang/OTP 23)
  • Operating system:
    n/a ManjaroLinux "Manjaro Linux" 21.0.1 Ornara
  • Editor or IDE name (e.g. Emacs/VSCode): VSCode
  • Editor Plugin/LSP Client name:
    CoenraadS.bracket-pair-colorizer
    dbaeumer.vscode-eslint
    eamodio.gitlens
    formulahendry.auto-rename-tag
    geeebe.duplicate
    GraphQL.vscode-graphql
    JakeBecker.elixir-ls
    lukas-tr.materialdesignicons-intellisense
    octref.vetur
    vincaslt.highlight-matching-tag
$ erl -version
Erlang (SMP,ASYNC_THREADS,HIPE) (BEAM) emulator version 11.2

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?
  2. 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.
  3. 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.)
  4. Check the developer console by opening Help > Toggle Developer Tools and include any errors that look relevant.

I have the Problem, that ElixirLS tries to build the core Dialyzer Elixir PLT but fails with following error in the output window:

Started ElixirLS v0.7.0
Elixir version: "1.11.4 (compiled with Erlang/OTP 23)"
Erlang version: "23"
ElixirLS compiled with Elixir 1.8.2 and erlang 21
MIX_ENV: test
MIX_TARGET: 
Compiling 1 file (.ex)
Generated empty app
[Info  - 10:14:13 PM] Compile took 290 milliseconds
[Info  - 10:14:13 PM] [ElixirLS WorkspaceSymbols] Indexing...
[Info  - 10:14:13 PM] [ElixirLS Dialyzer] Checking for stale beam files
[Info  - 10:14:13 PM] [ElixirLS Dialyzer] Found 7 changed files in 3 milliseconds
[Info  - 10:14:13 PM] [ElixirLS WorkspaceSymbols] Module discovery complete
[Info  - 10:14:13 PM] [ElixirLS WorkspaceSymbols] 54 callbacks added to index
[Info  - 10:14:14 PM] [ElixirLS WorkspaceSymbols] 377 modules added to index
[Info  - 10:14:14 PM] [ElixirLS WorkspaceSymbols] 414 types added to index
[Info  - 10:14:16 PM] [ElixirLS WorkspaceSymbols] 6743 functions added to index

22:14:30.961 [error] Task #PID<0.124.0> started from #PID<0.123.0> terminating
** (stop) {:nocatch, {:dialyzer_error, 'Analysis failed with error:\nCould not scan the following file(s):\n  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/unicode_util.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/win32reg.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/zip.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/sys.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/uri_string.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/sofs.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/unicode.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/timer.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/supervisor_bridge.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/supervisor.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/shell.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/string.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/sets.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/slave.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/re.beam\n  Recompile with +debug_info or an' ++ ...}}
    dialyzer_cl.erl:699: :dialyzer_cl.cl_error/2
    dialyzer_cl.erl:401: :dialyzer_cl.do_analysis/4
    dialyzer.erl:160: :dialyzer.run/1
    (language_server 0.7.0) lib/language_server/dialyzer/manifest.ex:146: ElixirLS.LanguageServer.Dialyzer.Manifest.build_elixir_plt/0
    (language_server 0.7.0) lib/language_server/dialyzer/manifest.ex:14: anonymous fn/1 in ElixirLS.LanguageServer.Dialyzer.Manifest.build_new_manifest/0
    (elixir 1.11.4) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2
    (stdlib 3.14.1) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Function: #Function<2.129723316/0 in ElixirLS.LanguageServer.Dialyzer.Manifest.build_new_manifest/0>
    Args: []

22:14:47.162 [error] Task #PID<0.1242.0> started from #PID<0.1241.0> terminating
** (stop) {:nocatch, {:dialyzer_error, 'Analysis failed with error:\nCould not scan the following file(s):\n  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/win32reg.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/sys.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/slave.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/uri_string.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/unicode_util.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/zip.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/unicode.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/supervisor.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/sets.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/supervisor_bridge.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/string.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/sofs.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/random.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/timer.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /home/jakob/.local/opt/elixir/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.14.1/ebin/shell_docs.beam\n  Recompile with +debug_i' ++ ...}}
    dialyzer_cl.erl:699: :dialyzer_cl.cl_error/2
    dialyzer_cl.erl:401: :dialyzer_cl.do_analysis/4
    dialyzer.erl:160: :dialyzer.run/1
    (language_server 0.7.0) lib/language_server/dialyzer/manifest.ex:146: ElixirLS.LanguageServer.Dialyzer.Manifest.build_elixir_plt/0
    (language_server 0.7.0) lib/language_server/dialyzer/manifest.ex:14: anonymous fn/1 in ElixirLS.LanguageServer.Dialyzer.Manifest.build_new_manifest/0
    (elixir 1.11.4) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2
    (stdlib 3.14.1) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Function: #Function<2.129723316/0 in ElixirLS.LanguageServer.Dialyzer.Manifest.build_new_manifest/0>
    Args: []

The error repeats every 15 Seconds. I can reproduce the issue with an new Mix project. I have checked the developer console, but did not found any relevant erros.

Thanks in advance for the help!

@lukaszsamson
Copy link
Collaborator

How did you install elixir? It looks like there are some leftover temp files that dialyzer is trying to analyse.

@JakobHeubl
Copy link
Author

Thanks for the quick response!
After looking into my Elixir installation directory i found out, that my Elixir and Erlang installation was broken and this resulted in the error I posted.
After removing both installations and reinstalling them, now the Dialyzer works like a charm!

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

2 participants