Resolving Azure File Sync Issues

Azure File Sync has became a mega hit among all the recent infrastructure solutions provided by MS Azure, many enterprise are already moving their File Servers to Azure File Share and DFSR is widely replaced by Azure File Sync.

But there are another side of it, you may face multiple errors while you move your file servers to Azure.

In todays post I will show you how you can resolve the issues related to Azure File Sync. There can be many issues related to Azure File Sync but one of the most common issue is health related errors for the server end points.

As you can see in the below picture there is a health issue reported in one of the server end point in the Azure File Sync deployment (storage service sync) in Australia Sydney location.

The first step is to run the evaluation tool in the server endpoint to confirm the compatibility with the Azure File Sync. You can find here the steps https://docs.microsoft.com/en-us/azure/storage/files/storage-sync-files-planning#evaluation-tool

As you can see I have run the tool and you can see the results here. Since the server is Windows 2012 R2 so there is no compatabilty issue found here.

As per MS the Sync Activity to work correctly this conditions should statisfy.

  • The timestamps for the Last Attempted Sync for both upload and download are recent.
  • The status is green for both upload and download.
  • The Sync Activity field shows very few or no files remaining to sync.
  • The Files Not Syncing field is 0 for both upload and download.

Since there are sync errors in our case so we need to

How you can see if there are specific files or folders that are not syncing?

If Files Not Syncing count in the portal are greater than 0 for any given sync session, that means some items are failing to sync. Files and folders can have characteristics that prevent them from syncing. These characteristics can be persistent and require explicit action to resume sync, for example removing unsupported characters from the file or folder name. They can also be transient, meaning the file or folder will automatically resume sync; for example, files with open handles will automatically resume sync when the file is closed. When the Azure File Sync engine detects such a problem, an error log is produced that can be parsed to list the items currently not syncing properly.

To see these errors, run the FileSyncErrorsReport.ps1 PowerShell script (located in the agent installation directory of the Azure File Sync agent) to identify files that failed to sync because of open handles, unsupported characters, or other issues.

When I ran the script in the end point server I have found the below results as you can see below. (66 files are not synced)

The script confirmed the following errors in my case and below is also the remediation to these errors:

  • 17 files have error 0x80c80018 – A file cannot be synced because it’s in use. The file will be synced when it’s no longer in use.
    • Remediation: No action required. Azure File Sync creates a temporary VSS snapshot once a day on the server to sync files that have open handles.
  • 45 files have error 0x8007007b – The filename, directory name, or volume label syntax is incorrect.
  • 3 files have error 0x80c8031d – Sync couldn’t complete because a file changed. Sync will try again later.
    • Remediation: No action required.

If you find similar errors you can always run the FileSyncErrorsReport.ps1 and after the results, verify in MS documentation here.

This will also show the description of errors and respective remediation.

Please apply the remediation shared to the files showed in the script – you have for each file the directory in the error description.

You can always copy the files which are not synced with the help of RoboCopy to the destination server just before the cutover. When you compare the files with source and destination always compare with Azure Portal and never directly compare with tree view or anything which can give you wrong results.

This is my last post for this year. Hope this will help you in the Azure File Sync deployment. I will bring more posts in 2019 to help you in your Azure Journey. Wish a very happy new year to you and your family.