Edit #2 tldr: Dropbox on Ubuntu works fine on fresh install, but quickly decides every file is "unwatched" and refuses to sync anything.
-----------
Hey folks —
I have Dropbox v100.4.409 installed on an Ubuntu 18.04 machine (64-bit). My dropbox folder is on an external 2TB Seagate hard drive (Ext4).
The problem is simple: I turn open Dropbox and the status remains "Syncing..." indefinitely. It fails to upload/download new documents. It does, however, immediately start using a huge amount of CPU power (110%, according top).
I had this issue a couple days ago. I restarted dropbox, restarted my computer, unlinked & relinked... Eventually, I fixed it by completely uninstalling dropbox (including deleting the hidden data folders) and re-installing. [I didn't delete my local files because I don't want to re-download 300 GB of files. I did the little switcheroo thing where you rename your original Dropbox folder "Dropbox B", let Dropbox create a new folder, then rename again.] It took a few hours for Dropbox to index all the files, but then it finished up, everything looked good with little check marks etc., I thought i was in the clear.
I came back today to do some file management, and the problem is back. I haven't changed anything on Dropbox in the past two days, so I am assuming that some file/folder is causing the issue. I've seen people have similar problems when they have a large number of files, but I'm around 60k, well below the 300k limit, and also I haven't been moving things around. One post mentions problems when your file structure is more than five levels deep, but I've been using Dropbox on fathoms-deep file structures for years without a problem. Other posts mention that when they re-link their account, they're able to identify the specific file that's causing trouble, but when I re-installed earlier everything just looked fine.
Anyway: What else should I do to try and identify the problematic file/folder, or is there some other Dropbox syncing limitation that I might be running into?
Edit: Using @Здравко's answer from here (plus further info from github and StackOverflow resources), I have identified a possible issue. The command
i=0; IFS=$'\n'; for a in `ls -R1 /path/to/Dropbox`; do ((++i)); done; echo $i
spits out 70916 — i.e. all of my Dropbox files I guess. (And if I run dropbox from the command line, I get the same "Unable to monitor entire Dropbox folder hierarchy" error reported in the StackOverflow post.) However, I've set inotify's max_user_watches and max_queued_events both to 100000, to no avail!
Edit #2: I have tried two new things. I checked on filename length, since the Dropbox help pages indicate that they are capped at 255 characters. Using the command
find -exec basename '{}' ';' | egrep '^.{150,}$'I found four files with more than 150 chars, but none with more than 200 chars.
Secondly... While I was having the syncing issue, the command (pulled from Здравко's post)
(IFS=$'\n';for i in `ls -R1 /path/to/Dropbox`; do if [[ "$i" =~ ":" ]]; then cd `echo "$i" | sed "y/:/\//"`; echo -n "In folder: "; pwd; dropbox filestatus; fi; done) | grep -vi "up to date" | grep -vi ".dropbox:" | grep -vi ".dropbox.cache:"
indicated that every single file in my Dropbox folder was unwatched. I uninstalled/re-installed Dropbox again. It indexed my files, indicated that all was good! I was able to add a new file and have it sync. I re-checked for unwatched files, it indicated a number of .DS_Store, a couple of badly formed names, but nothing particularly unusual. However, clicking around between folders in Nautilus seemed to break it again. It didn't indicate that there was a problem, but the checkmarks all went away and adding a new file didn't generate any syncing response. Closed Dropbox, re-opened, and the same problem was back, all files are being watched, nothing is syncing. <angry face>