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

lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
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
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
kostonstyle
Hi all I want to have a unix time, from the current time plus 1 hour. DateTime.now + 1 hour How to get it in elixir? Thanks
New
chewm
Hi guys, nice to meet you to the whole forum, I’m new here, I’m trying to configure visual studio code for elixir, right now the intellis...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New

Other popular topics Top

josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
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
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
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
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

We're in Beta

About us Mission Statement