SQL Server 2017 Developer SQL Server 2017 Enterprise SQL Server 2017 Enterprise Core SQL Server 2016 Developer SQL Server 2016 Enterprise SQL Server 2016 Enterprise Core SQL Server 2016 Standard More…Less
Symptoms
Assume that you use automatic backups for Microsoft SQL Server in virtual machines. If the backup database size is more than about 200 GB and the file is split into multiple files, after each backup a RESTORE HEADERONLY operation will fail in the background. Additionally, you may see error messages that resemble the following:
date time spid# Error: 18204, Severity: 16, State: 1.
date time spid# BackupDiskFile::OpenMedia: Backup device ‘Backup file address’ failed to open. Operating system error 2 (The system cannot find the file specified.).
Resolution
This fix is included in the following updates for SQL Server:
Cumulative Update 13 for SQL Server 2017
Cumulative Update 5 for SQL Server 2016 Service Pack 2
Cumulative Update 13 for SQL Server 2016 Service Pack 1
About SQL Server builds
Each new build for SQL Server contains all the hotfixes and security fixes that were in the previous build. We recommend that you install the latest build for your version of SQL Server:
SQL Server 2017 build versions
Latest cumulative update for SQL Server 2016
Status
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the «Applies to» section.
References
Learn about the standard terminology Microsoft uses to describe software updates.
Need more help?
- Remove From My Forums
-
Question
-
We currently backup our tape drive to a separate jump drive every night, it has been working fine for the past 7 months; the paths and permissions are all correct. The past week or two the backup has been failing because it states the process cannot
access the file because it is in use. There is not (or shouldn’t be) anything else trying to use this file at the time of backup.This is from the SQL 2005 Log:
Error: 18204, Severity: 16, State: 1.
BackupDiskFile::CreateMedia: Backup device ‘F:Nitely.bak’ failed to create. Operating system error 32(The process cannot access the file because it is being used by another process.).Error: 3041, Severity: 16, State: 1 .
BACKUP failed to complete the command BACKUP DATABASE WMS. Check the backup application log for detailed messagesThe strange thing is in our BACKUP EXEC. log it says the back was successfully completed, but the time-stamp on the backup file is from a previous day. I really would appreciate any insight to this matter because I am stumped.
Answers
-
Some other process is using that file for sure. Check if Antivirus is holding this file or the storage team is backing up this file seperately.
Since you are using BACKUP EXEC, check in Task Manager if multiple instances of BACKUP EXEC are running or not.
Pradeep Adiga http://www.sqldbadiaries.com
-
Marked as answer by
Thursday, August 5, 2010 2:13 AM
-
Marked as answer by
-
Perhaps a failure from an earlier effort. (Software does sometimes have problems, after all.) If so, one of those processes may indeed be holding a lock on the file.
You can try using the sysinternals tools to see which process has the lock. Or try using Unlocker:
http://www.filehippo.com/download_unlocker/Try clearing all the running BkupExec processes and then try your backup again. (No, I don’t really like killing processes directly, but sometimes … )
RLF
-
Marked as answer by
Tom Li — MSFT
Thursday, August 5, 2010 2:13 AM
-
Marked as answer by

WRITE FOR US
-
I have a maintenance plan that runs a cleanup task on the local server to delete all transaction files older than 4 days. As the backups are run hourly for 25 databases and this maintenance task runs daily, this results in 600 files being deleted. Although the deletions occur successfully I receive numerous «Error: 18204,Severity: 16, State: 1» messages in the event log, stating: «BackupDiskFile::OpenMedia: Backup device ‘K:PATHfilename.trn’ failed to open. Operationg system error 2(error not found).» I am running 2005 Standard Edition, SP3, 9.00.4035.00
-
please check maintenance plan job log..
u can find that in LOG folder in MSSQL base directory
C:ProgramFilesMicrosft SQL ServerMSSQLlog
please check the latest log file and error its s reporting..
or canu plaste the whole error message log, so that we can help you
-
Is this issue resolved?
Regards,Ganapathi varma, MCSAEmail: gana20m@gmail.com
-
Is the job running at the same time as any system backups ? volume shadow copy or and disk snapshots ?
-
gana20m — Thursday, May 4, 2017 12:49 AM
After 6 years, you would hope so…
…either that, or the OP is now working in a different field… and, given that he’s not been on this site for 4 years, it’s possible.
Thomas Rushton
blog: https://thelonedba.wordpress.com -
In my case the problem was I had created some manual backups without any file extension in the backup directory, this meant that the maintenance plan could not create directories with the same name.
So check what could be preventing the creation of files or folders, check permissions, check which user the sql agent is running as. -
Sue_H
SSC Guru
Points: 90860
Johnson Welch — Wednesday, January 9, 2019 12:49 AM
Except it is the clean up task (the deletes) failing, not the backup itself.
And it’s a failure to find the file, not an account not authorized. That’s why it is different OS errors with this post being operating system error 2 and not the error 1240 in that post.Sue
Viewing 8 posts — 1 through 7 (of 7 total)
Backup and restore operations even though they are supposed to be a no-brainer, it can leave you wanting to tear your hair out. Considering the different elements that influence the outcome of a successful backup operation like backup media, consistency of the backup, network issues (if backing up to a UNC path), consistency of the database being backed up etc.
I shall attempt to outline a set of troubleshooting steps specifically for non-native backup/restore related errors for SQL Server databases.
Any BACKUP command that completes successfully or with errors has associated messages logged in the SQL Server Errorlog.
A successful backup from the SQL Server Errorlog:
Database backed up. Database: adventureworks, creation date(time): 2010/05/28(03:00:18), pages dumped: 17291, first LSN: 67:7733:56, last LSN: 67:7761:1, number of dump devices: 1, device information: (FILE=1, TYPE=DISK: {‘F:adventureworks.bak’}).
You will see that the backup completion message has the database name, the number of pages that were contained in the backup, the date the backup was created and the number of devices and their type (in this case files). So you can reconstruct the sequence of backups even if your backup information history is missing from the MSDB system tables and you just have your SQL Server Errorlogs to play with. If you want to get real fancy about this, then you could spin up a nifty little Powershell or VBScript to parse through the SQL Errorlogs and provide the backup sequence to you as well.
Now, let’s look at a failed backup message from the SQL Errorlog.
Error: 18204, Severity: 16, State: 1.
BackupDiskFile::CreateMedia: Backup device ‘R:adventureworks.bak’ failed to create. Operating system error 3(The system cannot find the path specified.).
Error: 3041, Severity: 16, State: 1.
BACKUP failed to complete the command BACKUP DATABASE adventureworks.
You will notice above that the Operating System error code associated with the backup failure is reported in the error message. More often than not, the error message is self explanatory. If the error code doesn’t throw back an error text along with it, you can get the windows error code associated with the error code using net helpmsg <error number> from a command prompt window.
In the above case, there wasn’t any R: drive on my server. Now that I have finished stating the most obvious of troubleshooting methodologies for SQL native backups which was done to set the context for the next part of this post. The troubleshooting methodology for non-native backups.
Non-native SQL backups of databases use one of the following methods:
1. Use of APIs exposed through SQLVDI.dll to perform a VDI based backup
2. Use of VSS framework to perform a snapshot backup of the SQL Server database
Note: In this post, I shall not be addressing any storage level backup solutions that have options or features to handles SQL database backups.
This post is aimed at discussing the tackling of VSS/VDI related errors that you face while performing a database backup.
If a VDI backup fails, then you can try the following sequence of troubleshooting steps:
1. Attempt a backup to the same location using native SQL backup from a query window or SQLCMD. This might not always be possible as some of the backup tools do not allow any other backup application to connect to the backup share apart from the backup tool’s agents.
2. The next thing that you can do is to ensure that your SQLVDI.DLL is updated to the latest build. For this you can use the SQL Server Backup Simulator available on Code Gallery using the “Validate VDI Installation” option in the tool. This check in the tool will perform basic checks like current DLL version and additional checks based on root causes of common scenarios that CSS has seen in the past for VDI backup failures. Additional information on the usage of the tool is available here.
3. Perform a backup of the database using the tool for which the backup is failing (to the same destination if possible). The parameter tweaks at this point are not available in the current version like striped backups, changes to MAXTRANSFERSIZE/BUFFER COUNT etc. but if the backup from this tool is successful, then you know for a fact that the SQLVDI APIs are working as expected. Then it is either an additional piece of logic in the backup software that is failing or there is an external factors like network/backup media or there is a resource crunch on the SQL instance on which the database resides.
Common errors that you might see during a VDI backup operation failure:
Error message 1
BackupVirtualDeviceFile::ClearError: failure on backup device ‘VDI_ DeviceID ‘. Operating system error 995(The I/O operation has
been aborted because of either a thread exit or an application request.).
Error message 2
Error: 18210, Severity: 16, State: 1.
BackupMedium::ReportIoError: write failure on backup device ‘VDI_ DeviceID ‘. Operating system error 995(The I/O operation has been aborted because of either a thread exit or an application request.)
Error message 3
Error: 18210, Severity: 16, State: 1.
BackupVirtualDeviceFile::RequestDurableMedia: Flush failure on backup device ‘VDI_ DeviceID. Operating system error 995(The I/O operation has been aborted because of either a thread exit or an application request.)
The above errors are mostly due to outdated versions of SQLVDI.DLL on SQL Server 2000 or SQL Server 2005 instances. The “Validate VDI Installation” option in the Backup Simulator should be able to identify any known issues with DLL version mismatch for you.
If you have an application that uses Volume Shadow Service to backup your SQL database and that backup fails, then you your troubleshooting steps would be a bit different. The tell-tale sign of a VSS Snapshot backup is in the I/O Frozen message being written into the SQL Errorlogs for the databases being backed up. In such a failure scenario, take a backup of the database using Windows Server Backup Admin (Windows Server 2008 and above) or NTBackup utility to perform a backup of the database files involved. If this backup is successful, it means that a snapshot backup is successfully completing for the database. Now depending on your backup application’s implementation logic, this might be a resource crunch or a backup storage media incompatibility or even a resource crunch.
Common errors associated with VSS backups:
Issue# 1
Error: 3041, Severity: 16, State: 1.
Backup BACKUP failed to complete the command BACKUP DATABASE <database name>. Check the backup application log for detailed messages.
SubprocessMgr::EnqueueSubprocess: Limit on ‘Max worker threads’ reached.
This error message is raised when your backup application uses VSS to backup a large number of databases simultaneously. More information around this can be found in this post Volume Shadow barfs with 0x80040e14 code
Issue #2
While performing a Bare Metal backup you might run into issues if your SQL Server binaries are located on a different drive other than the C: drive. More information on the same is mentioned here: Location of SQL Binaries can flip out Bare Metal backups
Issue #3
Event Type: Error
Event Source: VSS
Event Category: None
Event ID: 6005
Description:
Sqllib error: Database %1 is stored on multiple volumes, only some of which are being shadowed.
The above error occurs when you backup only one of the volumes that contains SQL database data/log files which are spread over multiple volumes. This is explained in detailed in this post: Why is VSS complaining about SQL Data files
More information on how VSS/VDI work is present in the blog post by Sudarshan: INFORMATIONAL- SHEDDING LIGHT on VSS & VDI Backups in SQL Server
Previous posts related to Volume Shadow Backups
IO Frozen messages while taking NT Backup for SQL databases
Previous posts related to VDI backups
SQL VDI backup fails with 0×80770007
Hi,
I have two servers named SQL54 and SQL1006. The databases in SQL54 are enabled for log-shipping without secondary as we need log backups in short interval .
In SQL54
The default backup path is I:INST1_BackupSQLBackups
Log shipping log backup path is I:INST1_LSLS_LogShipping
** Now I have restored a database from SQL54 to SQL1006 with copy_only backup files.
The default backup path in SQL1006 is E:SQLBackup_BLM
After restoring, databases are fine but getting below error log alert..
Error: 18204, Severity: 16, State: 1.
2017-07-06 22:30:59.440 spid64 BackupDiskFile::CreateMedia: Backup device ‘I:INST1_BackupSQLBackupsVUE_ARCH_backup_logs_20170706_223059.bak’ failed to create. Operating system error 3(The system cannot find the path specified.).
2017-07-06 22:30:59.440 Backup Error: 3041, Severity: 16, State: 1.
2017-07-06 22:30:59.440 Backup BACKUP failed to complete the command BACKUP LOG VUE_ARCH. Check the backup application log for detailed messages
Please suggest 
