aus

aus

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.

First 10 of 29 Posts Switch mode

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.

19
Post #1
aus

aus OP

Done, but :observer.open() results in the following error:

{:error,
 {:undef,
  [
    {:observer_backend, :sys_info, [], []},
    {:observer_sys_wx, :init, 1, [file: ~c"observer_sys_wx.erl", line: 50]},
    {:wx_object, :init_it, 6, [file: ~c"wx_object.erl", line: 404]},
    {:proc_lib, :init_p_do_apply, 3, [file: ~c"proc_lib.erl", line: 240]}
  ]}}

Any idea why?

adamu

adamu

Should be :observer.start().

aus

aus OP

I mistyped the command, I actually used :observer.start() and got the error message…

benstepp

benstepp

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

24
Post #5
chanphiromsok

chanphiromsok

saved me hehe, I wonder why after upgrading to 1.15 :observer.start` is undefined now it work

josevalim

josevalim

Creator of Elixir

Correct. I also submitted a bug report upstream.

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
josevalim

josevalim

Creator of Elixir

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

godzila

godzila

After adding :observer, :wx and :runtime_tools to :extra_application I get:

[notice] Application runtime_tools exited: :stopped
** (Mix) Could not start application observer: could not find application file: observer.app

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
silverdr
Using Phoenix.LiveView.TagEngine as an EEx.Engine is deprecated! To compile HEEx, use Phoenix.LiveView.TagEngine.compile/2 instead. Sta...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New

We're in Beta

About us Mission Statement