-
Notifications
You must be signed in to change notification settings - Fork 999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to run watchman watch <directory_name> #69
Comments
Can you run the following commands and paste the output here?
|
Hey, I've since tried multiple things, fixing permissions in disk tool, also disabling the service via: |
I'm also getting this issue on 10.9, but restarting doesn't seem to help. I'm getting this:
Do you have to run watchman as root? If not then the way you're loading launchd jobs is wrong: according to http://launchd.info/ there is a per-user overrides.plist and watchman seems to be trying to access one owned by root :( |
oh and:
|
Watchman doesn't contain any code to elevate privilege. You should always run it as yourself unless you are doing something unusual. Did either of you run it as root? Trying to understand what is broken for you and how it got broken. |
I did not ever try to run it as root :( Is there an easy way I can completely delete all launchd plists and reinstall it? I installed from source originally as per the instructions on the website. |
The only thing that watchman creates is To remove that, I would do:
I'm also tracking an issue where the TMPDIR (which is random by default on OSX) gets baked in to the plist file. My recommendation until I can push a fix for that is to |
The only thing I did was install it via brew and try to use it via ember-cli. Nothing more nothing less, and a restart fixed my issues. |
@wez Thank you for your help. I will try to completely remove my install of watchman and install the brew build and track what happens. @piotrpalek This issue has persisted over several restarts for me :( |
For reference, when i try to unload that job I get [ixtli@ixtlis-Mac-Pro] ~ $ launchctl unload ~/Library/LaunchAgents/com.github.facebook.watchman.plist
Could not open job overrides database at: /private/var/db/launchd.db/com.apple.launchd/overrides.plist: 13: Permission denied
launchctl: Error unloading: com.github.facebook.watchman Then, as a super user: [ixtli@ixtlis-Mac-Pro] ~ $ sudo launchctl unload ~/Library/LaunchAgents/com.github.facebook.watchman.plist
Password:
launchctl: Dubious ownership on file (skipping): /Users/ixtli/Library/LaunchAgents/com.github.facebook.watchman.plist
nothing found to unload |
Restart and reinstall don't work :( I can confirm that |
Aaand to bring an end to my comment spam here I deleted I have no idea :/ |
@ixtli I would help you but I just poked around when it wasn't working, and then restarted and it did work after that. So I really don't know what caused the problem or how I (if at all) fixed it. |
Summary: On OSX, and perhaps some other environments, the TMPDIR environment is randomized by default. This means that in the default install the watchman socket will be in a random location when you first run it. Since we capture this path in the launchd plist this can result in not being able to communicate with watchman in cases where you log in again and have a new randomized TMPDIR. To avoid this issue we now default to always setting WATCHMAN_STATE_DIR to a fixed and known default. If not set explicitly at configure time, we'll default to `$prefix/var/run/watchman` so that the default is generally either `/usr/local/var/run/watchman` or `/var/run/watchman` depending on whether this is a local or a system install. The install rule for creating this dir has to make this dir world writable so that any user can create their socket there. This should be no less secure than putting these files in `$TMPDIR`. We also need to take some extra measures to ensure that launchd can pick up these fixed paths; when we decide that we need to spawn watchman; we repair it by first unloading an existing plist, then writing out the new one with the newly configured settings. This allows the repaired plist to be loaded and the service to be started. Without this, we would rewrite the plist only, and launchd would punt on loading it since it was already loaded. #69 Test Plan: `make integration` to prove that this didn't impact the integration environment. ad-hoc tests locally; `/usr/local/bin/watchman watch-list` to start a pre-existing version of watchman without these changes, then `./watchman watch-list` to run a version from this installation. The local build is always able to replace and re-launch itself. The old build was not able to do this; it would get stuck for the timeout before reporting that it was unable to talk to watchman. Reviewers: durham, sid0 Reviewed By: sid0 Differential Revision: https://reviews.facebook.net/D32253
I'm seeing this issue. @wez Is there anything I can provide to help diagnose this issue? Permissions for that file:
When I try to watch a directory:
When I restarted once, it started working, then the issue cropped up again. Now even after restarting, deleting the PLIST file, etc... I get that issue. Running Mac OS X 10.10.3. Installed via Homebrew. Also tried the latest and compiling from source and ran into the same issue. There's nothing in the log file. |
@synotic what happens if you run It might also be interesting to trace the syscall activity... can you try this in one window:
Then try the |
Running that command (I'm assuming it should be I sent you an email with the trace output. |
http://apple.stackexchange.com/a/88670 describes what lives in |
@synotic did you get things working? |
I think this might have the same underlying cause as #90 which turned out to be a |
I can still reproduce this with version 3.3.0.
Reboot or can I get some logs for you? dtrace? Or just let Disk Utility repair permissions? Rebooting fixed it for me on 3.2.0. (I just didn't have the time to do the debugging that day.) |
Try removing the .plist file? We've seen some cases where launchd won't load a plist after a major OS upgrade or restore from another disk, even though the visible permissions look fine. The simplest resolution has been to remove the plist file and then let watchman re-create it. |
Doesn't change a thing. |
Knorkebrot, are you running tmux or screen? I hit this same issue until I exited to a non-tmux session, and now I'm working ok again. Looking around forums, it seems that launchctl and tmux aren't always good friends. |
same issue here, but I was in a tmux session, after I quit the tmux session, it works. |
@nayrmi I do, but it didn't work outside of tmux as well. |
Have we reported the failure to talk to I couldn't find any issues related to that (open or closed): |
Just ran into this myself, and I'm not sure it was ever raised with the tmux team, so I filed a report here: tmux/tmux#600 |
When I try to run
watchamn watch some_dir_name
I get this error:I am using OSX Yosemite and installed watchman via homebrew.
The text was updated successfully, but these errors were encountered: