Skip to main content

SQL Restore Fails with 'Access is denied' (Event ID 24583 / Error SQL35)

SQL Restore Fails with 'Access is denied' (Event ID 24583 / Error SQL35)

Updated this week

Problem description

  • When performing a restore of a Microsoft SQL Server database using Druva, the restore job fails. In the Druva management console, the job shows the error code SQL35 with the message: Database state error.

  • This error indicates that the Druva agent could not verify the database's status after the restore operation. The underlying cause is typically found in the Windows Application Event Log on the target SQL server, where an error from the SQLWRITER source is logged with Event ID 24583. The details for this event contain the message "operating system error 5(Access is denied.)".

Cause

  • The root cause of this failure is that the service account under which the target Microsoft SQL Server service is running does not have the required read/write permissions on the file system directory where the restore is being performed.

  • The SQL35: Database state error. is a higher-level error reported by the Druva agent. It occurs because the initial RESTORE DATABASE command failed due to the "Access is denied" permission issue. Since the database never came online, the agent's subsequent check of its state also fails, resulting in the SQL35 code.

Traceback

You will find evidence of this issue in these locations:

Windows Application Event Log on the target SQL Server: This log shows the root cause of the failure.

LogName        :Application
Source : SQLWRITER
Event ID : 24583
Level : Error
Error message : Directory lookup for the file "<Drive>:\<Path>\<DatabaseFileName>.mdf" failed with the operating system error 5(Access is denied.).


​Druva sqlclient_plugin_job.log from the failed job's detailed logs: This log shows the agent-level error that corresponds to the SQL35 code in the UI.

level=errorts=2025-08-13T15:44:17.4292234Zfilename=restore_agent.go:700layer=restoremessage="RestoreOperationFailed"error="Code:4295163939\nOriginal:DatabasestateError.\nMessage:DatabasestateError.\n"

Resolution

To resolve this issue, you must grant the necessary permissions to the account running the Microsoft SQL Server service.

  1. On the target SQL server, open the Services console (services.msc).

  2. Locate the service for your SQL Server instance (e.g., SQL Server (MSSQLSERVER) or SQL Server (MyInstance)).

  3. Note the account name listed in the Log On As column.

  4. Navigate to the destination folder for your restore (e.g., D:\SQL\Restore).

  5. Right-click the folder and select Properties > Security.

  6. Click Edit..., then Add... and add the SQL Server service account you identified in Step 3.

  7. Grant this account Full Control permissions and ensure these permissions are inherited by all subfolders and files.

Verification

  1. After applying the permissions, trigger the SQL restore job again from the Druva console.

  2. Monitor the job progress. The job should now complete successfully without the SQL35 or Access is denied errors.

  3. Log in to the SQL server and confirm that the restored database is online and accessible.

See also

Did this answer your question?