We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
holf
5 years agoHelpful | Level 6
Syncing is stuck on my Linux devices, what can I do?
It seems I have the same problem as mentioned in above posts. I am running Dropbox on a pc and laptop, both having Linux-Lubuntu as the os. After a "one time update" on both systems, Dropbox is stuck...
- 5 years ago
Hi holf,
At the beginning you can try fix possible permission errors:
sudo chown -R "$USER" "$HOME/Dropbox" sudo chattr -R -i "$HOME/Dropbox" chmod -R u+rw ~/Dropbox
Also, existing symbolic links could be found using:
ls -alR ~/Dropbox | grep " -> "
If no any change, check the needs for watchable entries:
i=0; IFS=$'\n'; for a in `ls -R1 ~/Dropbox`; do ((++i)); done; echo $i
The above will give you some estimation. The current upper border could be received using:
sysctl fs.inotify.max_user_watches
If the estimation above don't fit in last result, try extend the border using something like:
sudo sysctl -w fs.inotify.max_user_watches=100000
Tune the value according your needs (with some reserve, of course).
If nothing helps yet, try to find out the exact files making troubles (which will give you chance investigate further), using something like:
(IFS=$'\n';for i in `ls -R1 ~/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:"
Last command assume you have installed properly 'dropbox' command, either using debian package or by hand. Otherwise "command not found" will be signaled. Will be enumerated all folders in Dropbox and signaled problematic files inside, if any. Be patient, could take some time, depending on your content size. Once found out problematic entries, you can use different techniques for investigate, like see current file's classic attributes (the simplest one):
ls -l ~/Dropbox/Troublesome/file.ext
Good luck. :wink:
holf
Helpful | Level 6
Thank you. I will try out your suggestions and have a look at the other thread.
Здравко
5 years agoLegendary | Level 20
Hi holf,
At the beginning you can try fix possible permission errors:
sudo chown -R "$USER" "$HOME/Dropbox" sudo chattr -R -i "$HOME/Dropbox" chmod -R u+rw ~/Dropbox
Also, existing symbolic links could be found using:
ls -alR ~/Dropbox | grep " -> "
If no any change, check the needs for watchable entries:
i=0; IFS=$'\n'; for a in `ls -R1 ~/Dropbox`; do ((++i)); done; echo $i
The above will give you some estimation. The current upper border could be received using:
sysctl fs.inotify.max_user_watches
If the estimation above don't fit in last result, try extend the border using something like:
sudo sysctl -w fs.inotify.max_user_watches=100000
Tune the value according your needs (with some reserve, of course).
If nothing helps yet, try to find out the exact files making troubles (which will give you chance investigate further), using something like:
(IFS=$'\n';for i in `ls -R1 ~/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:"
Last command assume you have installed properly 'dropbox' command, either using debian package or by hand. Otherwise "command not found" will be signaled. Will be enumerated all folders in Dropbox and signaled problematic files inside, if any. Be patient, could take some time, depending on your content size. Once found out problematic entries, you can use different techniques for investigate, like see current file's classic attributes (the simplest one):
ls -l ~/Dropbox/Troublesome/file.ext
Good luck. :wink:
- draylson5 years agoHelpful | Level 5Hi,I was having a similar problem and the Здравко's solutions worked temporarily for me. When I restarted my computer the problem started again.While I was waiting for a proper solution by Dropbox support, I've been studying the Здравко's solutions and I found out the command below is the one which worked temporarily:sudo sysctl -w fs.inotify.max_user_watches=100000Then, I found out more information about this fs.inotify.max_user_watches property at the following address:According to the instructions in the page, the above command, in fact, sets the property temporarily. In order to get it permanently, the commands would be:
sudo sysctl fs.inotify.max_user_watches=100000
sudo sysctl -pI tried them and Dropbox is working fine on my computer until now. Even if I restarted it.In summary, the problem is solved, but I'm really curious to know what exactly is this property and why Dropbox was not working fine until I set it with a higher number. Could someone explain to me?Anyway, thank you very much for all attention and assistance.Kind regards,Draylson- ipejasinovic5 years agoNew member | Level 2
I've suffered same issue, when I upgraded my Ubuntu to latest version few days ago. Changing max_user_watches solved problem. Thanks guys.
- profkruse5 years agoNew member | Level 2
Same here - the max_user_watches setting on my Linux Mint was 8192 "out of the box", I have 128k files on Dropbox - a bit of a mismatch. Set it to 250,000 for now and Dropbox resumed syncing.
- donvercety4 years agoNew member | Level 2
Hello did have the same problem.
Than I ran manually the dropbox daemon "dropboxd" located at "/.dropbox-dist" and saw that error: "Unable to monitor entire Dropbox folder hierarchy. Please run "echo fs.inotify.max_user_watches=100000 | sudo tee -a /etc/sysctl.conf; sudo sysctl -p" and restart Dropbox to fix the problem."
Just run the command and all works fwallesly!
P.S. it loud be great to show this error on the GUI side of the dropbox program, some users don't use the terminal.
- holf5 years agoHelpful | Level 6
Hi Здравко
I've gone through your suggestions one by one and the one where a list of troublesome folders/files is generated eventually allowed me to solve the problem.I have a folder in which I keep setup files of some specific programs (e.g., windows programs for communication with dataloggers; I run these in virtualbox) in case I need to reinstall the operating system. That folder was marked as "unsyncable" and removing it from Dropbox solved the problem. It has always been in Dropbox without a problem, but apparantly became "unsyncable" after the recent update.I will try to find out which files are causing the problems.Thank you very much for your help. - MartinHeroux5 years agoNew member | Level 2
I tried the second step looking for symbolic links
ls -alR ~/Dropbox | grep " -> "
And inded there were several symbolic links.
In fact, when I tried to run
sudo chattr -R -i "$HOME/Dropbox"
this is why I got a bunch of errors like this:
chattr: Operation not supported while reading flags on [...]
Does this mean I need to somehow remove these symbolic links in order to get my Dropbox synching unstuck on my Linux machine?
If so, how does one do this, and how do I do it without breaking stuff?
For a bit of context, most of my symbolic links are associated with Python env. For example:
$ ls -alR ~/Dropbox | grep " -> " lrwxrwxrwx 1 martin martin 3 Oct 27 14:48 lib64 -> lib lrwxrwxrwx 1 martin martin 9 Oct 27 14:48 python -> python3.8 lrwxrwxrwx 1 martin martin 9 Oct 27 14:48 python3 -> python3.8
Any assistance with this would be appreciated.
- Здравко5 years agoLegendary | Level 20
MartinHeroux wrote:...
this is why I got a bunch of errors like this:
chattr: Operation not supported while reading flags on [...]
Does this mean I need to somehow remove these symbolic links in order to get my Dropbox synching unstuck on my Linux machine?
...Hi MartinHeroux,
Not actually. If the other 2 line in same code block are working without errors, no problem:
sudo chown -R "$USER" "$HOME/Dropbox" chmod -R u+rw ~/Dropbox
It's important no any link points to a place outside Dropbox folder, which seems covered by your examples (have to be for all).
What about possible unwatched entries? Did you check that? Alternatively you can use something like:
db_path=`jq -r '.personal.path' ~/.dropbox/info.json`; echo -n "Your Dropbox folder $db_path entries approximate count is "; tree -a "$db_path" | wc -l; sysctl fs.inotify.max_user_watches
What's the result? 🤔 The actual entries count should fits in the border (maximum)!
If need, give some time to the entries not in sync yet. Is there some 'move' in result of:
dropbox status
🤔
And finally, is there some "deviation" in the result of:
(IFS=$'\n';for i in `ls -R1 $(jq -r '.personal.path' ~/.dropbox/info.json)`; 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:"
🤔
- MartinHeroux5 years agoNew member | Level 2
Dear Здравко,
Thank you for the quick reply and for helping us linux folks with Dropbox issues.
I went over your previous instructions:
If no any change, check the needs for watchable entries:
i=0; IFS=$'\n'; for a in `ls -R1 ~/Dropbox`; do ((++i)); done; echo $i
The above will give you some estimation. The current upper border could be received using:
sysctl fs.inotify.max_user_watches
If the estimation above don't fit in last result, try extend the border using something like:
sudo sysctl -w fs.inotify.max_user_watches=100000
I mis-read what was the estimate and what was the upper border.
I did indead have an issue here. I changed the max_user_watches and upon a restart my Dropbox synched everything!
Thank you for the various things to try, and for providing me with what in the end solved my issues.
Incidently, some of the symbolic links do point outside of dropbox, but that does not seem to be a problem as everything synched fine after I fixed the max_user_watces limit.
- tayloredwebsites2 years agoNew member | Level 2
I found the sudo chattr -R -i "$HOME/Dropbox" command very enlightening, as it listed two files as "Operation not supported while reading flags on ..."
When looking at these two files on the dropbox website, I got error 415 on both of them, with an indication that someone will look at them.
So I will wait and see what happens.
Thanks for the instructions
- jpaschoal5 years agoNew member | Level 2
OMG you are a legend, in my case what solved was raising that "max_user_watches" limit.
I also managed to make it persistent using draylson's instructions.I was struggling with this problem for ages, thank you very much!
- rwalker15015 years agoExplorer | Level 3
Hi, thank you so much for the very clear, systematic answer. It was a life-saver!
I went through your suggestions in order until I found the solution. In my case it was the number of watched files that was wrong - I had a max limit of 8000, when I needed 250000. The horrible side-effect was that random changes on my disk (even outside the dropbox folder) caused (or sometimes caused) dropbox to go into the forever sync loop. Upping the limit on watched files resolved the problem.
A suggestion: your recipe was perfect - but it required your expert knowledge. Most of us could never have worked it out for ourselves. It would be wonderful if you could write a short description of the way Dropbox interacts with Linux and the linux file system (files locations, permissions needed, reasons why particular parameter settings affect performance). That way we could form our own mental model of the system and avoid some of the frustration.
A hint for dropbox technical support: a lot of user problems are not due to Dropbox technology (which many of us love) but to lack of clear documentation. Note: we don't just want recipes to resolve problems. We want explanations and diagrams so we can understand the root cause of the difficulties we are experiencing. - Mace684 years agoExplorer | Level 4
i=0; IFS=$'\n'; for a in `ls -R1 ~/Dropbox`; do ((++i)); done; echo $i
This gave me a value of 36784
sysctl fs.inotify.max_user_watches
This value was set to 8192. Way too low looking at the value needed above.
sudo sysctl -w fs.inotify.max_user_watches=100000
Setting it to 100000 allowed my Dropbox to successfully start syncing immediately when i restarted it.
Thanks very much for this solution!
- DokterChaos4 years agoExplorer | Level 4
For years I've been trying to get this to work on Debian. Maybe at some point the dropbox headless deamon worked on Debian, now not anymore. I've connected an account with only 1500 files and 2GB of data. On Debian I can copy new files to the Dropbox folder and they will sync, but Dropbox will not download new files that are added to the account.
Permissions are correct. Maximum watched files is at 8000. I've spent too much time trying to install the dropbox daemon as a system service, hoping I could get it to write to the syslog. I simply can't get it working on Debian.
This guide just gives me a dead service:https://www.jamescoyle.net/how-to/1147-setup-headless-dropbox-sync-client
This guide gets me stuck on the fact Debian doesn't have "/etc/rc.d/init.d/functions", and also there is no "/etc/sysconfig" folder.
https://www.techrepublic.com/article/how-to-install-and-run-dropbox-from-a-headless-linux-server/
(IFS=$'\n';for i in `ls -R1 ~/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:"
this won't run because "dropbox" isn't a valid command on my Debian install.
Здравко wrote:Hi holf,
At the beginning you can try fix possible permission errors:
sudo chown -R "$USER" "$HOME/Dropbox" sudo chattr -R -i "$HOME/Dropbox" chmod -R u+rw ~/Dropbox
Also, existing symbolic links could be found using:
ls -alR ~/Dropbox | grep " -> "
If no any change, check the needs for watchable entries:
i=0; IFS=$'\n'; for a in `ls -R1 ~/Dropbox`; do ((++i)); done; echo $i
The above will give you some estimation. The current upper border could be received using:
sysctl fs.inotify.max_user_watches
If the estimation above don't fit in last result, try extend the border using something like:
sudo sysctl -w fs.inotify.max_user_watches=100000
Tune the value according your needs (with some reserve, of course).
If nothing helps yet, try to find out the exact files making troubles (which will give you chance investigate further), using something like:
(IFS=$'\n';for i in `ls -R1 ~/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:"
Last command assume you have installed properly 'dropbox' command, either using debian package or by hand. Otherwise "command not found" will be signaled. Will be enumerated all folders in Dropbox and signaled problematic files inside, if any. Be patient, could take some time, depending on your content size. Once found out problematic entries, you can use different techniques for investigate, like see current file's classic attributes (the simplest one):
ls -l ~/Dropbox/Troublesome/file.ext
Good luck.
- Здравко4 years agoLegendary | Level 20
DokterChaos wrote:...
(IFS=$'\n';for i in `ls -R1 ~/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:"
this won't run because "dropbox" isn't a valid command on my Debian install.
...
Hi DokterChaos,
🙂 If particular command isn't installed using appropriate package, ... it's just not a valid command (of course). Only restricted set of command are embedded in the used shell (they vary according selected shell), all other command have to be installed (some command are preinstalled of course). Dropbox isn't preinstalled, that's why you have to install it using appropriate package or by hand (put the control script named "dropbox" in an appropriate place - take a look on your PATH variable). Then, the command would get valid. 😉 That's it.
By the way, there are many different ways you can use to install Dropbox application as a service, but you should be careful. This is NOT officially supported yet! I don't know what exactly you are doing, but you should place the daemon in the same condition like in usual user context, otherwise only troubles could be expected. There are many right and many wrong ways, just be careful.
Hope this sheds some light on the matter.
- barefootcoder4 years agoExplorer | Level 3
In case this might be helpful for others searching like I was:
I modified Здравко's most recent command to look like so:
find ~/Dropbox/ -name .dropbox -prune -o -name .dropbox.cache -prune -o -type d -print0 | xargs -0 -l dropbox filestatus | egrep -v 'up to date|syncing'
This has the following advantages:
* doesn't barf on directories with spaces
* doesn't barf on files with colons
* works on other shells besides bash
To be fair, it also has the following disadvantages:
* doesn't list directories that don't have any "interesting" files
* which also means it will go for long periods without outputting anything at all
* doesn't sort the directories
This can provide some really interesting info, so thank you @Здравко for providing it.
For those looking for quick solutions and who thought to look at the last post, the tip for increasing `fs.inotify.max_user_watches` is really the most likely solution. The suggestion of 100,000 is good, but figure out how many files you actually have:
find ~/Dropbox/ -name .dropbox -prune -o -name .dropbox.cache -prune -o -print | wc -l
and make sure when you edit `/etc/sysctl.conf` (to add or increase it) that the number you put is bigger than what you get out of that `find`. If you're worried about making it too big, I did find one reference that suggested that Dropbox will use about 1k for every file it has to monitor (i.e. the number from the `find` just above). I've set mine to 500,000, which would use about 0.5Gb of RAM if this source is correct. My total Dropbox process is taking up about 5.4Gb, but this is a pretty beefy machine and it can tolerate that quite easily, so make sure you take your machine's total RAM into consideration.
- antonio_petricca3 years agoNew member | Level 2
The following instructions word for me:
sudo chown -R "$USER" "$HOME/Dropbox" chmod -R u+rw ~/Dropbox
- Jaidan B.3 years agoHelpful | Level 5
Hey fellow Dropboxers!
I've been a happy customer for as long as I can remember. Lately though, I've struck troubles with Linux getting stuck syncing. Here's what I've done so far. If anyone could please lend a hand, it would be much appreciated.
Ubuntu 18.04:
- Approx 19 files "Syncing" but no indication of speed or time.
- Rebooted
- Changed permissions recursively using the post from "Hello" earlier in the thread.
- Changed the file watch count (I had ~220,000 files in Dropbox and changed the watch file setting to 300.000)
- Checked for symbolic links, there are none
- Removed Dropbox using the offical instructions
- Contacted help desk to install the latest version and followed their instructions.
- Tried everything at this post
- Deleted entire Dropbox program and Dropbox files (to stat from scratch).
- Installed dropbox using install instructions on website and built from source. This took 2 days to arrive back at "Downloading 219 files"
- Double checked all items at this post
- Deleted dropbox
- Deleted all Dropbox files (yes all 200,000 of them again)
- Deleted operating system
- Installed a fresh Ubuntu 18.04
- Installed Dropbox
- Changed file watch value to 400,000
- Started first dropbox sync
- Waited two days to arrive at "Downloading 83 files"
- Followed all instructions at this post again
- Looked for every type of illegal character according to here
- Changed those illegal characters that I could through the web interface. Changed the rest of these bad characters from my computer (and the Dropbox website reflected the changes)
- Reduced long filenames as much as possible, but from a script I ran, my longest was 165 characters (inc path and filename)
- Removed all the files that MacOS made with `._` at the front (11,000ish).
- Attempted to use `dropbox filestatus` but it shows some directories as `syncing` but the files inside that directory are `up-to-date`.
- Attempted to search for illegal characters through the Dropbox search feature as the Dropbox support line suggested however I get "no results" for every combination I can think of.
- I don't have Windows or Mac computer with enough storage to attempt a new sync with that.
- I've tried starting Dropbox with `sudo` also and no change.
Can anyone please provide some guidance as to what to do next? I'm over a week into sussing this out and I've run out of ideas.
- Здравко3 years agoLegendary | Level 20
Hi Jaidan B.,
You did really hard troubleshooting work! That's truly strange. 🤔 After OS from scratch install and application install from scratch too (including without data),... nothing should be able stop the initial syncing at lest.
The only part of your troubleshooting you can pay a little more attention is:
Jaidan B. wrote:...
Attempted to use `dropbox filestatus` but it shows some directories as `syncing` but the files inside that directory are `up-to-date`.
...
Here 'syncing' directories means something inside has not completed yet or hasn't started at all! All files in that directory 'up to date' means existing files are ok, but may be others aren't there yet. Did you check content matching of one such directory locally (on the disk) and remotely (on the cloud; using web browser)? 🧐 Is there some difference?
Once you know such details, you would be able direct your attention further in correct direction. What is the result of just stop and start the daemon anew? In sequence run "dropbox stop; dropbox start". Does the sync process make some steps further?
Good luck!
- silvacarl2 years agoExplorer | Level 4
I have tried everything i can find anywhere to get dropbox working correctly on Ubuntu 20.04.
I even flushed a machine and rebuilt it. Same problem.
I am using to to synch between my dev machine and a hosted Ubuntu 20.04.
Up until last week, it had no problems whatsoever.
Now, it goes into "Indeexing" and never finishes, ever.
Any ideas?
- barefootcoder2 years agoExplorer | Level 3
My personal solution was to cancel my Dropbox account and buy a Synology NAS. I've never been happier. Synology support actually helps you with problems, as opposed to just closing the ticket without doing anything. Highly recommended.
- Jaidan B.2 years agoHelpful | Level 5After having similar issues, my end result was use my Dropbox subscription money to buy an extra hard disk and install OMV on my server. I haven’t been happier.
About View, download, and export
Need support with viewing, downloading, and exporting files and folders from your Dropbox account? Find help from the Dropbox Community.
Need more support
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!