aus

aus

Cannot start observer: (UndefinedFunctionError) function :observer.start/0 is undefined

If I start the Elixir repl with iex, I can start the observer by :observer.start(). So far, so good.
If a create an app with mix new myapp and start it with iex -S mix, attempting to start the observer results in the following error:

** (UndefinedFunctionError) function :observer.start/0 is undefined (module :observer is not available)
    :observer.start()
    iex:2: (file)

I used to be able to start the observer within a running mix project using previous versions of Erlang and Elixir (I’m now using 25.3.2.2/1.15.0). What happened? Am I missing anything?

Thanks.

Most Liked

benstepp

benstepp

It looks like you need :observer, :wx, and :runtime_tools in your :extra_applications

24
Post #6
adamu

adamu

This looks like an issue caused by code path pruning introduced in Elixir 1.15.

if you have an application or dependency that does not specify its dependencies on Erlang and Elixir application, it may no longer compile successfully in Elixir v1.15

The fix is to add :observer and :wx to your list of :extra_applications in mix.exs.

It’s a bit strange that we need to opt-in to something in a mix project that’s already available by default in vanilla iex, though.

17
Post #2
josevalim

josevalim

Creator of Elixir

Correct. I also submitted a bug report upstream.

josevalim

josevalim

Creator of Elixir

That’s a Dialyxir issue and there are open PRs under consideration!

konstantinzolotarev

konstantinzolotarev

Seems that not only :observer is an issue.
After upgrading to elixir 1.15 and rebuilding project dialyzer stopped working as well.

mix dialyzer now gives this:

Error loading poison, dependency list may be incomplete.
 {~c"no such file or directory", ~c"poison.app"}
Error loading table, dependency list may be incomplete.
 {~c"no such file or directory", ~c"table.app"}
Error loading myxql, dependency list may be incomplete.
 {~c"no such file or directory", ~c"myxql.app"}
Error loading tds, dependency list may be incomplete.
 {~c"no such file or directory", ~c"tds.app"}
Error loading bandit, dependency list may be incomplete.
 {~c"no such file or directory", ~c"bandit.app"}
Error loading ecto_psql_extras, dependency list may be incomplete.
 {~c"no such file or directory", ~c"ecto_psql_extras.app"}
Error loading ecto_mysql_extras, dependency list may be incomplete.
 {~c"no such file or directory", ~c"ecto_mysql_extras.app"}
Error loading ecto_sqlite3_extras, dependency list may be incomplete.
 {~c"no such file or directory", ~c"ecto_sqlite3_extras.app"}
[:arangox, :asn1, :bandit, :benchee, :broadway, :broadway_kafka, :brod, :castore, :certifi, :compiler, :core, :cowboy, :cowboy_telemetry, :cowlib, :crc32cer, :crypto, :db_connection, :decimal, :deep_merge, :ecto, :ecto_mysql_extras, :ecto_psql_extras, :ecto_sql, :ecto_sqlite3, :ecto_sqlite3_extras, :eex, :elixir, :ex_json_schema, :ex_raconteur, :expo, :exqlite, :faker, :fastglobal, :gen_stage, :gettext, :gun, :hackney, :hammox, :hpax, :httpoison, :idna, :jason, :joken, :jose, :json_logic, :kafka_protocol, :kernel, :logger, :metrics, :mime, ...]
Looking up modules in dialyxir_erlang-26.0.2_elixir-1.15.2_deps-dev.plt
** (UndefinedFunctionError) function :dialyzer_plt.plt_kind/1 is undefined (module :dialyzer_plt is not available)
    (dialyzer 5.1) :dialyzer_plt.plt_kind(~c"/*******project_path/_build/dev/dialyxir_erlang-26.0.2_elixir-1.15.2_deps-dev.plt")
    (dialyzer 5.1) dialyzer.erl:294: :dialyzer.plt_info/1
    (dialyxir 1.3.0) lib/dialyxir/plt.ex:243: Dialyxir.Plt.plt_files/1
    (dialyxir 1.3.0) lib/dialyxir/plt.ex:16: Dialyxir.Plt.find_plts/3
    (dialyxir 1.3.0) lib/mix/tasks/dialyzer.ex:254: Mix.Tasks.Dialyzer.check_plt/1
    (dialyxir 1.3.0) lib/mix/tasks/dialyzer.ex:174: Mix.Tasks.Dialyzer.run/1
    (mix 1.15.2) lib/mix/task.ex:447: anonymous fn/3 in Mix.Task.run_task/5
    (mix 1.15.2) lib/mix/cli.ex:92: Mix.CLI.run_task/2

After downgrading back to Elixir 1.14, everything works like a charm.

Checking PLT...
[:arangox, :asn1, :benchee, :broadway, :broadway_kafka, :brod, :castore, :certifi, :compiler, :core, :cowboy, :cowboy_telemetry, :cowlib, :crc32cer, :crypto, :db_connection, :decimal, :deep_merge, :ecto, :ecto_sql, :ecto_sqlite3, :eex, :elixir, :ex_json_schema, :ex_raconteur, :expo, :exqlite, :faker, :fastglobal, :gen_stage, :gettext, :hackney, :hammox, :hpax, :httpoison, :idna, :jason, :joken, :jose, :json_logic, :kafka_protocol, :kernel, :logger, :metrics, :mime, :mimerl, :mint, :mox, :nanoid, :nimble_options, ...]
Looking up modules in dialyxir_erlang-26.0_elixir-1.14.5_deps-dev.plt
Looking up modules in dialyxir_erlang-26.0_elixir-1.14.5.plt
Looking up modules in dialyxir_erlang-26.0.plt
Finding applications for dialyxir_erlang-26.0.plt
Finding modules for dialyxir_erlang-26.0.plt
Creating dialyxir_erlang-26.0.plt
Looking up modules in dialyxir_erlang-26.0.plt
Removing 3 modules from dialyxir_erlang-26.0.plt
Checking 18 modules in dialyxir_erlang-26.0.plt
Adding 190 modules to dialyxir_erlang-26.0.plt
done in 0m7.59s
Finding applications for dialyxir_erlang-26.0_elixir-1.14.5.plt
Finding modules for dialyxir_erlang-26.0_elixir-1.14.5.plt
Copying dialyxir_erlang-26.0.plt to dialyxir_erlang-26.0_elixir-1.14.5.plt
Looking up modules in dialyxir_erlang-26.0_elixir-1.14.5.plt
Checking 208 modules in dialyxir_erlang-26.0_elixir-1.14.5.plt
Adding 253 modules to dialyxir_erlang-26.0_elixir-1.14.5.plt
done in 0m7.08s
Finding applications for dialyxir_erlang-26.0_elixir-1.14.5_deps-dev.plt
Finding modules for dialyxir_erlang-26.0_elixir-1.14.5_deps-dev.plt
Copying dialyxir_erlang-26.0_elixir-1.14.5.plt to dialyxir_erlang-26.0_elixir-1.14.5_deps-dev.plt
Looking up modules in dialyxir_erlang-26.0_elixir-1.14.5_deps-dev.plt
Checking 461 modules in dialyxir_erlang-26.0_elixir-1.14.5_deps-dev.plt
Adding 2046 modules to dialyxir_erlang-26.0_elixir-1.14.5_deps-dev.plt
done in 0m36.32s
No :ignore_warnings opt specified in mix.exs. Using default: .dialyzer_ignore.exs.

Starting Dialyzer
[
  check_plt: false,
  init_plt: '/Users/konstantinzolotarev/Coding/squillo/ex_raconteur_umbrella/_build/dev/dialyxir_erlang-26.0_elixir-1.14.5_deps-dev.plt',
  files: ['/Users/konstantinzolotarev/Coding/squillo/ex_raconteur_umbrella/_build/dev/lib/ex_raconteur/ebin/Elixir.ExRaconteur.Struct.CollectorStep.beam',
   '/Users/konstantinzolotarev/Coding/squillo/ex_raconteur_umbrella/_build/dev/lib/ex_raconteur/ebin/Elixir.ExRaconteur.Topic.BroadwayConsumer.State.beam',
   '/Users/konstantinzolotarev/Coding/squillo/ex_raconteur_umbrella/_build/dev/lib/spec/ebin/Elixir.ExRaconteur.Spec.Struct.Consumer.beam',
   '/Users/konstantinzolotarev/Coding/squillo/ex_raconteur_umbrella/_build/dev/lib/ex_raconteur_web/ebin/Elixir.ExRaconteurWeb.Endpoint.beam',
   '/Users/konstantinzolotarev/Coding/squillo/ex_raconteur_umbrella/_build/dev/lib/ex_raconteur/ebin/Elixir.ExRaconteur.Explainer.beam',
   ...],
  warnings: [:unknown]
]
Total errors: 3, Skipped: 0, Unnecessary Skips: 9
done in 0m3.45s
lib/ex_raconteur/file_service/adapter/behaviour.ex:11:unknown_type
Unknown type: Core.child_spec/0.
________________________________________________________________________________
lib/ex_raconteur/file_service/adapter/behaviour.ex:11:unknown_type
Unknown type: FileService.t/0.
________________________________________________________________________________
lib/mix/tasks/arango.create.collections.ex:1:callback_info_missing
Callback info about the Mix.Task behaviour is not available.
________________________________________________________________________________
done (warnings were emitted)
Halting VM with exit status 2

Where Next?

Popular in Questions Top

srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
logicmason
Hi there, I'm working through my first release with elixir/phoenix. I've built a release with distillery and found that it crashes when I...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
Mooodi
Given a string, how can I get access to its character by index? Enum.at("my_string", 2) doesn't work. Or rather, not char, but a substr...
New

Other popular topics Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
273 38985 115
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

We're in Beta

About us Mission Statement