Untested Backups with IonicZip
-
Over a decade ago, I wrote a SQL Server backup/rotation manager. Backups are zipped and password protected using IonicZip, then copied to a local repository on another disk, and optionally pushed out to an FTP resource. This is handy for when I find myself working on the laptop away from the home/office. This system has been used on multiple servers without issues. A couple of weeks ago, I started using it on a newish Azure VM for one of our latest projects to manage 2 customer databases. It appeared to be working fine...backups/zips/copies all getting created with no errors...or so I thought. Yesterday, I was away from the office and decided to grab the previous day's backups and restore them on my laptop. Using 7-zip, the zips extracted, but with a CRC error detected. :confused: Of course, the backups were useless. Native windows zip refused to extract anything, failing with a generic error message. 'unrecognized error'. :wtf: Every backup from that system was corrupted! :omg: Backups from the other 2 systems are/were fine...one of the other systems is also an Azure VM with practically identical setups and has been working fine for years. :confused: I'll skip the troubleshooting details and get to the fix. IonicZip has a property that I had never heard of before, and which until now had not been important: ParallelDeflateThreshold which needed to be set to -1. Doing so fixed the problem. If I understand correctly, IonicZip has a known problem with files that compress to < 4MB. In my case, mine were slightly over 2MB compressed. All of my other backups are much larger which is perhaps the reason why I've never seen this problem before. At any rate, I wanted to post this here in case someone else here is using this component and not aware of this issue. The bottom line is, test your backups! :laugh: Have a great weekend! :)
"Go forth into the source" - Neal Morse "Hope is contagious"
-
Over a decade ago, I wrote a SQL Server backup/rotation manager. Backups are zipped and password protected using IonicZip, then copied to a local repository on another disk, and optionally pushed out to an FTP resource. This is handy for when I find myself working on the laptop away from the home/office. This system has been used on multiple servers without issues. A couple of weeks ago, I started using it on a newish Azure VM for one of our latest projects to manage 2 customer databases. It appeared to be working fine...backups/zips/copies all getting created with no errors...or so I thought. Yesterday, I was away from the office and decided to grab the previous day's backups and restore them on my laptop. Using 7-zip, the zips extracted, but with a CRC error detected. :confused: Of course, the backups were useless. Native windows zip refused to extract anything, failing with a generic error message. 'unrecognized error'. :wtf: Every backup from that system was corrupted! :omg: Backups from the other 2 systems are/were fine...one of the other systems is also an Azure VM with practically identical setups and has been working fine for years. :confused: I'll skip the troubleshooting details and get to the fix. IonicZip has a property that I had never heard of before, and which until now had not been important: ParallelDeflateThreshold which needed to be set to -1. Doing so fixed the problem. If I understand correctly, IonicZip has a known problem with files that compress to < 4MB. In my case, mine were slightly over 2MB compressed. All of my other backups are much larger which is perhaps the reason why I've never seen this problem before. At any rate, I wanted to post this here in case someone else here is using this component and not aware of this issue. The bottom line is, test your backups! :laugh: Have a great weekend! :)
"Go forth into the source" - Neal Morse "Hope is contagious"
So, just how long were you "puckered"?
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated. I’m begging you for the benefit of everyone, don’t be STUPID.
-
So, just how long were you "puckered"?
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated. I’m begging you for the benefit of everyone, don’t be STUPID.
MarkTJohnson wrote:
how long were you "puckered"?
I would have been puckered if I had truly needed those backups. As it was, I went through a few emotions: 0: Surprise! Your false sense of security has just been shattered...You are not as clever as you thought you were, and your backups are shite! :omg: 1: Doubt...Hmmm what about the other 20 daily backups? Are they all shite? :confused: 2: Relief...Whew! The other backups are fine. Just these two from this server are crap. 3: Annoyance. I just want to get on with work. Now I have to log on Azure, allow myself to RDP into that box, get raw unzipped backups, and start troubleshooting the problem. 4: Sleuth Mode...the problem seems to be with the zip lib...maybe a bug...maybe fixed? Go get the latest version to find that it's being deprecated, and the last version is 6 y/o. Whatever, I'll try it. 5: Disappointment. :sigh: Nope that didn't work, time to open the project and debug with one of the dbs having the issues. 6: Excitement. :-D Yay! I was able to replicate the issue...now on to understanding. 7: Discovery: A well-phrased search put me on the right track...a known issue with an easy fix. 8: Humility: I'm sure I would have discovered this eventually, but I put a lot of faith in an automated process without actually verifying the outputs, which was the only way to detect the problem. Lesson learned! :laugh:
"Go forth into the source" - Neal Morse "Hope is contagious"