Troubleshooting NetWorker VSS errors

When VSS fails it can sometimes mean that you are unable to create a disk image or backup open files with NetWorker. In this document I'll take you through some troubleshooting steps to locate and fix VSS problems and enable backups to complete successfully.

What is VSS?

VSS is a Copy-on-Write (COW) driver that intercepts disk writes before they actually happen. The current contents of the disk are written to a shadow copy buffer before the write takes place. This enables a disk image to represent an exact point in time and not be affected by disk write activity during image creation.

How do I know that VSS has failed?

When VSS fails, there is usually an indication in the savegroup report (/nsr/tmp/sg/<savegroup> or %INSTALL_PATH%\nsr\logs\sg)

You will generally see 'Failed to Create Volume Snapshot' followed by a hex result code. The result code is an error code from VSS and sometimes just Googling "VSS + Result Code" will come up with a solution to your VSS problems.

You may also see:

Backup aborted! - Unable to open file handle for 
   '\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopyxxx' 
   - The process cannot access the file because it is being 
     used by another process.

This may be associated with a VolSnap error in your Windows logs.

VSS uses writer components to ensure that the file system is in a stable state when creating your disk image. For example, SQL database writers ensure that all transactions to databases are complete before allowing the shadow copy service to continue. Windows includes a VSS administration program that can list the status of all VSS Writers you have on your system.

Open a command prompt and type "vssadmin list writers". In Windows Vista, Windows 7, Windows 8 and Windows Server 2008 and later, make sure you start the command prompt with elevated privileges. This will list all your VSS writers with their current state and last error. (Link to instructions on creating elevated command prompt at bottom of tutorial).

C:\> vssadmin list writers
VSSadmin 1.1 - Volume Shadow Copy Service administrative tool
C) Copyright 2001-2005 Microsoft Corp

Writer name: 'Task Scheduler Writer'
   Writer Id: {d61d61c8-d73a-4eee-8cdd-f6f9786b7124}
   Writer Instance Id: {1bddd48e-5052-49db-9b07-b96f96727e6b}
   State: [1] Stable
   Last error: No error
Writer name: 'VSS Metadata Store Writer'
   Writer Id: {75dfb225-e2e4-4d39-9ac9-ffaff65ddf06}
   Writer Instance Id: {088e7a7d-09a8-4cc6-a609-ad90e75ddc93}
   State: [1] Stable
   Last error: No error

Writer name: 'Performance Counters Writer'
   Writer Id: {0bada1de-01a9-4625-8278-69e735f39dd2}
   Writer Instance Id: {f0086dda-9efc-47c5-8eb6-a944c3d09381}
   State: [1] Stable
   Last error: No error

Writer name: 'System Writer'
   Writer Id: {e8132975-6f93-4464-a53e-1050253ae220}
   Writer Instance Id: {6b49c8d3-0d28-48bb-aa85-fe2132c5d4ad}
   State: [5] Waiting for completion
   Last error: No error
   
Writer name: 'Shadow Copy Optimization Writer'
   Writer Id: {4dc3bdd4-ab48-4d07-adb0-3bee2926fd7f}
   Writer Instance Id: {39f8fa94-2a11-4c47-adb6-5edf2169c243}
   State: [1] Stable
   Last error: No error

Writer name: 'ASR Writer'
   Writer Id: {be000cbe-11fe-4426-9c58-531aa6355fc4}
   Writer Instance Id: {1fda53c0-87a7-4fb3-8649-d8a189bb04be}
   State: [1] Stable
   Last error: No error

Writer name: 'Registry Writer'
   Writer Id: {afbab4a2-367d-4d15-a586-71dbb18f8485}
   Writer Instance Id: {1865006a-647a-4c35-a6a4-9c78a2ae26f0}
   State: [1] Stable
   Last error: No error

Writer name: 'COM+ REGDB Writer'
   Writer Id: {542da469-d3e1-473c-9f4f-7847f01fc64f}
   Writer Instance Id: {3bbbebd2-4a15-4c5c-a8a5-f51fc74f87fb}
   State: [1] Stable
   Last error: No error
   
Writer name: 'BITS Writer'
   Writer Id: {4969d978-be47-48b0-b100-f328f07ac1e0}
   Writer Instance Id: {ae59245d-174a-490e-8442-da3445acbd3d}
   State: [1] Stable
   Last error: No error

Writer name: 'WMI Writer'
   Writer Id: {a6ad56c2-b509-4e6c-bb19-49d8f43532f0}
   Writer Instance Id: {6af2b268-c009-4875-9b7e-ed50aec267b8}
   State: [5] Waiting for completion
   Last error: No error

Writers with an error state or where the last error isn't "No Error" are probably causing a problem.

Look for messages in your Windows logs.

VSS Event Properties When VSS fails you will always get a corresponding message in your Windows event log.

  1. Right click on My computer
  2. Select Manage
  3. Expand the Event Viewer node
  4. Look in the Application message node for error messages relating to VSS, Shadow Copy or VolSnap.
  5. If you find any messages then these with give you an Event ID and sometimes a Result Code or hr. These two pieces of information can generally pin point the cause of your VSS failure. Try Googling the Event ID(s) and Result Code(s) for more information.

Make sure that the VSS service isn't disabled

VSS Copy Properties Changing the startup type of the VSS service and rebooting can often resolve issues.

  1. Right click on My Computer
  2. Select Manage
  3. Select the Services tree node.
  4. Right click on Volume Shadow Copy
  5. Select Properties
  6. Change the startup type to Automatic
  7. Reboot

Re-register the VSS components

Sometimes re-registering VSS core components can fix errors. Copy the following commands to Notepad and save the file with a .cmd extension. Run the .cmd file by opening a command prompt and entering the .cmd file name.

@echo off
cd /d %windir%\system32
net stop vss
net stop swprv
regsvr32 /s ole32.dll
regsvr32 /s oleaut32.dll
regsvr32 /s VSS_ps.dll
vssvc /register
regsvr32 /s /i swprv.dll
regsvr32 /s /i eventcls.dll
regsvr32 /s es.dll
regsvr32 /s stdprov.dll
regsvr32 /s VSSui.dll
regsvr32 /s msxml.dll
regsvr32 /s msxml3.dll
regsvr32 /s msxml4.dll
vssvc /register
net start swprv
net start VSS