"No space left on device" when running dev server
🐛 bug report
Running dev server outputs an error saying there's no empty space left on the device.
🎛 Configuration (.babelrc, package.json, cli command)
Zero configuration, running yarn serve --https --host 0.0.0.0 --no-cache
🤔 Expected Behavior
Dev server should start
😯 Current Behavior
It immediately fails with:
[Error: inotify_add_watch failed: No space left on device]
🌍 Your Environment
| Software | Version(s) |
|---|---|
| Parcel | 2.0.0-nightly.426 |
| Node | 14.12.0 |
| npm/Yarn | yarn 1.22.5 |
| Operating System | Ubuntu 20.04.1 LTS |
This issue does not happen on 2.0.0-nightly.388 so I figure it has been introduced after.
Changes between those these releases: https://github.com/parcel-bundler/parcel/compare/288396a5...5f72d6b
Could you test which version is the first one that fails for you (the one that introduced this)?
This is probably not actually caused by "No space left on device" but because there are too many watchers added to the filesystem?
@mischnic I did not have time to bisect the changes, but I know nightly.475 and 476 have been working.
I am experiencing this problem ATM as well. Just that I do not need to google out the sysctl commands every time, here's the workaround:
# sysctl fs.inotify
fs.inotify.max_queued_events = 16384
fs.inotify.max_user_instances = 128
fs.inotify.max_user_watches = 8192
# sysctl fs.inotify.max_user_watches=16384
My environment:
| Software | Version(s) |
|---|---|
| Parcel | 2.0.0-nightly.314+cc5b4862 |
| Node | v14.15.4 |
| npm/Yarn | yarn 1.22.5 |
| Operating System | Debian Buster |
I'm getting this today with
> parcel public/index.html
[Error: inotify_add_watch failed: No space left on device]
Error: server closed unexpectedly
at ChildProcess.onClose (/home/runner/work/portal/portal/node_modules/start-server-and-test/src/index.js:69:14)`=
| Software | Version(s) |
|---|---|
| Parcel | ^2.0.0-nightly.671 |
| Node | v15.14.0 |
| npm/Yarn | 7.13.0 |
I am experiencing this problem ATM as well. Just that I do not need to google out the
sysctlcommands every time, here's the workaround:# sysctl fs.inotify fs.inotify.max_queued_events = 16384 fs.inotify.max_user_instances = 128 fs.inotify.max_user_watches = 8192 # sysctl fs.inotify.max_user_watches=16384My environment: Software Version(s) Parcel 2.0.0-nightly.314+cc5b4862 Node v14.15.4 npm/Yarn yarn 1.22.5 Operating System Debian Buster
this workaround works for me.
My environment:
| Software | Version(s) |
|---|---|
| Parcel | 2.0.0-nightly.314+cc5b4862 |
| Node | v14.15.4 |
| npm/Yarn | npm 7.7.6 |
| Operating System | Zorin OS 15.3 |
I am experiencing this problem ATM as well. Just that I do not need to google out the
sysctlcommands every time, here's the workaround:# sysctl fs.inotify fs.inotify.max_queued_events = 16384 fs.inotify.max_user_instances = 128 fs.inotify.max_user_watches = 8192 # sysctl fs.inotify.max_user_watches=16384My environment: Software Version(s) Parcel 2.0.0-nightly.314+cc5b4862 Node v14.15.4 npm/Yarn yarn 1.22.5 Operating System Debian Buster
this workaround works for me.
My environment: Software Version(s) Parcel 2.0.0-nightly.314+cc5b4862 Node v14.15.4 npm/Yarn npm 7.7.6 Operating System Zorin OS 15.3
This worked for me
This comment solved my problem:
https://github.com/google/cadvisor/issues/1581#issuecomment-367616070
sysctl fs.inotify.max_user_watches=16384
I am experiencing this problem ATM as well. Just that I do not need to google out the
sysctlcommands every time, here's the workaround:# sysctl fs.inotify fs.inotify.max_queued_events = 16384 fs.inotify.max_user_instances = 128 fs.inotify.max_user_watches = 8192 # sysctl fs.inotify.max_user_watches=16384My environment:
Software Version(s) Parcel 2.0.0-nightly.314+cc5b4862 Node v14.15.4 npm/Yarn yarn 1.22.5 Operating System Debian Buster
this saved me
This is a bit unsettling, the workaround works in my case but I have to set up the max_user_watches to 262144 to work.
After digging in the code the options.projectRoot seems to be a path in my home directory (there are at least 4 levels before getting to the folder I am interested.) Why is parcel going that far up to just serve?
Parcel looks for the first directory that contains .git, yarn.lock or package-lock.json relative to the entry points. It should definitely not be your home directory.
I invite you to try this:
touch ~/package-lock.json
and try to print the projectRoot (I put a line in resolveOptions.js) in my case it turns out to be the home directory. I dont have a .git yet in my project, but there is another folder in the middle with a package-lock.json and another with a .git
Parcel is picking the highest (oldest?) parent directory with one of the .git .hg, yarn.lock, ... files. Even if that file is in the root / (try the same with sudo touch /package-lock.json) [addendum: This is not correct, but parcel skips directories like .git and .hg and can potentially reach the root / if called without parameters]
I found I left a package-lock.json in an intermediate folder that shouldn't be there, after removing it I can use parcel normally, but this seems to be watching for a potentially full home directory of all parcel users.
Hi, I am honestly not sure where the error is, but there are several strange things happening.
I assume the function getRootDir is meant to be called with a list of files without including any directories in that list. I added the source to package.json expecting to run only npx parcel to serve them at development time, in that case the function getRootDir gets a list where its single element is the current working directory. The parsing on path.parse remove the name and starts the search of a package-lock.json on its parent which it does not have any, and it goes upwards.
The other problem goes down to the search of mixed directories and files using the same function findAncesorFile that detects only files, hence the directories .git and .hg are not detected, thats' how parcel end up searching on my full home directory.
This happened to me when I moved the package.json up one directory. parcel always watches all files in the project directory, which in my case includes a huge vendor-directory with tens of thousands of files (this is a symfony application).
The easiest solution would be if we could just tell parel to only watch certain directories. Is this currently possible?
The easiest solution would be if we could just tell parel to only watch certain directories.
This would be a huge help for me too, people not debugging their dependencies don't need it watched for changes. And stuff like npm install can be catched by watching e.g. the package-lock.json
My current workaround is using nodemon to watch for changes and run a production build while my IDE reloads the page for me which works nice but is far from ideal (+ does not allow me to leverage parcels development features to the fullest).
An idea:
A CLI option like --watch ./src/ --watch ./*.json would be nice I think, allowing for multiple patters to be provided (directories should automatically be watched recursively) or in the opposite direction if preferred as --ignore ./node_modules/ --ignore ./vendor/
I have experienced this same problem on windows 10 whit parcel 2, I really don't know how to solve it I have colleagues who use this operating system.
In ubuntu that code line solve my problem.
sudo sysctl fs.inotify.max_user_watches=99999
Your system is littered with a lot of files, it is possible to reach this limit before exhausting the storage capacity of the drive.
Check your inodes
sudo df -i
See the % the inodes occupy and remove/restart some of them to clear up some space
@devongovett Can't there be a way to just select directories to be excluded from watch?
It's watching my enormous node_modules and it's totally unnecessary in my situation. An option to exclude dirs from watch would suffice.