Attix5 Pro FAQ
Search:     Advanced search

System State (using WSB) plug-in - SplitVHD.exe has an error (exit code = 2)

Article ID: 204
Last updated: 29 Jan, 2015

Background

As detailed in FAQ56, the System State (Using WSB) plugin goes through several stages during the backup process.
The first stage is to call the Windows Server Backup (WSB) engine that creates a Virtual Hard Disk image (VHD) for each of the system disks in the machine.
The second stage is where an Attix5 sub-process called “SplitVHD” is run. This splits the large VHD file(s) out into separate files, so that these can be de-duplicated from one backup to the next. This saves on data transmission, and on data stored on the Storage Platform back end. The process is called “SplitVHDX” on Windows Server 2012 and later as these use the VHDX virtual hard disk format rather than VHD. The principle behind the process is the same.

When the SplitVHD process fails, an error will be reported. There are several causes of errors, and whilst these may appear to be very similar, can have quite different causes.

Important Note: If you are experiencing a problem with the Windows Server Backup System State process, the following FAQ will not help you. Please refer to FAQ56 as a starting point: http://faq.attix5.com/index.php?View=entry&EntryID=56

It is also important to note that ReFS file system is not supported by the SplitVHDX process at this time – see scenario 3 below.

Scenario 1 - Source Disks Contain Errors

Symptom

During a WSB backup, the following error is encountered within the Backup Client log and the backup fails (Chkdsk has been run on the machine, but no errors have been found):
Error: 2012/06/19 10:05:31 [System State (using WSB) Plug-in] SplitVHD.exe has an error (exit code = 2). See backupservice.log for more detail.
Error: 2012/06/19 10:05:32 could not create backup: File collection interrupted

The backupservice.log file shows a stack trace of the file collection error, but no other details:

2012-06-18 11:16:52,372 ERROR errorlog - could not create backup: File collection interrupted
java.lang.InterruptedException: File collection interrupted
  at com.letsbackup.fileutils.BackupProcessor.processSelection(BackupProcessor.java:2095)
  at com.letsbackup.fileutils.BackupProcessor.doBackupCommand(BackupProcessor.java:1153)
  at com.letsbackup.fileutils.BackupProcessor.run(BackupProcessor.java:578)

In the SplitVHD.log, one of the following is reported:


Reading 6,021 VHD allocation blocks
Analysing Master File Table
System.IndexOutOfRangeException: Index was outside the bounds of the array
   at DiscUtils.Utilities.BytesToString(Byte[] , Int32 , Int32 )
   at DiscUtils.Ntfs.FixupRecordBase.FromBytes(Byte[] , Int32 , Boolean )
   at DiscUtils.Ntfs.MasterFileTable.GetBootstrapRecord()
   at DiscUtils.Ntfs.NtfsFileSystem..ctor(Stream )
   at SplitVHD.Program.GetDataExtentsFromVhd()
   at SplitVHD.Program.DoRun()

Or

Reading 8,196 VHD allocation blocks
Analysing Master File Table
System.ArgumentOutOfRangeException: Attempt to move beyond end of stream
Parameter name: value
   at DiscUtils.SubStream.set_Position(Int64 )
   at DiscUtils.SubStream.set_Position(Int64 ) at DiscUtils.Ntfs.MasterFileTable.GetBootstrapRecord()
   at DiscUtils.SubStream.set_Position(Int64 ) at DiscUtils.Ntfs.NtfsFileSystem..ctor(Stream )
   at DiscUtils.SubStream.set_Position(Int64 ) at SplitVHD.Program.GetDataExtentsFromVhd()
   at DiscUtils.SubStream.set_Position(Int64 ) at SplitVHD.Program.DoRun()

Or

Reading 8,421 VHD allocation blocks
Analysing Master File Table
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at DiscUtils.Ntfs.NonResidentAttributeBuffer.RawRead(Int32 , Int64 , Byte[] , Int32 , Int32 , Boolean )
   at DiscUtils.Ntfs.NonResidentAttributeBuffer.DoReadCompressed(Int64 , Byte[] , Int32 , Int32 )
   at DiscUtils.Ntfs.NonResidentAttributeBuffer.Read(Int64 , Byte[] , Int32 , Int32 )
   at DiscUtils.Ntfs.NtfsAttributeBuffer.Read(Int64 , Byte[] , Int32 , Int32 )
   at DiscUtils.BufferStream.Read(Byte[] , Int32 , Int32 )
   at DiscUtils.Ntfs.File.FileStream.Read(Byte[] , Int32 , Int32 )
   at DiscUtils.Ntfs.NtfsFileStream.Read(Byte[] , Int32 , Int32 )
   at SplitVHD.Program.GetDataExtentsFromVhd()
   at SplitVHD.Program.DoRun()

Or

The SplitVHD.log shows a "Substream extends beyond end of parent stream" error:

Reading 4,481 VHD allocation blocks
Analysing Master File Table
System.ArgumentException: Substream extends beyond end of parent stream
   at DiscUtils.SubStream..ctor(Stream , Int64 , Int64 )
   at DiscUtils.Ntfs.MasterFileTable..ctor(INtfsContext )
   at DiscUtils.Ntfs.NtfsFileSystem..ctor(Stream )
   at SplitVHD.Program.GetDataExtentsFromVhd()
   at SplitVHD.Program.DoRun()

Cause

A source volume on the machine ( eg Drive C: or any other drives that Windows has added to the System State Backup ) are corrupt, although probably not seriously. It differs from the VHD standard, and cannot be read for splitting into component files as a consequence.

Solution

Run chkdsk on the machine, starting with the system volume (usually C:), and then any other volumes.

Running a chkdsk in read-only mode (which is possible without rebooting) will reveal if this is the cause of the problem.
Run the command "chkdsk" from the Command Prompt to run a read-only check.

If errors are found, run "chkdsk" with "/f" to fix errors.
More details can be found on the following MS Technet page: http://technet.microsoft.com/en-us/library/cc730714%28v=ws.10%29.aspx

When chkdsk completes, the disks should conform to format. Run a fresh backup.

After Windows Server Backup (WSB) writes out the VHD to disk, SplitVHD will be able to read the .VHD file successfully and split this into its component parts. This in turn will allow Attix5 Pro to de-duplicate the contents of the VHD and back up successfully.


Note: Please ensure that your Anti-Virus solution is excluded from accessing the WindowsImageBackup and VHDTemp directories on the system state backup volume. AV can also be the cause of reported “corruption” errors.


Scenario 2 - Small Incompatible VHD file created by Windows Server Backup

Symptom

During a WSB backup, the following error is encountered within the Backup Client log and the backup fails (Chkdsk has been run on the machine, but no errors have been found):
Error: 2012/06/19 10:05:31 [System State (using WSB) Plug-in] SplitVHD.exe has an error (exit code = 2). See backupservice.log for more detail.
Error: 2012/06/19 10:05:32 could not create backup: File collection interrupted

In the SplitVHD.log the following is reported:
Reading 51 VHD allocation blocks
Analysing Master File Table
System.ArgumentException: Substream extends beyond end of parent stream
   at DiscUtils.SubStream..ctor(Stream , Int64 , Int64 )
   at DiscUtils.Ntfs.MasterFileTable..ctor(INtfsContext )
   at DiscUtils.Ntfs.NtfsFileSystem..ctor(Stream )
   at SplitVHD.Program.GetDataExtentsFromVhd()
&nbs   at SplitVHD.Program.DoRun()

Note the number of VHD blocks - if this is less than 512, the file can be considered a small VHD file.

Cause

The Windows Server Backup System State backup process creates a small (approximately 100 MB) VHD file that is not compatible with Windows own VHD standard. This file cannot be split by the SplitVHD process that Attix5 Pro uses to reduce the size of the System State backup through de-duplication.

The file may be called "Esp.vhd", but may differ. You can test this from Command Prompt using this command:
wbadmin start systemstatebackup -backupTarget:E:
Where E: is the backup target volume.

Wait for the backup to complete, and check the E:\WindowsImageBackup\\ or E:\WindowsImageBackup\\SystemstateBackup\. Check for a small sized .VHD file. System State VHD files are typically 6 GB or greater. Any file of less than 512 MB should be considered small.

Solution

Note: Before attempting this solution, it is recommended to run Chkdsk to rule out any issues with the system disks themselves.

  1. Close the Attix5 Pro GUI and stop the Attix5 service.
  2. Navigate to the installation directory (by default C:\Program Files\Attix5 Pro\Backup Client SE\).
  3. Open the a5backup.properties file and add the following line:
    plugin.wbadmin.splitvhd.minfilesize=1073741824
  4. Save and close the file.
  5. Restart the service and open the GUI.
  6. Clear out the WindowsImageBackup directory, and run a fresh backup.

The small size VHD file will skip out the splitting phase, but will still be included in the backup as a monolithic VHD.


Scenario 3 – System State cannot be split due to ReFS format on system volume(s).

Symptom

During a WSB backup on a Windows Server 2012 machine, the following error is encountered within the Backup Client log and the backup fails (Chkdsk has been run on the machine, but no errors have been found):
Error: 12:35:40 [System State (using WSB) Plug-in] SplitVHDX.exe has an error (exit code = 2).
See backupservice.log for more detail.
Error: 12:35:40 SplitVHDX.exe failed

In the the SplitVHDX.log the following is reported:

Analysing Master File Table
System.TypeInitializationException:
The type initializer for 'DiscUtils.Numbers`1' threw an exception. ---> System.InvalidCastException:
Unable to cast object of type 'LongNoParamFn[System.Int64]' to type 'NoParamFn[System.Int64]'.
   at DiscUtils.Numbers`1.GetOne()
   at DiscUtils.Numbers`1..cctor()
   --- End of inner exception stack trace ---
   at DiscUtils.Range`2.<Chunked>d__0`1.MoveNext()
   at DiscUtils.Ntfs.NonResidentDataBuffer.get_Extents()
   at DiscUtils.Ntfs.NonResidentDataBuffer.GetExtentsInRange(Int64 , Int64 )
   at DiscUtils.Ntfs.NtfsAttributeBuffer.GetExtentsInRange(Int64 , Int64 )
   at SplitVHD.Program.GetDataExtentsFromVhd()
   at SplitVHD.Program.DoRun()

Cause

ReFS file system is in use on the system volume(s), which features internal de-duplication, and cannot be split using the SplitVHDX process.

Solution

For more information and how to resolve see FAQ Article 243 - ReFS support for System State Backups on Win Server 2012

Article ID: 204
Last updated: 29 Jan, 2015
Revision: 13
Views: 10877
Comments: 0
Posted: 22 Nov, 2012 by Flood A.
Updated: 29 Jan, 2015 by Flood A.
This article was:  
Prev   Next
Article 203 - Invalid encryption key for file error when restoring     Article 211 - Unable to start server: The type initializer for...