Supervision child dependencies: the process is not alive or there’s no process currently associated with the given name

Experienced programmer writer her first Elixir, and maybe bit off more than she can chew?

I’m trying to start two GenServers, where the second registers a subscription to the subscription to the first. Except the GenServer.call() call crashes out with “the process is not alive or there’s no process currently associated with the given name, possibly because its application isn’t started”

Full OTP/SASL logging seems to indicate it’s started, so I’m not sure what’s up? I guess the process names are wrong, but these are singleton servers using their module atoms as the name.

Full code is alchemical-swarm/hivemind

Full Log
Erlang/OTP 29 [erts-17.0.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]

[info] Application logger started at :nonode@nohost mfa=:application_controller.info_started/2 
[info] Child :ttb_autostart of Supervisor :runtime_tools_sup started
Pid: #PID<0.183.0>
Start Call: :ttb_autostart.start_link()
Restart: :temporary
Shutdown: 3000
Type: :worker mfa=:supervisor.report_progress/3 
[info] Application runtime_tools started at :nonode@nohost mfa=:application_controller.info_started/2 
[info] Application wx started at :nonode@nohost mfa=:application_controller.info_started/2 
[info] Application et started at :nonode@nohost mfa=:application_controller.info_started/2 
[info] Application observer started at :nonode@nohost mfa=:application_controller.info_started/2 
[info] Application hpax started at :nonode@nohost mfa=:application_controller.info_started/2 
[info] Application mint started at :nonode@nohost mfa=:application_controller.info_started/2 
[info] Child NimblePool.TaskSupervisor of Supervisor #PID<0.186.0> (Supervisor.Default) started
Pid: #PID<0.187.0>
Start Call: Task.Supervisor.start_link([name: NimblePool.TaskSupervisor])
Restart: :permanent
Shutdown: :infinity
Type: :supervisor mfa=:supervisor.report_progress/3 
[info] Application nimble_pool started at :nonode@nohost mfa=:application_controller.info_started/2 
[info] Application nimble_options started at :nonode@nohost mfa=:application_controller.info_started/2 
[info] Child :telemetry_handler_table of Supervisor :telemetry_sup started
Pid: #PID<0.191.0>
Start Call: :telemetry_handler_table.start_link()
Restart: :permanent
Shutdown: 5000
Type: :worker mfa=:supervisor.report_progress/3 
[info] Application telemetry started at :nonode@nohost mfa=:application_controller.info_started/2 
[info] Application mime started at :nonode@nohost mfa=:application_controller.info_started/2 
[info] Application finch started at :nonode@nohost mfa=:application_controller.info_started/2 
[info] Application jason started at :nonode@nohost mfa=:application_controller.info_started/2 
[info] Child Req.Finch.PIDPartition0 of Supervisor Req.Finch started
Pid: #PID<0.197.0>
Start Call: Registry.Partition.start_link(Req.Finch.PIDPartition0, {{:duplicate, :pid}, Req.Finch, 0, 1, Req.Finch.KeyPartition0, Req.Finch.PIDPartition0, [], false})
Restart: :permanent
Shutdown: 5000
Type: :worker mfa=:supervisor.report_progress/3 
[info] Child Req.Finch of Supervisor Req.Finch.Supervisor started
Pid: #PID<0.196.0>
Start Call: Registry.start_link([keys: :duplicate, name: Req.Finch, listeners: [], meta: [config: %{pools: %{}, registry_name: Req.Finch, registry_listeners: [], supervisor_registry_name: Req.Finch.SupervisorRegistry, supervisor_name: Req.Finch.PoolSupervisor, default_pool_config: %{count: 1, size: 50, mod: Finch.HTTP1.Pool, conn_opts: [client_settings: [enable_push: false], protocols: [:http1], transport_opts: [keepalive: true, nodelay: true, timeout: 5000], ssl_key_log_file_device: nil], pool_max_idle_time: :infinity, conn_max_idle_time: :infinity, start_pool_metrics?: false, wait_for_server_settings?: false, ping_interval: :infinity, max_connection_age: :infinity, max_connection_age_jitter: 0}}]])
Restart: :permanent
Shutdown: :infinity
Type: :supervisor mfa=:supervisor.report_progress/3 
[info] Child Req.Finch.SupervisorRegistry.PIDPartition0 of Supervisor Req.Finch.SupervisorRegistry started
Pid: #PID<0.199.0>
Start Call: Registry.Partition.start_link(Req.Finch.SupervisorRegistry.PIDPartition0, {:unique, Req.Finch.SupervisorRegistry, 0, 1, Req.Finch.SupervisorRegistry.KeyPartition0, Req.Finch.SupervisorRegistry.PIDPartition0, [], false})
Restart: :permanent
Shutdown: 5000
Type: :worker mfa=:supervisor.report_progress/3 
[info] Child Req.Finch.SupervisorRegistry of Supervisor Req.Finch.Supervisor started
Pid: #PID<0.198.0>
Start Call: Registry.start_link([keys: :unique, name: Req.Finch.SupervisorRegistry])
Restart: :permanent
Shutdown: :infinity
Type: :supervisor mfa=:supervisor.report_progress/3 
[info] Child Req.Finch.PoolSupervisor of Supervisor Req.Finch.Supervisor started
Pid: #PID<0.200.0>
Start Call: DynamicSupervisor.start_link([name: Req.Finch.PoolSupervisor, strategy: :one_for_one])
Restart: :permanent
Shutdown: :infinity
Type: :supervisor mfa=:supervisor.report_progress/3 
[info] Child Req.Finch of Supervisor #PID<0.194.0> (Supervisor.Default) started
Pid: #PID<0.195.0>
Start Call: Finch.start_link([name: Req.Finch, pools: %{default: [protocols: [:http1]]}])
Restart: :permanent
Shutdown: 5000
Type: :worker mfa=:supervisor.report_progress/3 
[info] Child Req.FinchSupervisor of Supervisor #PID<0.194.0> (Supervisor.Default) started
Pid: #PID<0.202.0>
Start Call: DynamicSupervisor.start_link([strategy: :one_for_one, name: Req.FinchSupervisor])
Restart: :permanent
Shutdown: :infinity
Type: :supervisor mfa=:supervisor.report_progress/3 
[info] Child Req.Test.Ownership of Supervisor #PID<0.194.0> (Supervisor.Default) started
Pid: #PID<0.203.0>
Start Call: Req.Test.Ownership.start_link([name: Req.Test.Ownership])
Restart: :permanent
Shutdown: 5000
Type: :worker mfa=:supervisor.report_progress/3 
[info] Application req started at :nonode@nohost mfa=:application_controller.info_started/2 
[info] Application req_server_sent_events started at :nonode@nohost mfa=:application_controller.info_started/2 
[info] Child Alchemy.Webhooks.Caster of Supervisor #PID<0.206.0> (Supervisor.Default) started
Pid: #PID<0.207.0>
Start Call: Alchemy.Webhooks.Caster.start_link([])
Restart: :permanent
Shutdown: 5000
Type: :worker mfa=:supervisor.report_progress/3 
[error] Process #PID<0.209.0> terminating
** (exit) exited in: GenServer.call(Alchemy.Webhooks.Caster, {:subscribe, #PID<0.209.0>}, 600000)
    ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
    (elixir 1.19.5) lib/gen_server.ex:1135: GenServer.call/3
    (alchemy 0.1.0) lib/alchemy/bobnet.ex:14: Alchemy.BobNet.init/1
    (stdlib 8.0) gen_server.erl:2276: :gen_server.init_it/2
    (stdlib 8.0) gen_server.erl:2236: :gen_server.init_it/6
    (stdlib 8.0) proc_lib.erl:333: :proc_lib.init_p_do_apply/3
Initial Call: Alchemy.BobNet.init/1
Ancestors: [#PID<0.206.0>, #PID<0.205.0>]
Message Queue Length: 0
Messages: []
Links: [#PID<0.206.0>]
Dictionary: []
Trapping Exits: false
Status: :running
Heap Size: 233
Stack Size: 29
Reductions: 64 mfa=:proc_lib.crash_report/4 
[error] Child Alchemy.BobNet of Supervisor #PID<0.206.0> (Supervisor.Default) failed to start
** (exit) exited in: GenServer.call(Alchemy.Webhooks.Caster, {:subscribe, #PID<0.209.0>}, 600000)
    ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
Start Call: Alchemy.BobNet.start_link([])
Restart: :permanent
Shutdown: 5000
Type: :worker mfa=:supervisor.start_children/2 
[notice] Application alchemy exited: Alchemy.start(:normal, []) returned an error: shutdown: failed to start child: Alchemy.BobNet
    ** (EXIT) exited in: GenServer.call(Alchemy.Webhooks.Caster, {:subscribe, #PID<0.209.0>}, 600000)
        ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started mfa=:application_controller.info_exited/3 
[error] Process #PID<0.204.0> terminating
** (exit) exited in: Alchemy.start(:normal, [])
    ** (EXIT) shutdown: failed to start child: Alchemy.BobNet
        ** (EXIT) exited in: GenServer.call(Alchemy.Webhooks.Caster, {:subscribe, #PID<0.209.0>}, 600000)
            ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
    (kernel 11.0.1) application_master.erl:147: :application_master.init/3
    (stdlib 8.0) proc_lib.erl:333: :proc_lib.init_p_do_apply/3
Initial Call: :application_master.init/3
Ancestors: [:application_controller, #PID<0.10.0>]
Message Queue Length: 1
Messages: [{:EXIT, #PID<0.205.0>, :normal}]
Links: [#PID<0.45.0>]
Dictionary: []
Trapping Exits: true
Status: :running
Heap Size: 376
Stack Size: 29
Reductions: 70 mfa=:proc_lib.crash_report/4 
** (exit) :terminating
    (kernel 11.0.1) application_controller.erl:521: :application_controller.call/2
    (kernel 11.0.1) application.erl:363: :application."-ensure_all_started/3-lc$^0/1-0-"/1
    (kernel 11.0.1) application.erl:363: :application.ensure_all_started/3
    (mix 1.19.5) lib/mix/tasks/app.start.ex:75: Mix.Tasks.App.Start.start/3
    (mix 1.19.5) lib/mix/task.ex:499: anonymous fn/3 in Mix.Task.run_task/5
    (mix 1.19.5) lib/mix/tasks/run.ex:150: Mix.Tasks.Run.run/5
    (mix 1.19.5) lib/mix/tasks/run.ex:106: Mix.Tasks.Run.run/1
    (mix 1.19.5) lib/mix/task.ex:499: anonymous fn/3 in Mix.Task.run_task/5
error: Recipe `iex` failed on line 21 with exit code 1

Your Alchemy.Webhooks.Caster doesn‘t register itself with the module name in start_link, while its subscribe function expects such a name registration.

See GenServer — Elixir v1.20.1 if you need more information.

2 Likes

thanks! yup, that did it