Can't find executable `mac_listener` - [error] exited in: GenServer.call

I’ve installed a lot of updates on my machine, both from brew and the App Store and I probably broke something. When I create a new Phoenix (1.3.0) app with "mix phx.new " and run it I get the following error in the console:

[error] exited in: GenServer.call(:phoenix_live_reload_file_monitor, :subscribe, 5000)
    ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its applicat
ion isn't started

Anyone got an idea on what I should do to rectify this?

The term mac_listener you used in your topic is not contained in the error message. Did you copied it only partially?

Aside of that, does the problem persist when you disable live reload?

Nvm, I fixed this right now.

I got a new version of X-Code installed and I forgot to accept the updated license. If the license is not accepted the tools in it cannot be used. This made the file_system package (dependency of phoenix_live_reload) fail to compile the native stuff it needs to compile in order to detect changes to the file system.

Anyway, accepting the license and mix deps.clean --all && mix deps.compile made this error disappear and everything works again.

6 Likes

@NobbZ

$ mix phx.server
[error] Can't find executable `mac_listener`
[info] Running TrackWeb.Endpoint with Cowboy using http://0.0.0.0:4000
21:23:28 - info: compiled 6 files into 2 files, copied 3 in 1.2 sec
[error] exited in: GenServer.call(:phoenix_live_reload_file_monitor, :subscribe, 5000)
    ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its applicat
ion isn't started
```

@kwando did you at least get a better error when compiling the code?

In any case, I have pushed a new phoenix_live_reload that improves the error messages and gets rid of the “** (EXIT)” message altogether. Thanks!

2 Likes

I have plenty of the errors too, in all my projects:

[error] exited in: GenServer.call(:phoenix_live_reload_file_monitor, :subscribe, 5000)
    ** (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

with the latest version of phoenix_live_reload_file_monitor

@kwando said, he had updated his XCode and to accept a license, perhaps you missed this step. Then he had to purge and recompile his dependencies. Just try it yourself. rm -rf deps _build; mix do deps.get, deps.compile.

already removed and recompiled
I’m on linux

Then you need to install inotify-tools. I’m wondering though, why its asking for mac_listener then…

1 Like

I ran into this issue this afternoon after having updated my operating system.

For those that stumble onto this thread, running xcode-select --install, accepting the new license agreement and then just running mix deps.compile file_system worked for me.

7 Likes

It doesn’t work for me…
I have done everything told :

  • uninstall Xcode
  • remove Command Line Tools
  • mix deps.clean --all && rm -rf _build deps
  • reinstall Xcode
  • run xcode-select --install, accept the license agreement
  • reboot
  • run mix deps.get && mix deps.compile file_system
    and stil doesn’t work.

I even try to

  • locate /CoreServices.h
  • export CFLAGS="-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include"
    and stil doesn’t work.

I always have this error

14:13:05.389 [info]  Compiling file system watcher for Mac...
==> file_system
c_src/mac/cli.c:1:10: fatal error: 'getopt.h' file not found
#include <getopt.h>
         ^~~~~~~~~~
1 error generated.
In file included from c_src/mac/compat.c:1:
c_src/mac/compat.h:16:10: fatal error: 'CoreServices/CoreServices.h' file not found
#include <CoreServices/CoreServices.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from c_src/mac/main.c:1:
c_src/mac/common.h:4:10: fatal error: 'CoreFoundation/CoreFoundation.h' file not found
#include <CoreFoundation/CoreFoundation.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

14:13:05.528 [error] Could not compile file system watcher for Mac, try to run "clang -framework CoreFoundation -framework CoreServices -Wno-deprecated-declarations c_src/mac/*.c -o priv/mac_listener" manually inside the dependnecy.
...
[info] Replied phoenix:live_reload :error
[info] Replied phoenix:live_reload :error
[info] Replied phoenix:live_reload :error
...

It’s very annoying…
I event tried the recommended clang command from this error message inside deps/file_system and still doesn’t work.

I have
MacOS Mojave 10.14.4
Xcode Version 10.2.1 (10E1001)
xcode-select version 2354
Erlang/OTP 21 from Homebrew
Elixir 1.8.1 (compiled with Erlang/OTP 21) from Homebrew
Phoenix ~>1.4.0
Phoenix_live_reload ~>1.2
file_system 0.2.6

Anyone can help me?

@rocky have you tried this command?
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

2 Likes

@falood wow it works great as before now!
I didn’t know there were an SDK headers to install after Command Line Tools…
Thank you!

1 Like

Good news, I have updated this information in the README of file_system.

2 Likes

To fix it in Catalina, set the correct headers path in .bash_profile:
export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)"

(/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.15.pkg is not available in Catalina).

… and then recompile the deps.

2 Likes

I got this error on a fresh install, first time in over a year, and your suggestion removed the error. Thanks.

mix phx.server                                                                                                                               ─╯
[error] Can't find executable `mac_listener`
[warn] Could not start Phoenix live-reload because we cannot listen to the file system.
You don't need to worry! This is an optional feature used during development to
refresh your browser when you save files and it does not affect production.
1 Like