The Core Technologies Blog

Our Software // Windows Services // 24×7 Operation


Q&A: Why doesn’t OneDrive Delete my Files when Running as a Windows Service?

Q&A - OneDrive Not Deleting Files
  Our client has AlwaysUp 11.8.3.74 installed on a Windows Server 2019 platform and uses it to deliver OneDrive as a service.

This was set up as per your guide back in August, however, recently we have noticed some issues with OneDrive sync functionality.

My problem is, if I delete a file in OneDrive via the web interface, OneDrive started by AlwaysUp (in this session or background, it doesn’t make any difference) will not delete the file in the local PC folder. If I stop the service and start OneDrive manually via the Start Menu, the file will be deleted immediately.

Everything is working fine, except deleting file via web interface and syncing this deletion to the PC.

Looking forward to your help.

— Bernd

Hi Bernd, sorry to hear of the problem! We investigated and here is what we found out:

The problem exists in OneDrive for Windows Version 19.192 (November 13, 2019)

We were able to reproduce the issue described on two Windows 10 test machines — one with version 1809 and the other running version 1903. We performed the following steps:

  1. Downloaded and installed OneDrive Version 19.192.0926.0012.

  2. Followed our step-by-step our tutorial showing how to setup OneDrive as a Windows Service.

  3. Started OneDrive as a Windows Service (in the background, in Session 0).

  4. Logged in to OneDrive online.

  5. Deleted a file from the website.

  6. On the local PC, opened File Explorer to the OneDrive folder holding the file just deleted.

  7. Waited two minutes for the file to disappear from the local folder.

Unfortunately the file was never removed!

When we stopped the OneDrive service and restarted OneDrive normally on the desktop, the file was quickly removed from the local PC — just as you experienced.

Additions, renames and other file operations work fine

It seems that the problem is indeed limited to the propagation of online deletions.

We confirmed that these operations worked flawlessly, with changes synchronized between the OneDrive website and the PC in a few seconds:

  • Adding a file to the OneDrive website

  • Adding a file to the OneDrive folder on the local computer

  • Deleting a file from the OneDrive folder on the local computer

Deletions work properly with Files On Demand

Curiously, online file deletions are reflected on the local PC in one scenario — when Files On Demand (FoD) is engaged and the file has not yet been downloaded to the local computer.

When we executed the test above with FoD on, the file (or rather the “stub” representing the file) was quickly removed after its counterpart was deleted online.

Awaiting a fix from Microsoft

We’ve posted a message to the OneDrive forum asking for help but so far there has been no word from the folks in Redmond.

Hopefully Microsoft will provide a fix soon. We will be sure to let you know if we come up with a workaround before then.

Posted in OneDrive | Tagged , , , | 8 Comments

8 Responses to Q&A: Why doesn’t OneDrive Delete my Files when Running as a Windows Service?

  1. Roel Charita says:

    Dear, I’m experiencing the exact same described problems as described above and was independently able to reproduce all of them. To eliminate that the cause is AlwaysUp itself I was able to reproduce the same with the “srvany” any approach. My environment where I tested is:
    – Windows Server 2019 Standard 1809, OS build 17763.1158
    – OneDrive client build 19.232.1124.0010
    – AlwaysUp version 12.0.8.31

    In order to continue my evaluation and consider purchase of AlwaysUp I really need this setup to work flawlessly. Thanks in advance for your efforts to get this resolved!

    Kind regards,
    Roel

  2. Hi Roel, thanks for trying AlwaysUp and for investigating the situation!

    Unfortunately, as you have verified, the problem is with OneDrive and not with AlwaysUp (or any other run-as-a-service program). We continue to struggle to develop a workaround, but it is clear that the ultimate solution must come from Microsoft.

    Do you pay for OneDrive? Do you have a support contract with Microsoft? If so, would you mind opening a support ticket with them? As a customer, your request should carry weight and hopefully nudge them to fix their code.

  3. Roel Charita says:

    Hi, I’m a Microsoft Registered Partner so yes, I am able to make a support ticket. It’s probably worth giving it a try to open a support ticket, on the other hand they may argue that this is an unsupported way of using OneDrive … let’s see what the reaction is? 🙂

    Kind regards,
    Roel

  4. Thanks Roel! Good luck, and please keep us posted.

  5. Roberto Zanini says:

    Hi, the problem still exist on 20.114.0607.0002 version.

    Installed on Windows Server 2008 R2 as service using AlwaysUp and got the same problem.

  6. mk says:

    Windows Server 2019
    OS build 17763.1158
    OneDrive version 20.124.0621.0006

    Still doesn’t work

  7. Unfortunately the problem persists in the latest insider build (version 20.169.0823.0003, September 16 2020).

    Additions and other operations work fine, only deletions from the cloud are not propagated to the PC’s hard drive. Very frustrating!

Leave a Reply

Your email address will not be published. Required fields are marked *