SQL BLOB bakup files constantly orphaned / leased

Hi,

I'm running SQL 2012 in a VM and constantly have issues with cleaning up BLOBs due to backup leases.  Is it normal for a large percentage of backup files to end up in this state?

Thanks,

Sam

March 30th, 2015 8:42pm

Hi Sam,

Would you be able to elaborate on what you are trying to do?

When you say cleaning up BLOBs, are you trying to Delete the BLOBs?
Or do you have issues when you try to connect another instance of SQL server to the same BLOB files after a previous instance crashed?

Would you be able to share the error messages?

Please be advised that the implementation of SQL Server Data Files in Windows Azure Storage feature requires a renewal of Blob lease every 45 to 60 seconds implicitly. So, to delete a blob that has an active lease, you must first break the lease.

It would be easier for us to assist you better if we have a detailed understanding of your issue.

Regards,
Malar.

Free Windows Admin Tool Kit Click here and download it now
March 31st, 2015 4:10am

Malar,

Yes, the error occurs when attempting to delete BLOBs.

The error was similar to this:

Msg 3202, Level 16, State 1, Line 1
Write on https://somestorage.blob.core.windows.net/somecontainer/MyDb.bak failed: Backup to URL received an exception from the remote endpoint. Exception Message: The remote server returned an error: (412) There is currently a lease on the blob and no lease ID was specified in the request..

The situation I'm having is as described here:  https://msdn.microsoft.com/en-us/library/jj919145.aspx

I just modified the powershell to just check leases and I have an additional lease on every backup file created since yesterday - on transaction log and full database backups.  This is non-prod database, so some of the transaction backup files are very small. 

I'm using standard methods to backup the databases and logs.

Thanks for your help,

Sam

March 31st, 2015 10:57am

Hi Sam,

Regret the delay and inconvenience caused.
You could refer the following link for the issue you are facing:

http://www.olcot.co.uk/sql-blogs/there-is-currently-a-lease-on-the-blob-and-no-lease-id-was-specified-in-the-request

Hope this helps.

Regards,
Malar.

Free Windows Admin Tool Kit Click here and download it now
April 13th, 2015 10:21am

Malar,

I'm using a piece of similar code to break leases.  When most people mention this issue, they say that it's happened a few times.  I just cleared out about 1,500 files that had orphaned backup leases on them.  It seems I have some other issue that is causing this to occur far more than normal.

Thanks,

Sam

April 13th, 2015 3:47pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics