Watchman: unable to talk to your watchman ...

Created on 21 Jan 2019  Â·  11Comments  Â·  Source: facebook/watchman

OS: IOS Mojave
watchman: v4.9.0

in the last day or so, starting my react-native environment, long hang followed by watchman error:

[cli] unable to talk to your watchman on /opt/local/var/run/watchman/axian-state/sock! (No such file or directory)

which is absolutely true, there is no sock! at that location. Have no idea why it's suddenly looking for it?

Most helpful comment

For anyone who has a similar issue.
If even watchman --foreground --logfile=/dev/stdout fails, everything will more likely fail too.
In my case just going to /usr/local/var/run/watchman/<username>-state/ and removing pid and other files that were there, fixed the issue.

All 11 comments

Do you have a log file in /opt/local/var/run/watchman/axian-state that you can share?
Did you install watchman through homebrew?
What happens if you run:

$ watchman --foreground --logfile=/dev/stdout

hey wez,
No log file at that location and ...

$ watchman --foreground --logfile=/dev/stdout
2019-01-26T14:18:08,514: [listener] Watchman 4.9.0 <no build info set> starting up on Axians-MacBook-Pro.local
2019-01-26T14:18:08,615: [listener] failed to parse json from /opt/local/var/run/watchman/axian-state/state: unable to open /opt/local/var/run/watchman/axian-state/state: No such file or directory
2019-01-26T14:18:08,615: [listener] file limit is 256 kern.maxfilesperproc=24576
2019-01-26T14:18:08,615: [listener] raised file limit to 24576
2019-01-26T14:18:08,616: [listener] launchd checkin failed: No such process

Yes installed (and reinstalled multiple times) with homebrew.

so, even under sudo (thought it was an access issue)

Axians-MacBook-Pro:work axian$ sudo watchman --foreground --logfile=/dev/stdout
2019-01-26T20:11:44,695: [listener] Watchman 4.9.0 <no build info set> starting up on Axians-MacBook-Pro.local
2019-01-26T20:11:44,696: [listener] failed to parse json from /usr/local/var/run/watchman/root-state/state: unable to open /usr/local/var/run/watchman/root-state/state: No such file or directory
2019-01-26T20:11:44,696: [listener] file limit is 256 kern.maxfilesperproc=24576
2019-01-26T20:11:44,696: [listener] raised file limit to 24576
2019-01-26T20:11:44,696: [listener] launchd checkin failed: No such process

(and the process hangs)

however I can do this (can't under non sudo):

Axians-MacBook-Pro:work axian$ sudo watchman get-pid
{
    "version": "4.9.0",
    "pid": 863
}

so I'm out of ideas on this. I did recently upgrade to Mojave on this system which might be at issue, but frankly, no idea.

@karlkras I encountered this issue as well. You're correct that it is an access issue.

Running this resolved the issue for me:

chmod 0700 /usr/local/var/run/watchman/greg-state

Make sure to change "greg" to your user ("axian" in your case). You'll also need to ensure that your user owns this path, and not another user (like root).

Yeah, I believe I already did this, but I'll double check this evening... I sorta gave up and moved exclusively to android only emulator from a windows box.

Just formatted a new laptop and I am having this same issue on Mojave with 4.9.0. The steps which worked for everyone else in other issue threads – reinstalling watchman with brew and changing permissions have no impact.

I get the same error and outputs to original questions as @karlkras

The odd part is, it was working fine for iOS and the only thing I did was clean my android build. Then I ran this and all of a sudden, it's bricked.

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

Hmm I eventually resolved this by repeating the uninstall and reinstall watchman + permissions a few times and ultimately restarting I think fixed it. Sorry, I'm all good now

For anyone who has a similar issue.
If even watchman --foreground --logfile=/dev/stdout fails, everything will more likely fail too.
In my case just going to /usr/local/var/run/watchman/<username>-state/ and removing pid and other files that were there, fixed the issue.

I also had issues with watchman hanging.

In addition to what's been mentioned above I also had the issue that I installed and ran watchman over an SSH session which may not work very well, at least not in my case.

I'm having this issue on Windows, so a lot of these fix suggestion (dealing with pids, chmod, /dev/stdout) don't apply. Anybody solve this for Windows?

I have similar issue to this. After an hour of reinstall watchman, a simple restart my MacBook solved it...

Was this page helpful?
0 / 5 - 0 ratings