Skip to main content

 

Druva Documentation

Troubleshoot common SQL server issues

This topic describes the workaround for the issues that you might encounter while backing up or restoring your SQL servers.

Troubleshoot backup issues

This section describes the common issues that you might encounter while backing SQL servers. It also contains workarounds for these issues.

Backup fails because the drive is unavailable

Backup of database files from an unavailable drive fail. This is because VSS cannot detect the databases that reside on the offline drive. VSS cannot detect the databases that reside on the offline drive.

Note: The VSS service and the SQL Writer service takes some time to recognize that a drive from which a backup is initiated is unavailable. After the VSS service and the SQL Writer service detect the unavailable drive, the status of the databases on these drives is set to "Restoring" (in the Microsoft SQL Server Management Studio). For the next backup, Phoenix ignores these databases, and backs up the other databases.

You can find the error details in the log file that is created at C: \ProgramData\Phoenix\logs

Resolution

  1. Wait for some time until the VSS service and the SQL Writer service register the drive information.VSS service and the SQL Writer service register the drive information.
  2. Wait for the next scheduled backup, and check the backup status after the backup completes.
    -or-
    Start a backup, and check the backup status after the backup completes.

Backup fails because some databases belong to a deleted drive

A backup fails if database files belong to a drive that is deleted.

You can find the error details in the log file that is created at C: \ProgramData\Phoenix\logs

Resolution

  1. Recover the databases from the deleted drive using SQL commands or the Microsoft SQL Server Management Studio.
  2. Wait for the next scheduled backup, and check the backup status after the backup completes.
    -or-
  3. Start a backup, and check the backup status after the backup completes.

Backup fails because some databases belong to an unavailable drive

A backup fails if database files belong to a drive that was previously unavailable but becomes available later.

You can find the error details in the log file that is created at C: \ProgramData\Phoenix\logs

Resolution

  1. Make the databases from the affected drive offline using SQL commands or the Microsoft SQL Server Management Studio.
  2. Make the databases from the affected drive online using SQL commands or the Microsoft SQL Server Management Studio.
  3. Wait for the next scheduled backup and check the backup status after the backup completes.
    -or-
  4. Start a backup and check the backup status after the backup completes.

Backup fails because of SQL writer issues

If the SQL Writer service is not running, a backup operation fails with the following error: Writers are not in correct state

This happens because the SQL Writer service, the Volume Shadow Copy Service, or the Phoenix service encounter errors. You can find the error details in the log file that is created at C: \ProgramData\Phoenix\logs

Resolution

  1. Start the Phoenix service.
  2. Start the SQL Writer Service.
  3. Start the VSS service. VSS service. 

Backup fails because of VSS issues

Sometimes, a backup operation fails with the following error: VssException: StartSnapshotSet = 0x80042316L

This happens because either the SQL Writer service, the Phoenix service, or the VSS service is not running. 

You can find the error details in the log file that is created at C: \ProgramData\Phoenix\logs

Resolution

  • Ensure that the SQL Writer service, the Phoenix service, and the VSS service is running. 

Backup fails because of VSS exceptions

Sometimes, a backup operation fails with either of the following errors: 

VssException: StartSnapshotSet = 0x80042316L

Error <class 'roboClientLib.pyvss.pyvss.VssException'>:CoInitializeSecurity = 0x80010119L

This happens because the VSS service, the SQL Writer service, or the Phoenix service encounters errors. You can find the error details in the log file that is created at VSS service, the SQL Writer service, or the Phoenix service encounters errors. You can find the error details in the log file that is created at C: \ProgramData\Phoenix\logs

Resolution

  1. Start the Phoenix service.
  2. Start the SQL Writer Service.
  3. Start the VSS service.

Backup fails because databases or instances are not found

Sometimes, a backup operation fails because Phoenix cannot find a database or an instance at the location that you specified during configuration. The following error is displayed: No instances/databases found for the backup

You can find the error details in the log file that is created at C: \ProgramData\Phoenix\logs

Resolution

Start the MSSQLServer service of the instance or database that are not found. 

Backup fails because the SQLCMD path is not set

If the system variable path to the SQLCMD utility is not set properly, backups fail with the following error:

'sqlcmd' is not recognized as an internal or external command

You can find the error details in the log file that is created at C: \ProgramData\Phoenix\logs

Resolution

Backup fails because of SQLCMD issue

Sometimes, a backup might fail with the following error: 

Sqlcmd: Error: Internal error at ExecuteSqlCmd (Reason: Unspecified error)

This is an error with the SQL server. 

You can find the error details in the log file that is created at C: \ProgramData\Phoenix\logs

Resolution

Start the backup again. 

Troubleshoot restore issues

This section describes the common issues that you might encounter while restoring SQL servers. It also contains workarounds for these issues.

Restore fails because databases are in the restoring state

If you initiate a restore to an instance that contains databases in the restoring state in the Microsoft SQL Server Management Studio, the restore operation that you initiated fails. You can find the error details in the log file that is created at C: \ProgramData\Phoenix\logs

Resolution

  1. From the SQL server, remove all databases that are in the restoring state. 
    Alternatively, wait till the databases are restored. 
  2. Start the restore again. For instructions, see Backup and restore

Restore completes, but databases are not created

Phoenix restores databases as rst_<Database_name>_<Restore_occurrence_count>. However, if the size of a database that you want to restore is small, the restored database is not created at the location that you specified. You can find the error details in the log file that is created at C: \ProgramData\Phoenix\logs.  

Resolution

  1. Start the MSSQLServer service. 
    Alternatively, attach the database files to a database within an instance. For instructions, see this article in the Microsoft library. 

Restore fails with errors

Sometimes, restores might fail with the following error message: Restore failed [('Attempting to restore to instance [%s] not found'.

This happens when instances to which you want to restore are offline. You can find the error details in the log file that is created at C: \ProgramData\Phoenix\logs.

Resolution

  1. Ensure that the instance to which you want to restore is available.
  2. Start the restore again.

Restore fails because the VSS service is not running

Sometimes, restores fail with the following error: VSS service is not running

This happens because the Volume Shadow Copy Service is not running. You can find the error details in the log file that is created at C: \ProgramData\Phoenix\logs

Resolution

Start the VSS service. 

Restore fails because of SQL Writer issues 

Sometimes, restores fail with the following error: Writers are not in correct state.

This happens because the SQL Writer service, the Volume Shadow Copy Service, or the Phoenix service encounter errors. You can find the error details in the log file that is created at C: \ProgramData\Phoenix\logs

Resolution

  1. Start the Phoenix service.
  2. Start the SQL Writer Service.
  3. Start the VSS service. 

Restore fails because the hostname of the original server is changed

If you select to restore to the original instance on a SQL server for which the host name was changed, the restore operation fails with the following error: Host does not match with the original backup server

You can find the error details in the log file that is created at C: \ProgramData\Phoenix\logs

Resolution

Restore the database using the Restore database files option. For instructions, see Microsoft SQL server restore

Restore fails because of path length

A restore operation might fail if the path to the restore destination is more than 260 characters. The following error is displayed on the Phoenix Master Management Console: Writers are not in correct state

You can find the following error message in the log file (created at C: \ProgramData\Phoenix\logs): Restore may fail because filepath = ‘(some restore file path)’  have length greater than equal to 260 character

At the time of restore, Phoenix writes the data to: <destination path>\<snapshot>\<Request ID>\<Fileset>\<Actual file>. You must provide <destination_path>, to which Phoenix appends <snapshot>\<Request ID>\<Fileset>\<Actual file>. The <destination path> must be such that the complete path (<destination path>\<snapshot>\<Request ID>\<Fileset>\<Actual file>) is no more than 260 characters long. 

Resolution

Make sure that <destination path> is such that the complete path (<destination path>\<snapshot>\<Request ID>\<Fileset>\<Actual file>) is no more than 260 characters long. 

Restore fails because of insufficient free space

If the location to which you choose to restore your database does not have sufficient space, a restore operation fails with the following error: Not enough space is available for restore data files on disk

You can find the error details in the log file that is created at C: \ProgramData\Phoenix\logs

Resolution

Specify a location where sufficient space is available.
Alternatively, create space at the location by deleting files and folders.

Restore fails because of VSS issues

Sometimes, a restore operation to original instance might fail with the following error: VssException: StartSnapshotSet = 0x80042316L

This happens because either the SQL Writer service, the Phoenix service, or the VSS service are not running. 

You can find the error details in the log file that is created at C: \ProgramData\Phoenix\logs

Resolution

  • Stop and start the SQL Writer service.
  • Stop and start the Phoenix service.
  • Stop and start the the VSS service. 

Restore fails because of VSS exceptions

Sometimes, a restore to the original instance might fail with either of the following errors: 

VssException: StartSnapshotSet = 0x80042316L

Error <class 'roboClientLib.pyvss.pyvss.VssException'>:CoInitializeSecurity = 0x80010119L

This happens because the VSS service, the SQL Writer service, or the Phoenix service encounters errors. You can find the error details in the log file that is created at C: \ProgramData\Phoenix\logs

Resolution

  1. Start the Phoenix service.
  2. Start the SQL Writer Service.
  3. Start the VSS service.

Restore might fail if you initiate a restore after an earlier failed restore operation

Sometimes, restore might fail if you initiate a restore after an earlier failed restore operation . 

Resolution

Before you initiate a restore after a previous failed attempt, ensure that the disk space at the restore location is sufficient for the restore dataset.