question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Start script hangs without error when there are no available inotify watches

See original GitHub issue

Description

I tried to run npm start in a new project (i.e. I ran the four commands under “Quick Overview”), and it hanged indefinitely (well, at least for several minutes until I aborted) after the output “Starting packager…”.

Running react-native start gave the error ERROR watch {path} ENOSPC, which made me realize that there were no available inotify watches.

After increasing fs.inotify.max_user_watches, npm start started and ran normally.

Expected Behavior

npm start should give a warning or exit with an error saying that there are no available watches, so it can’t start.

Observed Behavior

npm start hanged with this output, and never continued:

$ npm start

> my-app@0.1.0 start /home/trygve/dev/create-react-native-app/my-app
> react-native-scripts start

13.49.26: Starting packager...

Environment

Please run these commands in the project folder and fill in their results:

  • npm ls react-native-scripts: react-native-scripts@0.0.30
  • npm ls react-native: react-native@0.44.2
  • npm ls expo: expo@17.0.0
  • node -v: v7.10.0
  • npm -v: 4.6.1
  • yarn --version: 0.24.6
  • watchman version: Not installed

Also specify:

  1. Operating system: Arch Linux
  2. Phone/emulator/simulator & version: Not relevant

Reproducible Demo

Ran npm start in a clean project just created, so nothing to provide here.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:44
  • Comments:59 (11 by maintainers)

github_iconTop GitHub Comments

39reactions
darkguy2008commented, Jun 13, 2018

I also have the same issue, using OSX Sierra 10.12.5. sysctl returns sysctl: unknown oid 'fs.inotify.max_user_watches'. Any ideas? 😦 I can’t start up any react iOS app, the simulator does, but nothing else happens and it gets stuck in the Packager thing…

Nevemind, fixed it with this:

sudo sysctl -w kern.maxfiles=524288
sudo sysctl -w kern.maxfilesperproc=524288
39reactions
k3acommented, Jul 8, 2017

@tetralix On Linux do “sudo sysctl -w fs.inotify.max_user_watches=10000”. This changes kernel sysctl value. This is temporary until reboot. To make it permanent, add fs.inotify.max_user_watches=10000 to a file in /etc/sysctl.d directory or /etc/sysctl.conf depending on distro.

Read more comments on GitHub >

github_iconTop Results From Across the Web

script hangs without error when there are no available inotify ...
I tried to run npm start in a new project (i.e. I ran the four commands under "Quick Overview"), and it hanged indefinitely...
Read more >
Why my Inotify script wont go further after watches established?
Start inotifywait script $ bash inw.sh & Setting up watches. Watches established. Make a change $ touch dir1/foo.
Read more >
How to use inotifywait to watch a directory for creation of files ...
xml file is created. What I tried: I have run the inotifywait --help command, and have read the command line options. It has...
Read more >
Bug #1602192 “when starting many LXD containers, they start ...
An easy fix for the issue is to bump the number of user watches up to 1024, making it possible to run around...
Read more >
How to find what has the most inotify registered watches
Different software may make use of this API to provide functionality. However, there may be a process or task that is registering too...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found