The Core Technologies Blog

Professional Software for Windows Services / 24×7 Operation


Investigating OneDrive Failures in Session 0 on Windows Server

Investigating OneDrive Failures in Session 0 on Windows Server

Recently, customers using AlwaysUp to run OneDrive 24/7 have been reporting a puzzling problem. Even though OneDrive starts as a Windows Service in Session 0, it doesn’t do its job. Files aren’t synchronized and AlwaysUp reports that “OneDrive has no network connections to the cloud”.

Our team jumped in quickly to investigate. Here’s what we’ve learned so far:

  • The problem seems to be related to newer builds of OneDrive (or a recent Windows update) published after June 2024.

  • The issue affects customers on Windows Server 2019 and 2022. To date, all the complaints have come from folks running those operating systems.

  • Not all customers on Windows Server are affected. Some customers on Server 2019 and 2022 continue to run OneDrive in the background just fine.

  • We’ve not been able to reproduce the network failures. Indeed, OneDrive will run continuously in Session 0 on our Windows Server machines, syncing files for many days:

    OneDrive running continuously in Session 0 on Windows Server 2022
  • OneDrive fails only in Session 0. If you start OneDrive in your current session (by selecting “Start in this session” from the “Application” menu), files are synchronized without issue.

Troubleshooting the problem

OneDrive is notoriously difficult to debug. The reality is that Microsoft doesn’t provide any documentation or insight on the inner workings of its flagship file synchronization software. And the sparse release notes aren’t helpful either.

That lack of guidance leaves small, independent developers like us scrambling to understand how the OneDrive works — and trying desperately to figure out exactly what’s changed as the developers in Redmond tinker with the software.

At this point, the technical log files are our primary source of inspiration. Fortunately we were able to examine the files provided by a couple of customers.

A few clues from OneDrive’s log files

One of the log files we examined suggested that OneDrive has trouble automatically signing in when running in Session 0.

From what we can tell, OneDrive tries to log in by calling AcquireCredentialSilently — a function that attempts to authenticate the user. Apparently an appropriate token is found but it needs to be refreshed. And eventually, the function fails without finding credentials in the cache.

This excerpt from the OneDrive logs tells the story:

OneDrive AcquireCredentialSilently failed

But we only saw that behavior a couple of times. And unfortunately we don’t yet know how to remedy those authentication problems.

We need your help!

Since OneDrive works perfectly in Session 0 on our servers, we must depend on the benevolence of our knowledgeable customer base to help us troubleshoot. Indeed, here are the top three ways that you can help us figure out the best way forward.

1. Try early, “Insider” releases of OneDrive

Our fervent hope is that Microsoft fixes the problem in their code and restores OneDrive functionality in Session 0. That would be the best outcome for us all.

You see, Microsoft produces an updated version of OneDrive every few days. And you can find those new builds at Hans Brender’s site:

OneDrive Insiders Releases

Those “Insider” versions are early, hot off the press releases. They contain the latest changes from Microsoft, which are destined to make it into a “Production Ring” release and ultimately deployed to everyone.

Please:

  1. Check Hans Brender’s site regularly;

  2. Download and install the latest Insider build on your server;

  3. Run a test to see if OneDrive is able to operate in the background with AlwaysUp, without reporting any network errors.

Fingers crossed!

2. Send us your OneDrive log files for analysis

Please collect your OneDrive log files and email them to us for review.

Maybe we’ll get lucky and the logs will highlight how things are failing on your system — and point our development team in the right direction.

3. Allow us to connect to your server remotely to troubleshoot

Experiencing the problem firsthand — and being able to try potential solutions — gives us an excellent opportunity to devise a solution.

If you can, please arrange for someone from our team to access your server remotely. We’re happy to work at a time of your choosing and under your supervision — whatever’s convenient for you.

We’re generally available between 9 AM and 4 PM US Pacific time (GMT-7/8). Contact us here.

A workaround: Setup automatic logon to launch OneDrive in a normal, interactive session

In all our tests, OneDrive works perfectly when it runs in a normal login session. Indeed, if you start OneDrive in your current session (by selecting “Start in this session” from the “Application” menu) from AlwaysUp, your files will be synchronized quickly and completely.

Therefore, until there is a solution from Microsoft or from us, you should setup automatic logon and launch OneDrive in a normal session:

Setup auto-logon for OneDrive

With that adjustment in place, OneDrive will start properly at boot and you won’t have to deal with the peculiarities of the isolated Session 0 anymore. Most importantly, you can stop worrying about OneDrive — and move on to tackle your next, pressing dilemma. 🤕

Posted in AlwaysUp | Tagged , , , , , , | Leave a comment

Leave a Reply

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