Restore operation failing in VSS returns VSS_E_OBJECT_NOT_FOUND

2

I am trying backup and restore of a MS SQL server through VSS. My backup operation is running fine and I store the backup metadata in XML file. During restore operation I am providing the same XML I created during backup operation, what is happening is that restore is failing intermittently in PreRestore Stage returning VSS_E_OBJECT_NOT_FOUND. I have tried following things:

  1. Checked that if my VSS service is running correctly at the time of restore.
  2. Checked Microsoft Shadow Copy provider is running during restore.
  3. Checked if network services are running fine during restore.
  4. Checked on different forum what this error could be related to but most of the suggestion are like trying reboot the system.

The error comes on one of the following lines (intermittently), sometime it breaks at line1, sometime at line2 or sometime at line3, all these 3 api's I am calling before PreRestore event:

CHECK_COM(m_pVssObject->SetAdditionalRestores(myWriterId, VSS_CT_FILEGROUP, logicalPath, compName, true));
CHECK_COM(m_pVssObject->AddNewTarget(myWriterId, VSS_CT_FILEGROUP, logicalPath, compName, wszPath, wszFileNameMdf, false, wszAlternatePath));
CHECK_COM(m_pVssObject->AddNewTarget(myWriterId, VSS_CT_FILEGROUP, logicalPath, compName, wszPath, wszFileNameLdf, false, wszAlternatePath))

and this is the response it is returning.

INFO: VSS: ERROR: - Returned HRESULT = 0x80042308
INFO: VSS: ERROR: - Error text: VSS_E_OBJECT_NOT_FOUND
sql-server
windows
virtual-shadow-copies
asked on Stack Overflow Aug 12, 2020 by user2912611 • edited Aug 27, 2020 by user2912611

1 Answer

2

A common cause of the error VSS_E_OBJECT_NOT_FOUND (Returned HRESULT = 0x80042308) is that VSS has been disabled on one or more of the volumes that are part of the backup.

  1. Click Start.
  2. Right click My Computer, and choose Manage.
  3. Right click Shared Folders, choose All Tasks.
  4. Click Manage Volume Shadow Copies.
  5. For each volume that you want to backup, make sure that shadow copies are enabled. If some are not enagled, then highlight the volume(s) in the list and click the Enable button to enable shadow copies.

You can also test running the command vssadmin list writers.

answered on Stack Overflow Aug 21, 2020 by vvvv4d • edited Aug 21, 2020 by vvvv4d

User contributions licensed under CC BY-SA 3.0