The Core Technologies Blog

Professional Software for Windows Services / 24×7 Operation


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

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

June 11 2021: This issue has been resolved (jump to the details).

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.


UPDATE: Fixed in AlwaysUp version 12.8 (June 2021)

If you are encountering this problem, please:

  • Upgrade to the latest version of AlwaysUp.

  • Edit OneDrive in AlwaysUp and check the Launch the application without admin rights option on the Logon tab:

    OneDrive Windows Service: Run Restricted
  • Save your changes.

When you next start OneDrive from AlwaysUp, all operations will work properly — including deletions.

Posted in OneDrive | Tagged , , , | 24 Comments

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

  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!

  8. evaluator says:

    question. why is this microsoft’s fault as their ondrive client works fine in interactive mode? it’s a show stopper problem for alwayup+onedrive. this has to be a permission issue or something.

  9. Hi evaluator.

    Here is what we know:

    1. OneDrive versions prior to 19.192 work completely fine when run with AlwaysUp (any version).
    2. OneDrive version 19.192 and later exhibit the problem when run with AlwaysUp (any version).
    3. The problem of deleting shows up when OneDrive runs in Session 0 with any tool, not just with AlwaysUp. We have tried several and confirmed this.

    Our conclusion is that Microsoft changed something in version 19.192 that prevents the delete-form-folder operation working properly in Session 0. We have no idea what that could be. We have reported the issue to Microsoft (multiple times) and spent many hours trying to come up with a workaround (like we did recently for Dropbox) but so far no joy.

    Of course, because not many users run OneDrive in Session 0, this is simply not an urgent problem for Microsoft. Unless good folks like yourself say so, loudly!

  10. Esc says:

    disappointing to see that almost a year since issue first occurred there is still no fix or usable workaround. I appreciate MS folk have introduced an undocumented change which makes it more difficult to figure out the root cause, but hope you are genuinely looking into alternative ways of rectifying the ongoing problem, rather just waiting for them to come up with a solution for you, I must admit that for us – running OneDrive client as a service was the only reason for purchasing the AlwaysUp license

  11. Hi Esc.

    Yes — it is very disappointing that there is no remedy yet!

    Let me assure you that our team continues to experiment and troubleshoot the situation, as we have done here and here for Dropbox. But unfortunately, with no technical documentation on OneDrive’s internals and absolutely zero help from Microsoft, it has been very difficult to influence OneDrive from “the outside”.

    If you are a paying Microsoft customer, I encourage you to raise this issue with their support staff. Perhaps they will take a look if enough people complain. That will be the best way to get a resolution here.

  12. Scott says:

    Just purchased AlwaysUp to had the sync tool run on the server to sync SharePoint data. Just discovered this issue and VERY disappointing a workaround stull hasn’t been discovered din over a year. Kind of invalidates the purpose of the purchase.

  13. Hi Scott.

    Apologies for the inconvenience but unfortunately the situation is beyond our control. Please let our support team know if you would like a refund.

  14. Good news!

    After many hours of investigation, we have been able to tweak AlwaysUp to work around the issues with OneDrive. The improvements are included in AlwaysUp 12.8, which is currently available for early testing.

    To experience the fix:

    1. Install AlwaysUp 12.8 from the link above.

    2. Follow our tutorial to setup OneDrive with AlwaysUp.

    3. Edit OneDrive in AlwaysUp, switch to the Logon tab and check the Launch the application without admin rights box.

    4. Save your settings.

    When you next start OneDrive from AlwaysUp, all operations will work properly, including deletions.

  15. The fix is now included in the latest version of AlwaysUp. Download it here.

  16. cb says:

    Hello,

    I’m still having this issue with the latest version of AlwaysUp. Onedrive version 21.099.0516.0003, AlwaysUp (trial) version 12.8.5.43

    I have the folder set to “Always Keep on Device.” File deletions are not being picked up.

    I did notice that your instructions say to check the box “Launch the application without admin rights” but if I do that I get an error trying to start the service ” A required privilege is not held by the client.” The only way I could start it is with this box unchecked. Not sure if that would affect this functionality.

  17. Hi cb.

    Checking the “Launch the application without admin rights” box is important for OneDrive to work properly.

    Is the account you specify on the Logon tab an administrator on the PC? Please send an email to support@CoreTechnologies.com with the details and our technical team will help you from there.

  18. CW says:

    like cb sayd, we have the same issue and our account is member of local administrator. when the box is unchecked it works fine. if we check it, OneDrive always stops.

  19. CW says:

    hi guys,
    i´ve now found the solution in our environment.
    we set the checkbox like you sad than we started the SharepointSync “in this session”! at next we stopped the service once again and startet it with the normal SharePointSync button (without “in this session”). Now the sync runs fine in both directions (included with deleted files)

  20. Thanks CW. Glad it’s working for you now. We’ll have to see if we can reproduce that strange issue…

    But to anyone else experiencing a permission problem, please do as CW advises and start OneDrive in the session (from the “Application” menu) at least once before doing a regular start (in Session 0). Please get in touch with us if that doesn’t help.

  21. Hi again.

    The sporadic “A required privilege is not held by the client” error has been fixed in AlwaysUp 12.9, which is now available at the release candidate page. The final build should be released on Friday July 2.

  22. Marcus says:

    Unfortunately the error still exists. If the checkbox for “Launch the applic…” is activated, the synchronization doesn’t work at all. Not for deleted but also not for newly created files. I also started the service “in this session” and then again in session 0, unfortunately no change. No synchronization with active checkbox. Am I still doing something wrong here?

  23. Hi Marcus, sorry to hear of the trouble.

    The “Launch the application without admin rights” box must be checked for deletes to work. It’s a matter of figuring out why OneDrive synchronization doesn’t work when that is on.

    I’ve asked our support team to reach out to you to troubleshoot. A remote session may be necessary to get to the bottom of the issue…

Leave a Reply

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