A nonrecoverable i/o error occurred on file backup to url
Learn about best practices and troubleshooting tips for SQL Server backup and restores to Azure Blob Storage. seo-lt-2019 event-tier1-build-2022 05/24/2022 sql backup-restore conceptual WilliamDAssafMSFT wiassaf SQL Server back up to URL for Microsoft Azure Blob Storage best practices and troubleshooting[!INCLUDE SQL Server SQL MI] This article includes best practices and troubleshooting tips for SQL Server backup and restores to Microsoft Azure Blob Storage. For more information about using Azure Blob Storage for SQL Server backup or restore operations, see:
Managing BackupsThe following list includes general recommendations to manage backups:
Handling Large Files
Troubleshooting Backup To or Restore from URLFollowing are some quick ways to troubleshoot errors when backing up to or restoring from the Azure Blob Storage. To avoid errors due to unsupported options or limitations, review the list of limitations, and support for BACKUP and RESTORE commands information in the SQL Server Backup and Restore with Microsoft Azure Blob Storage article. Initialization failed Parallel backups to the same blob cause one of the backups to fail with an Initialization failed error. If you're using page blobs, for example, BACKUP DATABASE TestDb TO URL = 'https://mystorage.blob.core.windows.net/mycontainer/TestDbBackupSetNumber2_0.bak', URL = 'https://mystorage.blob.core.windows.net/mycontainer/TestDbBackupSetNumber2_1.bak', URL = 'https://mystorage.blob.core.windows.net/mycontainer/TestDbBackupSetNumber2_2.bak' WITH COMPRESSION, MAXTRANSFERSIZE = 4194304, BLOCKSIZE = 65536;4, use the following error logs to help with troubleshooting backup errors: Set trace flag 3051 to turn on logging to a specific error log with the following format in: BACKUP DATABASE TestDb TO URL = 'https://mystorage.blob.core.windows.net/mycontainer/TestDbBackupSetNumber2_0.bak', URL = 'https://mystorage.blob.core.windows.net/mycontainer/TestDbBackupSetNumber2_1.bak', URL = 'https://mystorage.blob.core.windows.net/mycontainer/TestDbBackupSetNumber2_2.bak' WITH COMPRESSION, MAXTRANSFERSIZE = 4194304, BLOCKSIZE = 65536;5 Where BACKUP DATABASE TestDb TO URL = 'https://mystorage.blob.core.windows.net/mycontainer/TestDbBackupSetNumber2_0.bak', URL = 'https://mystorage.blob.core.windows.net/mycontainer/TestDbBackupSetNumber2_1.bak', URL = 'https://mystorage.blob.core.windows.net/mycontainer/TestDbBackupSetNumber2_2.bak' WITH COMPRESSION, MAXTRANSFERSIZE = 4194304, BLOCKSIZE = 65536;6 is one of the following:
You can also find information by reviewing the Windows Event Log - Under Application logs with the name BACKUP DATABASE TestDb TO URL = 'https://mystorage.blob.core.windows.net/mycontainer/TestDbBackupSetNumber2_0.bak', URL = 'https://mystorage.blob.core.windows.net/mycontainer/TestDbBackupSetNumber2_1.bak', URL = 'https://mystorage.blob.core.windows.net/mycontainer/TestDbBackupSetNumber2_2.bak' WITH COMPRESSION, MAXTRANSFERSIZE = 4194304, BLOCKSIZE = 65536;7. The request could not be performed because of an I/O device error. Consider COMPRESSION, MAXTRANSFERSIZE, BLOCKSIZE, and multiple URL arguments when backing up large databases. See Backing up a VLDB to Azure Blob Storage The error: Msg 3202, Level 16, State 1, Line 1 Write on "https://mystorage.blob.core.windows.net/mycontainer/TestDbBackupSetNumber2_0.bak" failed: 1117(The request could not be performed because of an I/O device error.) Msg 3013, Level 16, State 1, Line 1 BACKUP DATABASE is terminating abnormally. An example resolution: BACKUP DATABASE TestDb TO URL = 'https://mystorage.blob.core.windows.net/mycontainer/TestDbBackupSetNumber2_0.bak', URL = 'https://mystorage.blob.core.windows.net/mycontainer/TestDbBackupSetNumber2_1.bak', URL = 'https://mystorage.blob.core.windows.net/mycontainer/TestDbBackupSetNumber2_2.bak' WITH COMPRESSION, MAXTRANSFERSIZE = 4194304, BLOCKSIZE = 65536; Message Filemark on device is not aligned. When restoring from a compressed backup, you might see the following error:
To solve this error, reissue the RESTORE statement with BLOCKSIZE = 65536 specified. Failed backup activity can result in blobs with active leases. Error during backup due to blobs that have active lease on them: BACKUP DATABASE TestDb TO URL = 'https://mystorage.blob.core.windows.net/mycontainer/TestDbBackupSetNumber2_0.bak', URL = 'https://mystorage.blob.core.windows.net/mycontainer/TestDbBackupSetNumber2_1.bak', URL = 'https://mystorage.blob.core.windows.net/mycontainer/TestDbBackupSetNumber2_2.bak' WITH COMPRESSION, MAXTRANSFERSIZE = 4194304, BLOCKSIZE = 65536;8 If a backup statement is reattempted, backup operation might fail with an error similar to the following:
If a restore statement is attempted on a backup blob file that has an active lease, the restore operation fails with an error similar to the following: BACKUP DATABASE TestDb TO URL = 'https://mystorage.blob.core.windows.net/mycontainer/TestDbBackupSetNumber2_0.bak', URL = 'https://mystorage.blob.core.windows.net/mycontainer/TestDbBackupSetNumber2_1.bak', URL = 'https://mystorage.blob.core.windows.net/mycontainer/TestDbBackupSetNumber2_2.bak' WITH COMPRESSION, MAXTRANSFERSIZE = 4194304, BLOCKSIZE = 65536;9 When such error occurs, the blob files need to be deleted. For more information on this scenario and how to correct this problem, see Deleting Backup Blob Files with Active Leases OS error 50: The request is not supported When backing up a database, you may see error 0 for the following reasons:
Authentication errors The 2 is a new option and required to back up to or restore from the Azure Blob Storage.Failures related to credential could be the following: 3To avoid this issue, you can include T-SQL statements to create the credential if one does not exist in the backup statement. The following is an example you can use: IF NOT EXISTS (SELECT * FROM sys.credentials WHERE credential_identity = 'mycredential') CREATE CREDENTIAL [<credential name>] WITH IDENTITY = 'mystorageaccount' , SECRET = ' The credential exists but the login account that is used to run the backup command does not have permissions to access the credentials. Use a login account in the db_backupoperator role with Alter any credential permissions. Verify the storage account name and key values. The information stored in the credential must match the property values of the Azure storage account you are using in the backup and restore operations. 400 (Bad Request) errors Using SQL Server 2012 you may encounter an error performing a backup similar to the following:
This is caused by the TLS version supported by the Azure Storage Account. Changing the supported TLS version or using the workaround listed in KB4017023. Proxy ErrorsIf you are using Proxy Servers to access the internet, you may see the following issues: Connection throttling by Proxy Servers Proxy Servers can have settings that limit the number of connections per minute. The Backup to URL process is a multi-threaded process and hence can go over this limit. If this happens, the proxy server kills the connection. To resolve this issue, change the proxy settings so SQL Server is not using the proxy. Following are some examples of the types or error messages you may see in the error log: Write on "https://storageaccount.blob.core.windows.net/container/BackupAzurefile.bak" failed: Backup to URL received an exception from the remote endpoint. Exception Message: Unable to read data from the transport connection: The connection was closed. A nonrecoverable I/O error occurred on file "https://storageaccount.blob.core.windows.net/container/BackupAzurefile.bak:" Error could not be gathered from Remote Endpoint. Msg 3013, Level 16, State 1, Line 2 BACKUP DATABASE is terminating abnormally. BackupIoRequest::ReportIoError: write failure on backup device https://storageaccount.blob.core.windows.net/container/BackupAzurefile.bak'. Operating system error Backup to URL received an exception from the remote endpoint. Exception Message: Unable to read data from the transport connection: The connection was closed. If you turn on the verbose logging using the trace flag 3051, you may also see the following message in the logs: 4Default Proxy Settings not picked up: Sometimes the default settings are not picked up causing proxy authentication errors such as the one shown below: 5To resolve this issue, create a configuration file that allows the Backup to URL process to use the default proxy settings using the following steps:
|