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

Strange error message in nixos #335

Closed
turion opened this issue Jun 4, 2019 · 3 comments
Closed

Strange error message in nixos #335

turion opened this issue Jun 4, 2019 · 3 comments

Comments

@turion
Copy link

turion commented Jun 4, 2019

Since some time, I was getting this strange error message:

Removing apps from runtime: [:sim, :battery_gateway, :battery_gateway_perf, :cpe_gateway, :cpe_gateway_perf, :serial_bridge]
Finding suitable PLTs
Checking PLT...
[:amqp, :api_tennet, :argon2_elixir, :asn1, :battery_gateway, :baud, :certifi, :combine, :comeonin, :compiler, :connection, :controller, :controller_api, :cowboy, :cowlib, :cpe_gateway, :crc, :crypto, :csv, :db_connection, :decimal, :distillery, :ecto, :eex, :elixir, :ex_unit, :exprotobuf, :file_system, :fsm, :gettext, :glue, :goldrush, :gpb, :hackney, :helenus, :httpoison, :hulaaki, :idna, :iec104, :kernel, :lager, :logger, :logger_file_backend, :mariaex, :metrics, :mime, :mimerl, :mix, :nerves_uart, :parallel_stream, ...]
Looking up modules in dialyxir_erlang-21.2.3_elixir-1.8.2_deps-dev.plt
Looking up modules in dialyxir_erlang-21.2.3_elixir-1.8.2.plt
Looking up modules in dialyxir_erlang-21.2.3.plt
Finding applications for dialyxir_erlang-21.2.3.plt
Finding modules for dialyxir_erlang-21.2.3.plt
Removing 187 modules from dialyxir_erlang-21.2.3.plt
** (CaseClauseError) no case clause matching: {{:nocatch, {:dialyzer_error, [78, 111, 116, 32, 97, 32, 114, 101, 103, 117, 108, 97, 114, 32, 102, 105, 108, 101, 58, 32, '/nix/store/12871pfs4dib6bvwmjx6phxmbymwd2r7-erlang-21.2.3/lib/erlang/lib/hipe-3.18.2/ebin/erl_bif_types.beam', 10]}}, [{:dialyzer_plt, :compute_md5_from_file, 1, [file: 'dialyzer_plt.erl', line: 543]}, {:dialyzer_plt, :compute_new_md5_1, 3, [file: 'dialyzer_plt.erl', line: 509]}, {:dialyzer_plt, :check_version, 1, [file: 'dialyzer_plt.erl', line: 328]}, {:dialyzer_plt, :check_plt1, 3, [file: 'dialyzer_plt.erl', line: 477]}, {:dialyzer_plt, :"-subproc/1-fun-0-", 1, [file: 'dialyzer_plt.erl', line: 603]}]}
    dialyzer_cl.erl:249: :dialyzer_cl.check_plt/3
    dialyzer_cl.erl:182: :dialyzer_cl.plt_common/3
    dialyzer.erl:160: :dialyzer.run/1
    lib/dialyxir/plt.ex:209: Dialyxir.Plt.plt_run/1
    lib/dialyxir/plt.ex:189: Dialyxir.Plt.plt_remove/2
    lib/dialyxir/plt.ex:144: Dialyxir.Plt.check_beams/3
    lib/dialyxir/plt.ex:43: Dialyxir.Plt.check_plt/4
    (elixir) lib/enum.ex:1940: Enum."-reduce/3-lists^foldl/2-0-"/3
    lib/mix/tasks/dialyzer.ex:246: Mix.Tasks.Dialyzer.check_plt/1
    lib/mix/tasks/dialyzer.ex:167: Mix.Tasks.Dialyzer.run/1
    (mix) lib/mix/task.ex:331: Mix.Task.run_task/3
    (mix) lib/mix/cli.ex:79: Mix.CLI.run_task/2
    (elixir) lib/code.ex:767: Code.require_file/2

12:39:40.649 [error] Process #PID<0.829.0> raised an exception
** (ErlangError) Erlang error: {:nocatch, {:dialyzer_error, [78, 111, 116, 32, 97, 32, 114, 101, 103, 117, 108, 97, 114, 32, 102, 105, 108, 101, 58, 32, '/nix/store/12871pfs4dib6bvwmjx6phxmbymwd2r7-erlang-21.2.3/lib/erlang/lib/hipe-3.18.2/ebin/erl_bif_types.beam', 10]}}
    dialyzer_plt.erl:543: :dialyzer_plt.compute_md5_from_file/1
    dialyzer_plt.erl:509: :dialyzer_plt.compute_new_md5_1/3
    dialyzer_plt.erl:328: :dialyzer_plt.check_version/1
    dialyzer_plt.erl:477: :dialyzer_plt.check_plt1/3
    dialyzer_plt.erl:603: anonymous fn/1 in :dialyzer_plt.subproc/1

I'm using NixOS unstable. It used to work, and other developer of the same project can run dialyzer without problems.

Environment

  • Elixir & Erlang/OTP versions (elixir --version):
Erlang/OTP 21 [erts-10.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]
Elixir 1.8.2 (compiled with Erlang/OTP 21)
  • Which version of Dialyxir are you using? (cat mix.lock | grep dialyxir):
    "dialyxir": {:hex, :dialyxir, "1.0.0-rc.6", "78e97d9c0ff1b5521dd68041193891aebebce52fc3b93463c0a6806874557d7d", [:mix], [{:erlex, "~> 0.2.1", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm"}

Fix

I opened this issue to document the error, since it was not obvious to me how to fix it. The issue seemed to be that there were old .plt files that referenced outdated files from the nix store that were garbage collected at some point. The solution was:

$ rm ~/.mix/*.plt

Depending on your MIX_HOME, you might have to adjust the path.

@turion turion closed this as completed Jun 4, 2019
@evnu
Copy link
Contributor

evnu commented Jun 4, 2019

Duplicate of #301?

@turion
Copy link
Author

turion commented Jun 4, 2019

That would certainly have made the error message more readable. It was still unclear to me why the error would occur then. I knew that the file mentioned there didn't exist, but not why it kept looking for it, and how to stop it from looking for it.

@jtrees
Copy link

jtrees commented Sep 2, 2021

Thanks! I was unable to use dialyzer for a while due to an old, incompatible plt. Didn't think to check my home folder for it.

In my case ($MIX_HOME was undefined), the workaround looked like this:

rm ~/.local/share/mix/*.plt

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

3 participants