Skip to content
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

[1.0.2] TypeError: Unable to watch path #3336

Closed
amitrahav opened this issue Dec 20, 2014 · 21 comments
Closed

[1.0.2] TypeError: Unable to watch path #3336

amitrahav opened this issue Dec 20, 2014 · 21 comments

Comments

@amitrahav
Copy link

@amitrahav amitrahav commented Dec 20, 2014

after update from 1.0.1 to 1.0.2 I'm getting error on running meteor :

/home/user/.meteor/packages/meteor-tool/.1.0.37.6l7jjh++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/future.js:173
                        throw(ex);
                              ^
TypeError: Unable to watch path
  at HandleWatcher.start (/home/user/.meteor/packages/meteor-tool/.1.0.37.6l7jjh++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/lib/node_modules/pathwatcher/lib/main.js:66:29)
  at new HandleWatcher (/home/user/.meteor/packages/meteor-tool/.1.0.37.6l7jjh++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/lib/node_modules/pathwatcher/lib/main.js:30:12)
  at new PathWatcher (/home/user/.meteor/packages/meteor-tool/.1.0.37.6l7jjh++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/lib/node_modules/pathwatcher/lib/main.js:120:30)
  at Object.exports.watch (/home/user/.meteor/packages/meteor-tool/.1.0.37.6l7jjh++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/lib/node_modules/pathwatcher/lib/main.js:179:12)
  at Object.watch (/home/user/.meteor/packages/meteor-tool/.1.0.37.6l7jjh++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/safe-pathwatcher.js:27:28)
  at [object Object]._.extend._watchFileOrDirectory (/home/user/.meteor/packages/meteor-tool/.1.0.37.6l7jjh++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/watch.js:417:35)
  at /home/user/.meteor/packages/meteor-tool/.1.0.37.6l7jjh++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/watch.js:384:14
  at Function._.each._.forEach (/home/user/.meteor/packages/meteor-tool/.1.0.37.6l7jjh++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:87:22)
  at [object Object]._.extend._startFileWatches (/home/user/.meteor/packages/meteor-tool/.1.0.37.6l7jjh++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/watch.js:379:7)
  at new Watcher (/home/user/.meteor/packages/meteor-tool/.1.0.37.6l7jjh++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/watch.js:309:8)
  at [object Object]._.extend._runOnce (/home/user/.meteor/packages/meteor-tool/.1.0.37.6l7jjh++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/run-app.js:653:23)
  at [object Object]._.extend._fiber (/home/user/.meteor/packages/meteor-tool/.1.0.37.6l7jjh++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/run-app.js:758:28)
  at /home/user/.meteor/packages/meteor-tool/.1.0.37.6l7jjh++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/run-app.js:365:12

i'm running arch linux.

 meteor run --release 1.0.1

is working fine.

@epaminond
Copy link

@epaminond epaminond commented Dec 20, 2014

Get the same error. this.path variable at pathwatcher/lib/main.js:66:29 is a string: /home/user/.meteor/packages/meteor-tool/.1.0.37.13q0bl1++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/.bundle_version.txt

Loading

@glasser
Copy link
Member

@glasser glasser commented Dec 20, 2014

What filesystem are you using (eg, are you using something like Vagrant and sharing files between a VM and a host system)? Does this happen occasionally or every time?

@benjamn We were actively catching this error until some of the last versions of this change. I think we decided to stop catching it because it mostly meant "file does not exist" and we are already checking for that (albeit with slight race condition) but it looks like it fires in other cases too? Maybe it's time to send pathwatcher a PR to add errno to the thrown error.

Loading

@epaminond
Copy link

@epaminond epaminond commented Dec 20, 2014

I'm using ext4. By the way, for me error doesn't reproduce on 1.0.2-rc.6 release, but occurs on later releases.

Loading

@glasser glasser mentioned this issue Dec 20, 2014
7 tasks
@idmontie
Copy link

@idmontie idmontie commented Dec 20, 2014

👍 I get the same error.

I used to get a similar error when using 1.0.1 when I had my node_modules for my grunt tasks in the base path. I moved them to ./.grunt and everything was fine since meteor should not load files in folders prefixed with a dot.

But when I updated meteor to 1.0.2, I get this Type Error without any other change to my code. I downversioned my meteor release to METEOR@1.0.1 for now.

Loading

@glasser
Copy link
Member

@glasser glasser commented Dec 20, 2014

If you're seeing this issue (and not using Vagrant), using 1.0.2-rc.6 is probably a good workaround until we fix it (which still gives you most of the benefits of 1.0.2).

Loading

glasser added a commit that referenced this issue Dec 21, 2014
@glasser
Copy link
Member

@glasser glasser commented Dec 21, 2014

@amitrahav @epaminond @idmontie Can you try running meteor --release glasser:PATHWATCHER@1.0.0 in the same context and show any error that it throws?

Loading

@epaminond
Copy link

@epaminond epaminond commented Dec 21, 2014

@glasser I get this:

/home/epaminond/.meteor/packages/meteor-tool/.1.0.38-pw.1.1ay0h6a++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/future.js:173
                        throw(ex);
                              ^
Error: Unable to watch path, errno is 28
  at Error (<anonymous>:null:null)
  at Object.watch (/home/epaminond/.meteor/packages/meteor-tool/.1.0.38-pw.1.1ay0h6a++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/safe-pathwatcher.js:32:11)
  at [object Object]._.extend._watchFileOrDirectory (/home/epaminond/.meteor/packages/meteor-tool/.1.0.38-pw.1.1ay0h6a++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/watch.js:414:35)
  at /home/epaminond/.meteor/packages/meteor-tool/.1.0.38-pw.1.1ay0h6a++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/watch.js:381:14
  at Function._.each._.forEach (/home/epaminond/.meteor/packages/meteor-tool/.1.0.38-pw.1.1ay0h6a++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:87:22)
  at [object Object]._.extend._startFileWatches (/home/epaminond/.meteor/packages/meteor-tool/.1.0.38-pw.1.1ay0h6a++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/watch.js:376:7)
  at new Watcher (/home/epaminond/.meteor/packages/meteor-tool/.1.0.38-pw.1.1ay0h6a++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/watch.js:307:8)
  at [object Object]._.extend._runOnce (/home/epaminond/.meteor/packages/meteor-tool/.1.0.38-pw.1.1ay0h6a++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/run-app.js:651:23)
  at [object Object]._.extend._fiber (/home/epaminond/.meteor/packages/meteor-tool/.1.0.38-pw.1.1ay0h6a++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/run-app.js:756:28)
  at /home/epaminond/.meteor/packages/meteor-tool/.1.0.38-pw.1.1ay0h6a++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/run-app.js:363:12

Loading

@glasser
Copy link
Member

@glasser glasser commented Dec 21, 2014

@epaminond: and what does cat /proc/sys/fs/inotify/max_user_watches say? (With sudo if necessary)

Loading

@amitrahav
Copy link
Author

@amitrahav amitrahav commented Dec 21, 2014

im getting:

   Starting your app                         -
/home/amit/.meteor/packages/meteor-tool/.1.0.38-pw.1.16d14aj++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/future.js:173
                        throw(ex);
                              ^
Error: Unable to watch path, errno is 28
  at Error (<anonymous>:null:null)
  at Object.watch (/home/amit/.meteor/packages/meteor-tool/.1.0.38-pw.1.16d14aj++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/safe-pathwatcher.js:32:11)
  at [object Object]._.extend._watchFileOrDirectory (/home/amit/.meteor/packages/meteor-tool/.1.0.38-pw.1.16d14aj++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/watch.js:414:35)
  at /home/amit/.meteor/packages/meteor-tool/.1.0.38-pw.1.16d14aj++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/watch.js:381:14
  at Function._.each._.forEach (/home/amit/.meteor/packages/meteor-tool/.1.0.38-pw.1.16d14aj++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:87:22)
  at [object Object]._.extend._startFileWatches (/home/amit/.meteor/packages/meteor-tool/.1.0.38-pw.1.16d14aj++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/watch.js:376:7)
  at new Watcher (/home/amit/.meteor/packages/meteor-tool/.1.0.38-pw.1.16d14aj++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/watch.js:307:8)
  at setupClientWatcher (/home/amit/.meteor/packages/meteor-tool/.1.0.38-pw.1.16d14aj++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/run-app.js:663:23)
  at [object Object]._.extend._runOnce (/home/amit/.meteor/packages/meteor-tool/.1.0.38-pw.1.16d14aj++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/run-app.js:674:7)
  at [object Object]._.extend._fiber (/home/amit/.meteor/packages/meteor-tool/.1.0.38-pw.1.16d14aj++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/run-app.js:756:28)
  at /home/amit/.meteor/packages/meteor-tool/.1.0.38-pw.1.16d14aj++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/run-app.js:363:12

and 8192

Loading

@glasser
Copy link
Member

@glasser glasser commented Dec 21, 2014

@amitrahav Can you run this command:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

and try running meteor again and see if that fixes it?

Probably what we'll do is put out a 1.0.2.1 which catches this error and prints a link to a wiki page telling you to run this command for better performance.

Loading

@amitrahav
Copy link
Author

@amitrahav amitrahav commented Dec 21, 2014

cool. works fine!
thanx!

2014-12-21 19:47 GMT+02:00 David Glasser notifications@github.com:

@amitrahav https://github.com/amitrahav Can you run this command:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

and try running meteor again and see if that fixes it?

Probably what we'll do is put out a 1.0.2.1 which catches this error and
prints a link to a wiki page telling you to run this command for better
performance.


Reply to this email directly or view it on GitHub
#3336 (comment).

Loading

@epaminond
Copy link

@epaminond epaminond commented Dec 21, 2014

@glasser cat /proc/sys/fs/inotify/max_user_watches returns 8192 for me either.

Loading

@funkyeah
Copy link

@funkyeah funkyeah commented Dec 22, 2014

@glasser
same issue here on Ubuntu 14.04.1 w/ Ext4
saw 8192 with cat
used:

 echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

problem is now fixed

Loading

@glasser glasser closed this in f5f136a Dec 22, 2014
glasser added a commit that referenced this issue Dec 22, 2014
Instead, increase polling interval for that file/dir to 500ms from 5s.

Fixes #3336.

The most common case where this was occuring is when you're on Linux and
your inotify max_user_watches is too low.  A wiki page will explain how
to increase this.  In debug mode, a message will tell you to go to the
wiki page if you hit the limit (we may later expose this message by
default, but it is part of the new user experience).

Conflicts:
	meteor
	tools/safe-pathwatcher.js
@glasser
Copy link
Member

@glasser glasser commented Dec 22, 2014

@amitrahav @epaminond @idmontie @funkyeah Can you help test a release candidate that fixes this issue?

First, revert the previous workaround temporarily by running:

echo fs.inotify.max_user_watches=8192 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

Now, in your app, run meteor --release 1.0.2.1-rc.2. This is what is expected:

  • It should not crash!
  • It should react quickly to file changes. (However, it uses more CPU than it needs to.)
  • It should print a link to a wiki page explaining how to run the command you all tested for me to improve performance.

Let me know if this happens or doesn't happen, and if you have any comments on the wiki page!

Loading

@epaminond
Copy link

@epaminond epaminond commented Dec 23, 2014

@glasser for me it didn't crash and did print a link to wiki.

Loading

@amitrahav
Copy link
Author

@amitrahav amitrahav commented Dec 23, 2014

@glasser for me it worked fine, but the problem didn't solves after editing /etc/sysctl.conf.

Loading

@glasser
Copy link
Member

@glasser glasser commented Dec 23, 2014

@amitrahav hmm, but earlier you did say the fix works? Did you run sudo sysctl -p after editing?

Loading

@amitrahav
Copy link
Author

@amitrahav amitrahav commented Dec 23, 2014

i did. the problem solved temporarily after echo
fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
but it returns after a while.

2014-12-23 23:28 GMT+02:00 David Glasser notifications@github.com:

@amitrahav https://github.com/amitrahav hmm, but earlier you did say
the fix works? Did you run sudo sysctl -p after editing?


Reply to this email directly or view it on GitHub
#3336 (comment).

Loading

@glasser
Copy link
Member

@glasser glasser commented Dec 23, 2014

OK. What exactly do you mean by "the problem"? And are you using 1.0.2.1 now or an rc?

Loading

@bgbhavesh
Copy link

@bgbhavesh bgbhavesh commented Jan 3, 2015

meteor --release 1.0.2.1-rc.2

works for me.
Thanks

Loading

@nooitaf
Copy link

@nooitaf nooitaf commented Dec 27, 2016

I got this error with meteor 1.4.1 and fixed it by installing the npm packages ;)

meteor npm install

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants