Running as service, VSS not working

Hi,

Having followed the instructions to run Duplicati as a service, I find that VSS snapshot is not working.
I’ve tried both Local System Account, and a dedicated service account which is member of the local admins group.
The error is logged as
_Fatal error
System.UnauthorizedAccessException: Attempted to perform an unauthorized operation.

at Alphaleonis.Win32.Vss.VssBackupComponents…ctor()

at Alphaleonis.Win32.Vss.VssImplementation.CreateVssBackupComponents()

at Duplicati.Library.Snapshots.WindowsSnapshot…ctor(String[] sourcepaths, Dictionary`2 options)

at Duplicati.Library.Snapshots.SnapshotUtility.CreateWindowsSnapshot(String[] folders, Dictionary`2 options)

at Duplicati.Library.Main.Operation.BackupHandler.GetSnapshot(String[] sources, Options options, ILogWriter log)

at Duplicati.Library.Main.Operation.BackupHandler.Run(String[] sources, IFilter filter)_

I had VSS working before by launching Duplicati via Run as Administrator, but that does not work with automatic startup and is not recommended so I want to use the service method.
I am running latest Duplicati 2 under Windows 10.

Any ideas?

Otto

I’ve not seen that one myself, what version of Windows are you running?

Windows 10 Pro, 1703

Otto,

Is that error from when it’s running as local system, or when it’s running as a local account in admin group?

I know it’s possible as I’ve got Duplicati running as a service as SYSTEM on Win 10 Pro 1703 and not having any issues with VSS. Only thing I had to do was install the VS 2017 C++ Redistributable.

Were you prompted on some way to do that or did you “just know” that it was needed?

I tried both alternatives, makes no difference.
When running as a local account, I can clearly see in Task Manager Duplicati runs as this account.

Re VS 2017 C++ Redistributable, where you asked to install this? I don’t recall get ing a request to do so…

Pretty sure it should be the 2015 version:
https://www.microsoft.com/en-us/download/details.aspx?id=52685

But that should give some other error, not “permission denied”.

Can you look at the Windows event-log and see if there are error messages there?

Application log shows VSS errors, Access Denied. See below.
I tested enabling the built-in Administrator account and set the Duplicati service to use that. Same error.

Volume Shadow Copy Service error: Unexpected error querying for the IVssWriterCallback interface. hr = 0x80070005, Access is denied.
. This is often caused by incorrect security settings in either the writer or requestor process.

Operation:
Gathering Writer Data

Context:
Writer Class Id: {e8132975-6f93-4464-a53e-1050253ae220}
Writer Name: System Writer
Writer Instance ID: {7c7a3c66-eef2-4a0e-b0da-b24652e1c5af}

Googling that number suggests this:

And this has more: http://kb.macrium.com/knowledgebasearticle50010.aspx

@otto & @JonMikelV, no I wasn’t prompted I chased it down as I was getting an error message when I first ran a job with VSS. As @kenkendk mentioned it was not a permissions issue, but something akin to the error in this GitHub post:

This lead me to realizing I was missing the Visual Studio C++ redistributable. I went with the 2017 version as it appears to be backwards compatible with older things that needed the 2015 version previously, and I saw a few posts that said newer versions of AlphaVSS needed the 2017 version. 2015 version might work just as good, but haven’t tried it.

I installed “directly as a service” from the ZIP version of Duplicati bypassing the normal installer, so that might be why VS C++ wasn’t automatically installed.

In any case, VSS permission issues are pretty painful to troubleshoot. There might be better articles out there, but this one is the first one I ran across that covers some of the troubleshooting steps I’ve had to do in the past to fix broken VSS on servers.

1 Like

The issue has been resolved.
Apparently what was needed was a plain restart, something in the VSS system apparently cached the incorrect (old) user credentials. Now it works fine.

A point worth mentioning is that as Duplicati now runs under the service account I created, selecting Home as the Source Data will not back up my files, but those of the service account.
I suppose that might bite someone who switches to VSS and use a dedicated service account…

2 Likes

Glad you got it working, and thanks for the heads up on the “home” folder!

I always manually select what I want so it never occurred to me that “home” would be dynamic based on user account (I just assume it was a UI shortcut to a specific folder which would then be used going forward).

I’ll update the Migrating from User to Service install on Windows How-To to make note of this!

No problem.
Given all the problems I had with VSS I eventually ended up exporting my jobs to file, and importing them into the new Duplicati profile that tied to the service account. And when I checked the settings after import I noticed the Home issue.

I suppose export/import is an alternative to moving the databases, but the downside is that you have to run a Repair Database, which on some of my backup targets took more than 24 hours.
Anyway I’d recommend doing an export before trying to move the database so as to have the config(s) saved.

1 Like

This is what worked for me. I had everything setup perfectly (I installed VS C++ 2017 x32 and x64), but it still wasn’t working until after a full reboot. Then VSS worked without fail.

The error / problem I have is different but as its very much related, it seemed a good idea to continue this thread as it might help someone in the future.

I’m running Duplicati 2.0.4.5_beta x64 as a service on Win 10 Home (seems to properly be backing up and restoring) but the VSS fails.

It took some research to understand what was actually happening but now that I know, I could use some ideas as to what I can do to overcome the error.

For reference, this is the specific error:

2019-05-21 17:50:39 -04 - [Warning-Duplicati.Library.Main.Operation.BackupHandler-SnapshotFailed]: Failed to create a snapshot: Alphaleonis.Win32.Vss.VssUnexpectedProviderErrorException: The provider returned an unexpected error code. at Alphaleonis.Win32.Vss.VssBackupComponents.IsVolumeSupported(String volumeName) at Duplicati.Library.Snapshots.WindowsSnapshot…ctor(IEnumerable1 sources, IDictionary2 options) at Duplicati.Library.Snapshots.SnapshotUtility.CreateWindowsSnapshot(IEnumerable1 folders, Dictionary2 options) at Duplicati.Library.Main.Operation.BackupHandler.GetSnapshot(String sources, Options options) ]

Ends up (I believe by looking at the Windows Event Viewer) the "unexpected error code is 12293:

Which after filtering the gibberish leaves “Operation: Check If Volume Is Supported by Provider”.
I also note that the error says “Alphaleonis.Win32 which seems odd as the OS and the Duplicati build are 64bit bit.”

Anyway, this made me wake up as I remembered that some of the files in my backup set actually reside on a VeraCrypt encrypted volume (VeraCrypt volumes do not support VSS) and indeed, reading further down in Windows Event Viewer, that drive letter is noted.

I have not tested yet but I presume the VSS is working for the other files on the non-encrypted volume. This is a long-winded way to the question; how can I tell Duplicati and its use of VSS to ignore that particular volume?

Thanks…

Well, I thought that there was a small chance – vss-exclude-writers might be the key so I figured out the GUID for this virtual encrypted volume - Handy that the command line accessible app ‘mountvol.exe’ without any arguments will display all the volume GUIDs)
It was added to the Duplicati GUI as --vss-exclude-writers={2278d21f-4782-87d8-bd53-7c67a25d3de}

But I still receive the same error.

I have set the snapshot-policy to Auto so I’m not receiving the error but it’s unclear that in the future an error would be displayed if VSS fails for some reason on the other drive.

I don’t think Duplicati gives you fine-grained control of which folders get VSS (I’m not even certain that VSS itself generally allows that – any VSS wizards around?) but you could possibly set up two backup jobs, one using VSS for areas that tolerate it, and the other not using VSS for things (such as VeraCrypt) that do not.

1 Like