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

"No space left on device" when running dev server #5261

Open
ranisalt opened this issue Oct 20, 2020 · 17 comments
Open

"No space left on device" when running dev server #5261

ranisalt opened this issue Oct 20, 2020 · 17 comments

Comments

@ranisalt
Copy link
Contributor

🐛 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.

@mischnic
Copy link
Member

Changes between those these releases: 288396a...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?

@ranisalt
Copy link
Contributor Author

@mischnic I did not have time to bisect the changes, but I know nightly.475 and 476 have been working.

@mareq
Copy link

mareq commented Mar 27, 2021

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

@jessabyrne
Copy link

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

@drachehavoc
Copy link

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

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

@akhildevelops
Copy link

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

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

@Megidd
Copy link

Megidd commented Jul 1, 2021

This comment solved my problem:

google/cadvisor#1581 (comment)

@soyab-mostofa
Copy link

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 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

this saved me

@jorgeecardona
Copy link

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?

@mischnic
Copy link
Member

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.

@jorgeecardona
Copy link

jorgeecardona commented Oct 27, 2021

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.

@jorgeecardona
Copy link

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.

@thgross
Copy link

thgross commented Nov 5, 2021

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?

@SpraxDev
Copy link

SpraxDev commented Dec 29, 2021

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/

@horaciorivero
Copy link

horaciorivero commented Nov 8, 2022

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

@ovicko
Copy link

ovicko commented Jul 13, 2023

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

@SrBrahma
Copy link

@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.

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

No branches or pull requests