How to fix Error 3013 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 3013 — “%hs is terminating abnormally”

Why This Error Happens

Error 3013 is a generic wrapper error raised by SQL Server 2025 when a BACKUP or RESTORE operation fails to complete and the engine is forced to abort the task. The root cause is typically an underlying I/O failure, such as insufficient permissions on the backup target folder, a corrupted database page, a full disk volume, or an inaccessible/offline backup device (local path, UNC share, or Azure Blob container). Because this message only reports that the operation terminated, the real cause is usually found in the SQL Server Error Log or Windows Event Viewer entries logged immediately before Error 3013.

Step-by-Step Resolution Guide

Step 1: Review the SQL Server Error Log for the Preceding Root Cause

  • Open SQL Server Management Studio (SSMS) and navigate to Management > SQL Server Logs.
  • Look for errors logged directly before 3013, such as Error 3201 (cannot open backup device), Error 823/824 (I/O or checksum failure), or “Operating system error 5(Access is denied)”.
  • Alternatively, check the raw log file at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.

Step 2: Verify Disk Space and Backup Path Accessibility

  • Confirm the destination drive or UNC path has sufficient free space using Get-PSDrive in PowerShell or File Explorer.
  • If backing up to a network share, test connectivity manually: Test-Path "\\BackupServer\SQLBackups" in PowerShell.
  • Ensure the backup device/folder (e.g., D:\SQLBackups\) actually exists and is not offline, disconnected, or removed mid-operation.

Step 3: Correct Service Account Permissions

  • Open Services.msc and confirm which account runs the SQL Server (MSSQLSERVER) service.
  • Grant that service account (e.g., NT Service\MSSQLSERVER or a domain service account) Modify and Write permissions on the backup folder via right-click > Properties > Security tab.
  • For network shares, ensure both NTFS permissions and Share-level permissions include the SQL service account.
  • Restart the SQL Server service after applying permission changes: Restart-Service MSSQLSERVER -Force.

Step 4: Check for Database Corruption

  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to rule out page-level corruption as the trigger for the abnormal termination.
  • If corruption is found, restore from the last known good backup or run targeted repair options as advised by the DBCC output.

Step 5: Re-run the Operation with Extended Logging

  • Re-execute the BACKUP/RESTORE command manually in SSMS (not via a scheduled job) to capture the full, real-time error text instead of the truncated job history message.
  • Add WITH STATS = 10 to the backup command to monitor progress and identify the exact point of failure.

Alternative or Verification Steps

  • Verify the fix: Successfully run a full backup (BACKUP DATABASE [YourDB] TO DISK = 'D:\SQLBackups\test.bak') and confirm it completes without errors, then check the Error Log to ensure no new 3013 entries appear.
  • Alternative solution: If the backup target is a mapped network drive, switch to a UNC path directly in the backup command, as SQL Server service accounts often cannot resolve mapped drive letters even if the interactive user can.