Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snapshot Policy and VSS Error 8194 in Event Viewer #287

Closed
kenkendk opened this issue Aug 5, 2014 · 21 comments
Closed

Snapshot Policy and VSS Error 8194 in Event Viewer #287

kenkendk opened this issue Aug 5, 2014 · 21 comments

Comments

@kenkendk
Copy link
Member

kenkendk commented Aug 5, 2014

From imi...@gmail.com on October 19, 2010 12:39:40

What steps will reproduce the problem? 1. Remove Duplicati from Windows Startup Folder, start from Task Scheduler @ login with Highest Privileges
2. Set Duplicati.exe file property = Run as Admin
3. Using GUI, create a scheduled backup using Snapshot Policy = "on" What is the expected output? What do you see instead? After the job runs, the Duplicati log shows no VSS errors. However, Windows Event Viewer lists Event 8194 VSS Error (access denied). Here is sample output:

Log Name: Application
Source: VSS
Date: 10/19/2010 6:17:16 AM
Event ID: 8194
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: *******
Description:
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: {3dd28eb2-c214-4c18-97b7-47da7fe76649}
Event Xml:



8194
2
0
0x80000000000000

8337
Application
******



0x80070005, Access is denied.

Operation:
Gathering Writer Data

Context:
Writer Class Id: {e8132975-6f93-4464-a53e-1050253ae220}
Writer Name: System Writer
Writer Instance ID: {3dd28eb2-c214-4c18-97b7-47da7fe76649}
2D20436F64653A20575254575254494330303030313235312D2043616C6C3A20575254575254494330303030313230352D205049443A202030303030303938302D205449443A202030303030323838382D20434D443A2020433A5C57696E646F77735C73797374656D33325C737663686F73742E657865202D6B204E6574776F726B53657276696365202020202020202D20557365723A204E616D653A204E5420415554484F524954595C4E4554574F524B20534552564943452C205349443A532D312D352D3230

What version of the product are you using? On what operating system? Duplicati ver. 1.0.1r530 on Windows 7 (64 bit) What backend (destination) are you using? Amazon S3 Please provide any additional information below.

Original issue: http://code.google.com/p/duplicati/issues/detail?id=287

@kenkendk
Copy link
Member Author

kenkendk commented Aug 5, 2014

From kenneth....@gmail.com on October 19, 2010 11:21:25

Someone reported this under issue #257 as well.

Are you certain that the Duplicati.exe runs as admin?
It uses the %AppData%/Duplicati/lock folder to prevent multiple instances.
If you select "run as admin", it may switch %appdata% to use the Administrators folder, rather than your user folder.

Status: Accepted
Owner: kenneth.skovhede
Labels: -Priority-Medium Priority-High Milestone-Release1.2

@kenkendk
Copy link
Member Author

kenkendk commented Aug 5, 2014

From imi...@gmail.com on October 19, 2010 12:17:02

I checked my User Accounts. The only one that has Appdata/Duplicati/lock is MY own account. There is no similar folder in the Administrator's folder.

Question: Does this mean that "run as admin" is not working?

If YES, can you recommend an alternative way (in Windows 7) that I can auto-start Duplicati at boot - so it has sufficient privileges to execute snapshot-policy=on? (For your interest, I have the VSS Service set at Start: automatic).

Thanks.

@kenkendk
Copy link
Member Author

kenkendk commented Aug 5, 2014

From kenneth....@gmail.com on October 19, 2010 12:27:04

I just tested, and running as admin does not appear to change the %AppData% folder, so I think it is safe to assume that it is running as Administrator.

From issue #258 (sorry, not 257), comment #6, he says that it works on XP but not Win7.
I'll look around and see if I can find any explanation.

@kenkendk
Copy link
Member Author

kenkendk commented Aug 5, 2014

From kenneth....@gmail.com on October 23, 2010 08:26:00

That error seems to be quite common under Win7.
I have found this page which claims that it happens during the close of the operation: http://www.eggheadcafe.com/software/aspnet/30978004/vss-error-on-backup.aspx And this one: http://www.tomshardware.com/forum/197989-46-errors If you run some of these commands during a backup, what output do you get:
vssadmin list writers
vssadmin list shadows
vssadmin list providers
vssadmin list volumes

According to this, the faulty writer is "System Writer": http://www.tomshardware.com/forum/227759-46-unable-system-state-backup-error There is a comment in this post that seems to indicate that it may be a 32/64 bit issue: http://www.geekzone.co.nz/freitasm/2516 If you look at the task list, does Duplicati appear to run as 32 or 64 bit? (Should run with 64 bit).

@kenkendk
Copy link
Member Author

kenkendk commented Aug 5, 2014

From imi...@gmail.com on October 23, 2010 10:37:36

Thanks Kenneth:

I run duplicati using the GUI. I need to learn how to run the command version, and I'll execute the 4 "vssadmin list ..." commands, so we can review the output. I'll have some time in the next few days to try it.

Maybe there is a connection between this issue and Issue #125 , which was also a 32 bit vs 64 bit matter. Although duplicati is a 64 bit compatible application, the installer automatically puts it into "C:\Program Files (x86)" - which is the default 32 bit executables folder.

I wonder if VSS throws an event error 8194 in Windows 7 (64) because it is purely 64 bit, and only responds to calls from *.exe programs contained inside the 64 bit executables folder (C:\Program Files).

In the duplicati installation process is there an option to select the location where the app. is installed? Would giving users of 64 bit Windows the option to select C:\Program Files fix this?

@kenkendk
Copy link
Member Author

kenkendk commented Aug 5, 2014

From imi...@gmail.com on October 23, 2010 11:59:34

(SORRY IF THIS IS A DUPLICATE POST! My earlier post not showing in the "updates" for some reason.)

Thanks Kenneth:

I run duplicati using the GUI. I need to learn how to run the command version, and I'll execute the 4 "vssadmin list ..." commands, so we can review the output. I'll have some time in the next few days to try it.

Maybe there is a connection between this issue and Issue #125 , which was also a 32 bit vs 64 bit matter. Although duplicati is a 64 bit compatible application, the installer automatically puts it into "C:\Program Files (x86)" - which is the default 32 bit executables folder.

I wonder if VSS throws an event error 8194 in Windows 7 (64) because it is purely 64 bit, and only responds to calls from *.exe programs contained inside the 64 bit executables folder (C:\Program Files).

In the duplicati installation process is there an option to select the location where the app. is installed? Would giving users of 64 bit Windows the option to select C:\Program Files fix this?

@kenkendk
Copy link
Member Author

kenkendk commented Aug 5, 2014

From imi...@gmail.com on October 23, 2010 17:04:42

Further evidence that Windows strictly separates 32 bit and 64 bit VSS is described at the MSDN site: http://msdn.microsoft.com/en-us/library/aa384627%28VS.85%29.aspx

@kenkendk
Copy link
Member Author

kenkendk commented Aug 5, 2014

From kenneth....@gmail.com on October 25, 2010 01:03:18

I have almost fixed issue #125 . You could try to simply copy the Duplicati folder from "Program Files (x86)" into "Program Files", to see if that fixes the error.

Does the snapshot seem to work even though you have the eventlog error?
Are the files backed up, no locked file errors?

@kenkendk
Copy link
Member Author

kenkendk commented Aug 5, 2014

From kenneth....@gmail.com on October 25, 2010 01:12:31

I found this post: http://kb.backupassist.com/articles.php?aid=2967 I know it's a long shot, but if all else fails, could you try it and see if it does anything?

@kenkendk
Copy link
Member Author

kenkendk commented Aug 5, 2014

From imi...@gmail.com on October 26, 2010 05:05:45

As an experiment, I manually moved the Duplicati folder into Program Files, and modified the Task Scheduler trigger to auto-load "with highest privileges" at login.

This doesn't solve the VSS Error problem. Whether I set duplicati properties to "run as admin" or not, I receive the 8194 Error whether in (x86) or Program Files . And to clarify for you Kenneth, although the Event Viewer captures a 8194 VSS error, the Duplicati log shows no errors.

SUGGESTION: Kenneth - can you possibly design a simple standardized test that determines if snapshot is working? Users would examine the backup data, the duplicati logs, and their OS logs for errors. This way, multiple users on different systems (XP, Vista, Win 7, Linux, ... 32 and 64 bit) would be using the same test method. Hopefully the results would facilitate a solution that works for all.

Thanks!

@kenkendk
Copy link
Member Author

kenkendk commented Aug 5, 2014

From kenneth....@gmail.com on October 27, 2010 11:29:10

Ok, in that case, I'm pretty sure issue #125 does not solve the problem.

I will make a mini locked file/VSS test tool.

@kenkendk
Copy link
Member Author

kenkendk commented Aug 5, 2014

From kenneth....@gmail.com on November 02, 2010 13:22:15

I'm not really sure what to test for, but I have made a simple VSS test tool that at least works for me.

Attached is a zip file, once extracted, it will create a folder called "Debug".
From the commandline run "Duplicati.Library.Snapshots.exe" and it will:

  1. create a file
  2. lock it
  3. open it while locked (should give error)
  4. create a VSS (or LVM) snapshot
  5. open the locked file through the snapshot (should work)

If the test passes, the last output will be "* Test passed", otherwise the last line will be "* Test failed".

Based on your experience with the tool, I will add more functions to better test it.

@kenkendk
Copy link
Member Author

kenkendk commented Aug 5, 2014

From kenneth....@gmail.com on November 02, 2010 13:56:42

And I just made an extension, it now supports the commandline option --vss-exclude-writers="{d61d61c8-d73a-4eee-8cdd-f6f9786b7124};{0bada1de-01a9-4625-8278-69e735f39dd2}"

Could you try it with the mentioned writer disabled, eg: --vss-exclude-writers="e8132975-6f93-4464-a53e-1050253ae220}"

Attachment: VSSTester.zip

@kenkendk
Copy link
Member Author

kenkendk commented Aug 5, 2014

From imi...@gmail.com on November 02, 2010 15:30:56

Kenneth:
I ran the test tool + extension from command (run as admin). I get "Test Failed".
Please advise if you see any formatting errors in my command. I wasn't sure about correct usage of the the following symbols:
" and { and }
Thanks!


c:\Users***\Desktop\Debug>Duplicati.Library.Snapshots.exe --vss-exclude-writ
ers={e8132975-6f93-4464-a53e-1050253ae220}
Creating file --vss-exclude-writers={e8132975-6f93-4464-a53e-1050253ae220}\testf
ile.bin
Attempting to read locked file --vss-exclude-writers={e8132975-6f93-4464-a53e-10
50253ae220}\testfile.bin
The file --vss-exclude-writers={e8132975-6f93-4464-a53e-1050253ae220}\testfile.b
in was correctly locked, message: The process cannot access the file 'c:\Users**
*\Desktop\Debug--vss-exclude-writers={e8132975-6f93-4464-a53e-1050253ae220}
\testfile.bin' because it is being used by another process.
Creating snapshot for folder: --vss-exclude-writers={e8132975-6f93-4464-a53e-105
0253ae220}
If this fails, try to run as Administrator
The snapshot tester failed: System.ArgumentException: Value does not fall within
the expected range.
at Alphaleonis.Win32.Vss.VssBackupComponents.IsVolumeSupported(String volumeN
ame)
at Duplicati.Library.Snapshots.WindowsSnapshot..ctor(String[] sourcepaths) in
D:\Documents\duplicati\alphavss\Duplicati\Library\Snapshots\WindowsSnapshot.cs:
line 111
at Duplicati.Library.Snapshots.SnapshotUtility.CreateSnapshot(String[] folder
s) in D:\Documents\duplicati\alphavss\Duplicati\Library\Snapshots\SnapshotUtilit
y.cs:line 22
at Duplicati.Library.Snapshots.Program.Main(String[] args) in D:\Documents\du
plicati\alphavss\Duplicati\Library\Snapshots\Program.cs:line 52

  • Test failed

@kenkendk
Copy link
Member Author

kenkendk commented Aug 5, 2014

From kenneth....@gmail.com on November 03, 2010 01:48:43

Sorry, I was too fast with the update.
You must also specify the drive/folder where the update is to take place, eg:
Duplicati.Library.Snapshots.exe C:\temp --vss-exclude-writ
ers="{e8132975-6f93-4464-a53e-1050253ae220}"

I will fix the tool so it just uses the current folder instead.

@kenkendk
Copy link
Member Author

kenkendk commented Aug 5, 2014

From imi...@gmail.com on November 07, 2010 04:50:21

I am testing the new Debug. r578 . The following executable file is missing in this build : Duplicati.Library.Snapshots.exe

Thanks.

@kenkendk
Copy link
Member Author

kenkendk commented Aug 5, 2014

From kenneth....@gmail.com on November 08, 2010 01:26:00

Yes, I should change the build to produce that file as well.
Until then, it is attached to this issue.

Attachment: Duplicati.Library.Snapshots.exe

@kenkendk
Copy link
Member Author

kenkendk commented Aug 5, 2014

From imi...@gmail.com on November 08, 2010 17:52:16

Adding the new .exe to Debug. r578 + specifying the folder as you stated in Comment 16 results in *Test Passed. AND, the test did not trigger the Event 8194 VSS Error in the Windows 7 Event Viewer.

Looks like good news!

The next challenge >> How do we extend this learning to the regular duplicati application, ensure that VSS reliably makes snapshots of locked files when required, and doesn't result in the Event Viewer 8194 error?

Thanks.

@kenkendk
Copy link
Member Author

kenkendk commented Aug 5, 2014

From kenneth....@gmail.com on November 08, 2010 23:13:21

Good question... The test program does exactly the same as Duplicati does, so if one works, both should work.

Did you exclude any writers? Did you test with the same drive that Duplicati backs up?

@kenkendk
Copy link
Member Author

kenkendk commented Aug 5, 2014

From imi...@gmail.com on November 09, 2010 05:44:08

*** SOLVED ***

I did a manual edit of every backup job on my system using the UI Wizard.
I discovered a few where "snapshot-policy" was enabled and "vss-exclude-writers" was NOT correctly configured by me.

This is a user error (me), and NOT a duplicati bug.

The UI improvements being considered for ver. 2.0 - such as being able to review and edit multiple jobs on one screen - will make these user configuration errors easier to see.

What was learned here:
(1) Enabling snapshot-policy can trigger errors with faulty system VSS writers.
(2) You can see this by examining your Windows Event Viewer for VSS Errors.
(3) Use "vss-exclude-writer" in duplicati.

Assuming I am the only person who was struggling with this, I think you can safely close this issue. Thank you Kenneth.

@kenkendk
Copy link
Member Author

kenkendk commented Aug 5, 2014

From kenneth....@gmail.com on November 09, 2010 10:29:25

Ok, I think there was a comment about a similar problem in issue #258 , I'll write a notice there.

I have some USN and dirty-read stuff that I am working on, and when I'm done, I'll write a wiki page with the info from here.

Thanks for your patience :).

Status: Done

@kenkendk kenkendk closed this as completed Aug 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant