Locked file, errors on outlook.pst

Hi, in he description of Duplicati 1.34 I read that VSS is being used in case of open files. This is obviously not the case with Duplicati 2.0 as I’m getting errors when I have Outlook running and that folder is processed for backup. Are there any plans to include the VSS functionality in a future release of Duplicati?

Duplicati 2 supports VSS. However, to be able to create a VSS snapshot, Duplicati has to be started with administrative privileges. Right click Duplicati 2 and click “Run as Administrator”.
Instead of using the Duplicati Tray Icon, you can also install Duplicati as a Windows service. This tutorial video shows how this works:

Type Duplicati.Server.exe help for more possible options.

You can change the behaviour of Duplicati in relation to creating VSS snapshots with --snapshot-policy. Setting it to Off will never create a VSS snapshot. Auto wil create a snapshot if possible, but continue silently if a snapshot can not be created. Setting this to On will try to create a snapshot and return a warning is this fails. Setting it to Required will abort the backup job if creating a snapshot fails.

Hi, just checked the settings and it turned out that snapshot policy was set to Off. Changed it to required and now I do not see the error message is anymore.

I edited your post to improve the formating. (Just added ~~~ before and after the output you pasted, see here for details).

I am running it as a service, and have SnapShot policy set to Auto, but I consistently get this message on Outlook PST files:

Failed to process path: C:\Users\[redacted].pst
System.IO.IOException: The process cannot access the file because another process has locked a portion of the file. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.ReadCore(Byte[] buffer, Int32 offset, Int32 count) at System.IO.FileStream.Read(Byte[] array, Int32 offset, Int32 count) at Duplicati.Library.Main.Blockprocessor.Readblock() at Duplicati.Library.Main.Operation.BackupHandler.ProcessStream(Stream stream, CompressionHint hint, BackendManager backend, FileBackedStringList blocklisthashes, FileBackedStringList hashcollector, Boolean skipfilehash) at Duplicati.Library.Main.Operation.BackupHandler.HandleFilesystemEntry(ISnapshotService snapshot, BackendManager backend, String path, FileAttributes attributes)

Any other suggestions?

I leave Outlook running because of some client-only rules I would like processing 24/7.

I’d suggest trying a snapshot policy of “on” to force a VSS snapshot to be created. If one can’t be created then the backup will fail (so you might want to try this with a test backup that only touches the offending .pst file).

If it does fail (as I expect it will) the logs can be reviewed for more detail on why. My guess is the snapshot is being created for some reason such as a permissions issue or something else is using the snapshot creator when Duplicati is trying to create one.

More accurately, setting snapshot policy to on will let backup continue but log a warning. Setting it to required will abort the backup in case VSS does not work:

From the Duplicati command line help (v2.0.65): snapshot-policy : Controls the use of disk snapshots Type: Enumeration, Default value: off This settings controls the usage of snapshots, which allows Duplicati to backup files that are locked by other programs. If this is set to “off”, Duplicati will not attempt to create a disk snapshot. Setting this to “auto” makes Duplicati attempt to create a snapshot, and fail silently if that was not allowed or supported. A setting of “on” will also make Duplicati attempt to create a snapshot, but will produce a warning message in the log if it fails. Setting it to “required” will make Duplicati abort the backup if the snapshot creation fails. On windows this uses the Volume Shadow Copy Services (VSS) and requires administrative privileges. On linux this uses Logical Volume Management (LVM) and requires root privileges.

Personally I have it on “on” so it logs errors but if VSS fails (do not think I have seen it happening when proper permissions are given, yet) it will still backup whatever it can without it.

1 Like

I’ve got mine set to “on” as well, as that seems like the best of both worlds option. If VSS fails it’ll still back up everything else, but it doesn’t do it silently so you still get an entry in the log and an email if you’ve configured email for --send-mail-level to include “Warning”.

I’ve only been up and running for a few weeks now but I haven’t had a single VSS snapshot fail so far. (No PST files, but lots of other open files including DB files).

1 Like

If you are sure you are running Duplicati as a service (and started the service using the SYSTEM account or another account with administrative privileges), my guess is that you are running multiple instances of Duplicati.

If you look in the address bar of your web browser, what port number do you see? 8200 or 8300? If it’s 8300, you still use a user based instance with probably limited permissions.

Add --no-hosted-server to the target field of the shortcut to the Duplicati Tray icon to prevent starting up a second, user based instance with tharting up the tray icon.
More info about how to move to a service-based installation can be found here:

2 Likes

That was my problem. When I go to localhost:8200 I find the service instance and it’s got my backup job in it and all looks good. When I go to localhost:8300 I get a web page that looks like the Duplicati UI but it complains of having lost connection to the server. By comparison, when I go to localhost:8300 on my Linux machine, I get missing-page errors. I suspect that orphaned page is just junk that was cached before I tidied up.

In any case, the server actually running – the system service – is backing up all my files now. And adding --no-hosted-server to the tray-icon shortcut helped. Thanks!

1 Like

Warnings: [
Failed to process path: C:\Users\Mejunis\Documents\OutlookBackup\01012017.pst => The process cannot access the file because another process has locked a portion of the file.

I have set the Snapshot Policy - Auto. But seems its not working.

I’d suggest you try changing it to ON (log entry will be made if VSS snapshot fails). Run your backup and if you see the log entry, then you’ve got a VSS problem (perhaps you’re not running Duplicati as a service with permissions to make snapshots?)

Alternatively, you could set it to REQUIRED at which point if VSS fails then the whole backup is aborted.

1 Like

here’s the command line to copy:
Duplicati.WindowsService.exe install --webservice-interface=loopback --webservice-port=8200 --portable-mode

1 Like

This is something I’m consistently having an issue with, on Outlook and other files, across many, many workstations I’ve installed Duplicati on.

I have it running as the system service, using the right instance, have tried every variation of snapshot policy settings, and it consistently cannot ever get a VSS read on a file. It’s always “The process cannot access the file because another process has locked a portion of the file.”

If you are 100% sure that the Duplicati instance you use is running with administrative privileges, the only reason I can think of is a missing VC++ Redist package or incorrect installed VC++ version.

You need the 2015 version (to be sure, install both 32 and 64 bit versions), although installing version 2017 is also reported as a solution for not working shadow copies in Duplicati:

Thanks for that pointer. I installed the 2015 redistributables on one test machine and it seems to have worked. That might need to be added into the installer.

1 Like

Good Day Do you just need to install vss or do we need to do any configs

To make VSS work:

  • Install VC++ 2017 Runtime (see link above)
  • Run Duplicati as a user with administrative privileges
  • Set advanced option --snapshot-policy to on or required.
1 Like

Good Day

I installed VC
Started the service with a system account
Installed the Duplicati as a service started the service as a system account
Rebooted the windows 7 machine
Configured a new backup for the pst files
Enabled the snapshot to the on setting option
Users outlook is open pst are backing up

Many thanks for the support

Best Regards

Johan

2 Likes

Hello. I created a task schedule in Windows to fire on startup. I noticed that Duplicati works as administrator with snapshot normally, but the icon does not appear in the notification/Task bar.
So, in another attempt, I installed it as a service without the --portable-mode command, since I already had it configured and didn’t want to do it again - and here again the icon doesn’t appear although Duplicati works perfectly.
But I like the icon! Please, how do I make the icon appear in one of these two ways of execution? (Service or Task Scheduling) ? I prefer to see the icon with alarm signals instead of opening the browser just to see the status, and I need to run it as administrator…how do I solve this? (there is no other user on the machine).
Thanks.