Skip to content
Microsoft SQL Server

SQL Server Error 3013

BACKUP DATABASE / RESTORE DATABASE is terminating abnormally

Severity 16 Backup & Restore
Applies to: All supported SQL Server versions (2016 to 2025), Azure SQL Managed Instance
Last technically reviewed 24 October 2026 on SQL Server 2025 (17.0.1145.4)
The full message
Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.
Other forms of this message
Restoring a full or differential backup
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
Log backup and log restore
Msg 3013, Level 16, State 1, Line 1
BACKUP LOG is terminating abnormally.

Msg 3013, Level 16, State 1, Line 1
RESTORE LOG is terminating abnormally.
RESTORE HEADERONLY and RESTORE FILELISTONLY (reproduced; note FILELIST without ONLY)
Msg 3013, Level 16, State 1, Line 1
RESTORE HEADERONLY is terminating abnormally.

Msg 3013, Level 16, State 1, Line 1
RESTORE FILELIST is terminating abnormally.
RESTORE VERIFYONLY (reproduced)
Msg 3013, Level 16, State 1, Line 1
VERIFY DATABASE is terminating abnormally.
SQL Server error log after a failed backup (reproduced)
Backup Error: 3041, Severity: 16, State: 1.
BACKUP failed to complete the command BACKUP DATABASE AppDb. Check the backup application log for detailed messages.
SQL Server error log, logged with it when the backup device cannot be created (reproduced)
Error: 18204, Severity: 16, State: 1.
BackupDiskFile::CreateMedia: Backup device 'Z:\Backups\AppDb.bak' failed to create. Operating system error 3(The system cannot find the path specified.).
Error number
3013
Severity
16 (user-correctable error)
State
1
Product
Microsoft SQL Server Database Engine
Versions
All supported SQL Server versions (2016 to 2025), Azure SQL Managed Instance
Last reviewed
24 October 2026

What it means

Error 3013 is the closing line of every failed BACKUP or RESTORE: it says the operation stopped, and the real reason is always in the error printed just before it.

When a backup or restore fails, SQL Server first raises an error that describes the problem (a file it cannot open, a database in use, a broken log chain) and then ends the statement with 3013, naming the operation: BACKUP DATABASE, BACKUP LOG, RESTORE DATABASE, RESTORE LOG, RESTORE HEADERONLY, RESTORE FILELIST or VERIFY DATABASE (that last one comes from RESTORE VERIFYONLY). 3013 itself carries no detail, so searching for it alone leads nowhere. Scroll up.

Read the output from the top. The first error after your statement is the cause; 3013 is always last. Some restores print several errors: a message per file, then Msg 3119 ... Previous messages provide details, then 3013. In that case 3119 is a pointer too, and the messages above it are the ones to fix. Applications and job history often keep only the last line; if all you have is 3013, get the full output by running the statement in a query window, or look at the job step output and the SQL Server error log (where a failed backup is logged as error 3041).

Common causes

  • Error 3201 before 3013: the backup file or folder cannot be opened (wrong path, missing drive, no permission for the service account).
  • Error 3241 before 3013: the file is not a usable backup (damaged, cut short in transit, or written by a newer version or another tool).
  • 3154, 3159 or 3101 before 3013: a RESTORE safety check (another database, an un-backed-up log tail, or sessions still connected).
  • 4214, 4208, 4305 or 3117 before 3013: the log chain or the recovery model does not allow this log backup or restore step.
  • Errors about files (1834, 5133, 3234, then 3156 and 3119) before 3013: the restore cannot create the database files at the paths given or stored in the backup.
  • Errors about space or I/O, such as 3202 or 3203, before 3013: the backup volume is full, or reading or writing the media failed.

Diagnose it

Read-only These queries only read metadata and dynamic management views. They do not change data, permissions or configuration, so they are safe to run first.

Find the first error in the SQL Server error log

Useful when an Agent job or application reports only 3013. Read-only searches of the current error log.

EXEC sp_readerrorlog 0, 1, N'BACKUP failed';
EXEC sp_readerrorlog 0, 1, N'BackupDiskFile';
What to look for

Each failed backup leaves a 3041 entry naming the command and database. Device problems also leave an Error: 18204 entry with the path and the operating system error. Other failures (in our test, BACKUP LOG in SIMPLE recovery) leave only the 3041 line, so run the statement in a query window to see the cause.

Recent backups of the database, and whether they finished

SELECT TOP (10) bs.type, bs.backup_start_date, bs.backup_finish_date,
       bs.is_damaged, bs.has_backup_checksums,
       CAST(bs.backup_size / 1048576.0 AS decimal(18, 1)) AS size_mb,
       mf.physical_device_name
FROM msdb.dbo.backupset AS bs
JOIN msdb.dbo.backupmediafamily AS mf ON mf.media_set_id = bs.media_set_id
WHERE bs.database_name = N'AppDb'
ORDER BY bs.backup_finish_date DESC;
What to look for

Failed backups leave no row here, so the gap since the last successful one shows how long it has been failing. size_mb helps judge whether the target volume can hold the next one.

Free space on the server's drives

EXEC master.sys.xp_fixeddrives;
What to look for

MB free per drive letter. A backup drive with less free space than the last backup size explains a backup that fails part way (errors 3202 or 3203 before the 3013).

Backups and restores running now

SELECT r.session_id, r.command, r.status, r.percent_complete, r.wait_type,
       DB_NAME(r.database_id) AS database_name, r.start_time
FROM sys.dm_exec_requests AS r
WHERE r.command LIKE N'BACKUP%' OR r.command LIKE N'RESTORE%';
What to look for

Another backup or restore of the same database, or a long-running one that a job timed out on, can make a second operation fail or be cancelled.

How to fix it

Each fix is labelled with what it changes. Try read-only checks and the least invasive fix first, and test changes outside production.

Fix the error that came before 3013

Read-only

3013 has no fix of its own. Take the first error in the output and follow its page: for example 3201 for paths and permissions, 3154 for restoring over another database, 3159 for the tail of the log, 4214 for a missing full backup. Once the first error is gone, 3013 goes with it.

Get the full output when a job shows only 3013

Client or network side

In SQL Server Agent, set an output file on the backup job step (Advanced page) so every message is kept, or run the same statement in a query window. Maintenance plans write a report text file per run; its location is in the plan's reporting settings.

Verify the backup file before relying on it

Client or network side

Write backups WITH CHECKSUM and check them with RESTORE VERIFYONLY. VERIFYONLY reads the whole backup and changes no database; if it fails, its own first error says why. Only a test restore proves a backup can be restored.

BACKUP DATABASE AppDb
TO DISK = N'D:\Backups\AppDb_full_20261024.bak'
WITH CHECKSUM;

RESTORE VERIFYONLY
FROM DISK = N'D:\Backups\AppDb_full_20261024.bak'
WITH CHECKSUM;

Examples

3201 then 3013: backing up to a drive that does not exist

Throwaway database. Drive Z: does not exist on the test server. The first message is the cause; 3013 only closes the statement.

-- Throwaway database; drive Z: does not exist
BACKUP DATABASE AppDb TO DISK = N'Z:\Backups\AppDb.bak';
Result
Msg 3201, Level 16, State 1, Line 2
Cannot open backup device 'Z:\Backups\AppDb.bak'. Operating system error 3(The system cannot find the path specified.).
Msg 3013, Level 16, State 1, Line 2
BACKUP DATABASE is terminating abnormally.

Reproduced on SQL Server 2025 (17.0.1145.4), 23 October 2026.

3187 then 3013: verifying with CHECKSUM a backup written without checksums

Throwaway database; the backup goes to the instance default backup folder. The test server has the backup checksum default setting off, so the backup has no checksums. The operation is called VERIFY DATABASE in the 3013 line.

DECLARE @bak nvarchar(260) = CAST(SERVERPROPERTY('InstanceDefaultBackupPath') AS nvarchar(200)) + N'\cws_errlab_3013.bak';
BACKUP DATABASE AppDb TO DISK = @bak WITH INIT;   -- no CHECKSUM option
RESTORE VERIFYONLY FROM DISK = @bak WITH CHECKSUM;
Result
Msg 3187, Level 16, State 1, Line 3
RESTORE WITH CHECKSUM cannot be specified because the backup set does not contain checksum information.
Msg 3013, Level 16, State 1, Line 3
VERIFY DATABASE is terminating abnormally.

Reproduced on SQL Server 2025 (17.0.1145.4), 23 October 2026.

3234 then 3013: a MOVE clause with the wrong logical file name

Throwaway database; the backup goes to the instance default backup folder. The data file is really called AppDb, not AppDb_Data; RESTORE FILELISTONLY shows the right name. The copy (cws_errlab_copy) is never created because the restore stops while planning.

USE master;
DECLARE @bak nvarchar(260) = CAST(SERVERPROPERTY('InstanceDefaultBackupPath') AS nvarchar(200)) + N'\cws_errlab_3013.bak';
BACKUP DATABASE AppDb TO DISK = @bak WITH INIT;

RESTORE DATABASE cws_errlab_copy FROM DISK = @bak
WITH MOVE N'AppDb_Data' TO N'D:\SQLData\AppDb_Copy.mdf';
Result
Msg 3234, Level 16, State 2, Line 5
Logical file 'AppDb_Data' is not part of database 'cws_errlab_copy'. Use RESTORE FILELISTONLY to list the logical file names.
Msg 3013, Level 16, State 1, Line 5
RESTORE DATABASE is terminating abnormally.

Reproduced on SQL Server 2025 (17.0.1145.4), 23 October 2026.

How to prevent it

Make backup jobs keep their complete output (job step output files or your backup tool's log), and alert on the first error number rather than on 3013, so the alert already says what is wrong. Monitor free space on backup volumes and the age of the last successful backup per database.

Test restores on a schedule. Most of the errors that precede 3013 on a restore (missing files, wrong paths, broken log chains, damaged media) are found cheaply in a test and expensively during an outage.

Common questions

My job history says only "BACKUP DATABASE is terminating abnormally". Where is the reason?

Job history can cut long output short. Look at the SQL Server error log for the time of the failure, add an output file to the job step, or run the backup statement in a query window to see every message.

Is a backup file usable if the backup ended with 3013?

No. The backup did not complete, so it is not listed as a backup set in msdb, and anything written to the file must not be relied on. Fix the cause and take the backup again.

Why does 3013 say VERIFY DATABASE when I ran RESTORE VERIFYONLY?

That is the name the engine uses for the verify operation. Likewise RESTORE FILELISTONLY is reported as RESTORE FILELIST.

Learn more on CodeWithSQL

Official documentation

Last technically reviewed 24 October 2026; examples and diagnostics run on SQL Server 2025 (17.0.1145.4). Message text checked against the engine's sys.messages catalogue.

Still stuck on a SQL Server error?

Browse the full SQL Server error library, or get hands-on help from an experienced SQL professional.