Permanent fix to tail: cannot watch `log/development.log': No space left on device
Asked Answered
M

2

13

I've been using Ubuntu 11.10 for a little over a week now. But after some time I encountered this error(the one in the title) when Im trying to access the log in my RoR project. I found a fix which is by pasting this in the terminal:

sudo sysctl -w fs.inotify.max_user_watches=16384

The problem is I have to do this again and again everyday. Does anyone know how I can execute this at startup? Or does anyone know any permanent solution? thanks much!!!

Murdocca answered 29/3, 2012 at 23:51 Comment(5)
I'd investigate what else is using so many watches that tail can't get one.Consubstantiate
@ninjalj> sorry im a linux newb, how do i add the code there? just cpy and paste?Murdocca
Seriously, the real problem isn't that the sysctl trick is temporary, it's that you need it in the first place. This shouldn't be happening. Something on your system is using a lot of inotify watches, which may be a sign of a resource leak somewhere.Consubstantiate
A related question from the Unix/Linux QA: unix.stackexchange.com/q/13751Midtown
@Wyzard: a resource leak? damn, this is a fresh install of ubuntu 11.10, thanks for the link...Murdocca
H
13

I started having this problem with tailing. I think it is because I am also running dropbox on this machine.

My fix is what dropbox suggests:

 echo 900000 | sudo tee /proc/sys/fs/inotify/max_user_watches
Herta answered 11/7, 2012 at 15:1 Comment(2)
this might not be preserved on restart. The @Murdocca solution however works between restarts as well.Intermeddle
This happens me to me with Symfony in PHP: symfony server:start WARNING Web Server log file cannot be tailed: unable to watch log file: no space left on device no space left on device Your command resolve this issue tooLeger
M
9

My issue was fixed. Thanks for everyone who helped!

I placed "fs.inotify.max_user_watches=16384" in /etc/sysctl.conf

Murdocca answered 30/3, 2012 at 10:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.