39

I'm having a rather strange problem with Dropbox that started a few weeks ago.

Dropbox will stop syncing with the message "Can't access Dropbox folder", and refuse to sync until I reboot.

I've tried restarting Dropbox and logging out, but nothing I seem to do will allow it to sync again short of a reboot.

This is not a permissions problem, as the permissions don't change when I suddenly lose access.

I've checked lsof for anything related to dropbox that might still be hanging on when I stop it. As far as I can tell nothing else other than Dropbox is accessing it's folders when this happens.

Jorge Castro
  • 70,934
  • 124
  • 466
  • 653
  • I believe there was a recent kernel update that fixed it for good. bugs.launchpad.net/ubuntu/+source/linux/+bug/1101666 –  Feb 08 '13 at 18:33

4 Answers4

56

if you put these in /etc/sysctl.conf:

fs.inotify.max_user_watches = 1048576
fs.inotify.max_user_instances = 256

it will fix the issue. You may have to run sudo sysctl -p for these settings to take effect.

Alternatively, if you are not interested in making these settings permanent, you may try the following commands...

sudo sysctl fs.inotify.max_user_instances=256
sudo sysctl fs.inotify.max_user_watches=1048576

In this case the settings will be lost after a reboot.

The problem is that the system has run out of inotify instances. You can check your syslog (e.g. by using tail -f /var/log/syslog) and if you see...

tail: inotify cannot be used, reverting to polling: Too many open file

then you know this is your issue. For me it was nepomuk.

Autodidact
  • 418
  • 4
  • 10
user95987
  • 601
  • 5
  • 2
  • Interesting. I'm seeing dovecot complaining: lister dovecot: imap(craig): Warning: Inotify instance limit for user 1000 (UID craig) exceeded, disabling. Increase /proc/sys/fs/inotify/max_user_instances. Will add and see if that makes the problem disappear. Thank you! –  Jan 27 '13 at 01:11
  • 1
    Going to accept this answer for now, as it makes the most sense. Will check back if I run into it again. Thank you! –  Jan 27 '13 at 01:23
  • I had the exact same problem on a brand new installation of Ubuntu 12.10 with default settings. Increasing max_user_instances as described here solved the problem. – Holger Jan 27 '13 at 20:29
  • 4
    For Ubuntu, `sudo echo 256 > /proc/sys/fs/inotify/max_user_instances` gives a permission denied error. `sudo sysctl fs.inotify.max_user_instances=256` should be used instead. – törzsmókus Jan 27 '13 at 21:41
  • I can confirm that this fixes the problem for me (Ubuntu 12.04) – Raja Selvaraj Jan 28 '13 at 01:00
  • Ubuntu 12.10 here. Fixed the problem for me as well! – Lagerbaer Jan 29 '13 at 22:11
  • Just wanted to confirm that this fix worked for Ubuntu 16.04. I had no issues up until yesterday with Dropbox and even went as far as changing my password to see if that would work and it did not. I applied this fix and now it's syncing everything that wasn't from before. – Hatem Jaber Feb 22 '17 at 14:33
  • You need to run `sudo sysctl -p` for the changes to take effect. – Jim Balter Apr 18 '18 at 07:26
  • This fix seems to still work on Ubuntu 18.04 – Russell Richie Jul 20 '18 at 21:04
  • I can confirm that this fixed the error. – Lucius Hu Feb 20 '19 at 19:30
1

The fs.inotify.max_user_instances=256 fixed my immediate "Can't access dropbox folder" problem (Ubuntu 12.04).

It also cleared up an odd behavior I'd noticed, where the dropbox systray icon continually indicated file activity: The arrow circles cycling continually, though nothing was changing in my dropbox, and the "recently changed files" list remained unchanged.

A few moments after I changed fs.inotify.max_user_instances=256, the pointless cycling stopped.

Frank M
  • 306
  • 2
  • 8
-1

In one of the forums, someone mentioned it is due to inotify. They have this solution/workaround.

  • disable desktop search (in kde nepomuk+tracker, in gnome tracker)
  • reboot (logout didn't help)
fossfreedom
  • 171,546
  • 47
  • 376
  • 404
TuEk
  • 1
  • 1
  • I'm not running tracker as far as I know. Is there a particular process I should be looking for? –  Jan 26 '13 at 16:01
-1

This usually happens because sysctrl has run out of inotify instances. The following 2 commands will normally fix the issue.

sudo sysctl fs.inotify.max_user_watches=1048576
sudo sysctl fs.inotify.max_user_instances=256
Silas Palmer
  • 109
  • 2
  • 2
    Welcome to ask ubuntu could you elaborate on your answer a little more please so folk know what you are doing here – damien Sep 22 '13 at 00:00