Forum Discussion
ChristineStack
Jul 28, 2017Steel Contributor
Deleted files/folders reappear as they are synced back online from client OneDrive
We are heading towards the end of a big push to get all files in OneDrive or SharePoint. The Finance department (VIPs) are getting very frustrated with deleted files/folders reappearing as they are ...
Rob Nicholson
Dec 12, 2018Brass Contributor
OneDrive still continues to annoy me. I've just been commissioning four new laptops so I've logged on with my Office 365 account which has a copy of Office 2016 for installation. I noticed some folders deleted ages ago had re-appeared. Specifically the "Monthly" folder here: https://i.imgur.com/ndUl4XE.png
So I hit delete on the folder. It disappears from a second but then re-appears! I got a snapshot of it missing: https://i.imgur.com/4RzaOHc.png
But a few seconds it re-appears: https://i.imgur.com/rvyRy86.png
Same thing happens if I delete the "Monthly" folder on the web. It simply comes straight back.
Having battled with OneDrive on 50+ systems now, I really do have a pretty low opinion of the fundamental algorithms used. Log onto an old computer where you haven't synchronised for a while (like a few weeks maybe months) and that computer assumes it's the master version and restores files that you have deleted since. This has caused a BIG problem by restoring a script that I had deleted from one part of my command path, OneDrive restored the old version and I accidentally ended up running it.
Seriously broken IMO....
So I hit delete on the folder. It disappears from a second but then re-appears! I got a snapshot of it missing: https://i.imgur.com/4RzaOHc.png
But a few seconds it re-appears: https://i.imgur.com/rvyRy86.png
Same thing happens if I delete the "Monthly" folder on the web. It simply comes straight back.
Having battled with OneDrive on 50+ systems now, I really do have a pretty low opinion of the fundamental algorithms used. Log onto an old computer where you haven't synchronised for a while (like a few weeks maybe months) and that computer assumes it's the master version and restores files that you have deleted since. This has caused a BIG problem by restoring a script that I had deleted from one part of my command path, OneDrive restored the old version and I accidentally ended up running it.
Seriously broken IMO....
Rob Nicholson
Dec 12, 2018Brass Contributor
Ahh, I might have found this specific problem. OneDrive is synchronised in a VM and on my main PC. I was deleting it from the main PC so I tried to delete from my PC and for some reason there is access denied on one of the folders deep inside "Monthly". So what's happening is that OneDrive on my PC probably tries to delete the folder but fails due to this access denied and therefore restores it back. Big question, why access denied??? I'll reboot and have a look.
- Arvi10Dec 12, 2018Copper Contributor
Hi Rob Nicholson - Can you explain a bit more on the root cause ? I was only temporarily able to solve this issue.
- Rob NicholsonDec 12, 2018Brass Contributor
Hi Arvi10 - my reply above showing guessing how Dropbox or Google Drive handles deletions may give a hint of the root cause but I can confirm without a shadow of a doubt that the following happens on OneDrive:
1. Logon to a computer where you had OneDrive synchronised but haven't logged onto for a while - say a few months
2. OneDrive will restore deleted folders and files back to the last time you logged on
Fortunately, thank goodness, it doesn't overwrite edited versions or delete anything. You do get the horrible "My file - LAPTOP046.ps1" cropping up where I assume it thinks it's got the latest version (it never has!) but there is a file there with a newer timestamp so it renames its (old) copy with the suffix and restores that. The creation of these files is usually my trigger to go into OneDrive and restore it back in time - a feature designed to Wannacry attacks but used because of this bug.
I suspect, but a lot of guessing, that this is because OneDrive doesn't keep a transaction log kind of structure along side the actual folders and files. Therefore when you logon to an old computer, it has no idea that "Monthly" was deleted on another system many days later and merrily brings it back.
Hence my observation that this is a fundamental flaw in the synchronisation algorithm used by OneDrive which Dropbox and Google Drive don't suffer from. They have a transaction log which they can refer to resolve issues like this.
So the Microsoft programmers need to go back to the drawing board IMO... wearing my developer hat. I am flabbergasted that OneDrive has this fundamental flaw and they intend you to use it for business! Thank goodness that my clients only tend to logon to one computer at once!- Rob NicholsonDec 12, 2018Brass ContributorPS. The magically re-appearing folders just now when I tried to delete those incorrectly restored folders was due to some flaw in OneDrive on my PC and access permissions. Why it got into that state (access denied), I have no idea. But OneDrive has other flaws. For example, if you share out a folder to another user with read-only access (which I do with a set of PowerShell scripts), there have been examples whereby the sync engine thinks it's got a later version of the file and incorrectly creates a "New-User - LAPTOP034.ps1" version in the read-only folder. The problem is that because the folder is shared read-only, it is unable to upload it (too right) but then gets a red cross. And WORSE - because the file has been created in a read-only share, the permissions on that folder are set to DENY and are very difficult to get rid of. Fortunately, 7-ZIP manager when run in admin mode is very good at deleting stuff with bad security settings.
So this bug goes something like this:
BEGIN
OneDrive thinks, for reasons unknown, that it has a locally modified copy of a file in a read-only share. Obviously this can't happen as the folder is read-only with deny access! I suspect it happens when a file is changed rapidly on the host OneDrive - as can happen if you're editing a PowerShell script and hitting Ctrl-S often - and OneDrive gets confused over timestamps, thinking it's got a different copy
OneDrive then renames its local copy as XYZ - LAPTOPNNN.ps1 but this then fails to synchronise as it's read-only
END
So two bugs here: the first one that triggers the creation of a sync copy IN A READ-ONLY share (can never happen so should be trapped). The second is creating the XYZ - LAPTOPnnn.ps1 file which then fails to synchronise. And maybe a 3rd in that you are then unable to delete the accidental copy because it's created with DENY accesss
Ho hum!
- Rob NicholsonDec 12, 2018Brass ContributorOkay, yes that was the problem. On my main PC, something had gotten very confused in OneDrive with access denied: https://i.imgur.com/wVvwk9Y.png
After a reboot, the access denied had gone away and I was able to delete the old folders.
But the original flaw still stands whereby OneDrive restored those folders incorrectly because I happened to logon to an old computer and that version of OneDrive decided to assume it was the master version. That is just algorithmically broken :-(- Rob NicholsonDec 12, 2018Brass ContributorBTW - also note that I user Dropbox and Google Drive as well. This problem has NEVER occurred with those two cloud systems - I can only assume because their synchronisation algorithms are better. They must keep a much more robust history of deletions so that when you logon to an old computer, it knows that that "Monthly" folder was deleted afterwards and deletes (correctly) the copy on the old computer. It doesn't bring it back from the dead!
I assume that Dropbox and Google Drive maintain some separate tracking system of updates so there is a record that says:
1. 4th Jun 2018 10:20 "Monthly" folder created on computer 1
2. 1st Jul 2018 old computer 1 is logged off
3. 13th Sep 2018 "Monthly" folder deleted on computer 2
4. 12th Dec 2018 00:30, user logs back onto computer 1
5. Ahh ha, "Monthly" folder exists here with timestamp 4th Jun but was deleted 13th Sep, it needs deleting from old computer 1 - NOT RESTORING BACK TO ONEDRIVE