Welcome, Guest
Username: Password: Remember me
This forum is the place to discuss issues related to ReportPro, Xs2Ado, Vo2Ado, bBrowser and other 3rd party products
  • Page:
  • 1

TOPIC:

DotNetZip created backup sometimes causes issues in (only) some unzip programs 08 May 2023 16:49 #26221

  • ic2
  • ic2's Avatar
  • Topic Author


  • Posts: 1662
  • Not sure if this rings a bell for any of you, but I can always give it a try.
    I created a backup program based upon DotNetZip. This allows me a.o. to create AES 256 password protected zips.

    Two recent full backups (zips of 40 GB) did not open correctly in a program like 7-Zip. I see only the first directory and then the first file of it. A test of the zip says
    ERRORS: Headers Error Unconfirmed start of archive
    WARNINGS: There are data after the end of archive


    With a couple of more tests I found:
    1 It is (now) always (reproducible) creating the zip again with the same selection (and probably a few more files)
    2 Windows Explorer sees all directories (but can't open file because it does not support AES 256)
    3 Winzip also can open everything the same zip
    4 After creating some parts of the original backup the problem remained only in file from which I further found:
    - It is not the size (one of the other 'partly' backups is 4x larger
    - It does not seem to be the content either): one separate backup with only the root of that disk and one with only the subdirs with content resulted in 2 readable backups (=all the same files of the non working combined backup)
    - When I create the same backup as differentials (so on the 'problem' disk the same root + subdirs but less files) this zip also opens in all programs.

    So there does not seem to be a logical reason nor a solution. Maybe Fabrice has an idea (as X# FabZip uses DotNetZip too)?

    Dick

    Please Log in or Create an account to join the conversation.

    DotNetZip created backup sometimes causes issues in (only) some unzip programs 11 May 2023 15:07 #26286

    • Fabrice
    • Fabrice's Avatar


  • Posts: 366
  • Hi Dick,
    unfortunately, I have not idea...
    Have you tried with the same set of files (same condition), without AES ? or with another encryption method ?

    just a shoot in the dark...

    Fab

    Please Log in or Create an account to join the conversation.

    DotNetZip created backup sometimes causes issues in (only) some unzip programs 12 May 2023 22:58 #26310

    • ic2
    • ic2's Avatar
    • Topic Author


  • Posts: 1662
  • Hello Fabrice,

    I should have added that to the list of what I tried. The problem is the same regardless the use of password protection.

    Thanks for your suggestion though.

    Hopefully I get an idea soon....

    Dick

    Please Log in or Create an account to join the conversation.

    DotNetZip created backup sometimes causes issues in (only) some unzip programs 14 May 2023 19:58 #26313

    • Fabrice
    • Fabrice's Avatar


  • Posts: 366
  • Hi Dick,
    So ... Could it be related to the name of the Zipped files ?
    Special Names, Special chars or char that are not/badly supported ??

    Fab

    Please Log in or Create an account to join the conversation.

    DotNetZip created backup sometimes causes issues in (only) some unzip programs 15 May 2023 12:28 #26317

    • ic2
    • ic2's Avatar
    • Topic Author


  • Posts: 1662
  • Hello Fabrice,

    The strange thing is that if I split the faulty content in 1 zip with the root content and one zip with the content fo all subdirectories, both zips are problem free. This while having the same content as the 1 zip file with both.
    And it can't be the size either, because 1 of the other 'partly' zip files is 4 times bigger.

    I also try to find some logic, so far in vain. There must be something which is written into the zip file in this specific combination which causes some zip programs to stop reading more than the first directory/file while others (like Explorer) still see the correct content in the same file. But what...

    Dick

    Dick

    Please Log in or Create an account to join the conversation.

    DotNetZip created backup sometimes causes issues in (only) some unzip programs 15 May 2023 14:10 #26318

    • Meinhard
    • Meinhard's Avatar


  • Posts: 80
  • Hi Dick,
    this indeed rings a bell to me. Can you show us the code you are using to create the zip?
    Regards
    Meinhard

    Please Log in or Create an account to join the conversation.

    DotNetZip created backup sometimes causes issues in (only) some unzip programs 15 May 2023 14:47 #26319

    • ArneOrtlinghaus
    • ArneOrtlinghaus's Avatar


  • Posts: 348
  • The original old ZIP-File formats had limits on the file sizes of single files and on the file size of the zipped file of 4 GB. Perhaps it is this the reason?

    Arne

    Please Log in or Create an account to join the conversation.

    DotNetZip created backup sometimes causes issues in (only) some unzip programs 15 May 2023 17:46 #26324

    • ic2
    • ic2's Avatar
    • Topic Author


  • Posts: 1662
  • Hello Meinhard,

    this indeed rings a bell to me. Can you show us the code you are using to create the zip?

    I would be great if a simple addition would do the trick!

    It's actually a C# program and I think this is basically what I do. First I assign List<FileInfo> liFilesToBackup to which files to be zipped are added from an XML file.
    collect. Then I call:
    DoZipping(cZipName,FileMode.Open,liFilesToBackup,dLastChanged,lDifferential,lIncremental);

    This method then goes through the List, I stripped anything which I think is irrelevant, like checks on files dates or attributes like differentials, progress info and logs:
    try
    			{
    				using (Ionic.Zip.ZipFile zip = new Ionic.Zip.ZipFile())
    				{
    					string cPW = this.PW.Password.ToString();
    					if (!string.IsNullOrEmpty(cPW))
    					{
    						if (this.pkzip.IsChecked == true)
    						{
    							zip.Encryption = Ionic.Zip.EncryptionAlgorithm.PkzipWeak;
    						}
    						if (this.aes128.IsChecked == true)
    						{
    							zip.Encryption = Ionic.Zip.EncryptionAlgorithm.WinZipAes128;
    						}
    						if (this.aes256.IsChecked == true)
    						{
    							zip.Encryption = Ionic.Zip.EncryptionAlgorithm.WinZipAes256;
    						}
    						zip.Password = cPW;
    					}
    					zip.ZipErrorAction=ZipErrorAction.Skip;												
    					zip.UseZip64WhenSaving = Zip64Option.AsNecessary;										
    					string cFilesToBackup = liFilesToBackup.Count.ToString();
    					tStart = DateTime.Now;														
    					foreach (FileInfo file in liFilesToBackup)											
    					{
    						cFileFull = file.FullName;												
    						bool lResult = CreateZipEntry(zip, file, cFileFull);														
    					}   // ForEach
    
    					try																					
    					{
    						zip.SaveProgress += ZipSaveProgress;																
    						zip.Save(cZipName);
    					} // try
    					catch (Exception e)
    					{
    					}
    				} // using
    			} // try
    			catch (System.Exception e)
    			{
    			}

    The CreateZipEntry as called within that loop looks as follows, again the important code.

    Is there anything you may see which is missing or wrong?
    private bool CreateZipEntry(Ionic.Zip.ZipFile zip, FileInfo file, string cFileFull)
    			{
    			{
    				string cFileToBackup;
    				string cPath;
    				string cFileOnly;
    				string cRoot;
    				string cPathOnly;
    				int nLen;
    				try
    				{
    					DateTime dtNow = File.GetLastWriteTime(cFileFull);															
    					cPath = System.IO.Path.GetDirectoryName(cFileFull);
    					cFileOnly = System.IO.Path.GetFileName(cFileFull);															
    					cFileToBackup = cPath + "\\" + cFileOnly;
    					cRoot = System.IO.Path.GetPathRoot(cFileFull);																
    					nLen = cRoot.Length;																			
    					cPathOnly = cPath.Remove(0, nLen - 1);																	
    
    					cFileToBackup = cPathOnly + "\\" + cFileOnly;																
    					if (cFileToBackup.Substring(0, 1) == "\\")																
    						cFileToBackup = cFileToBackup.Substring(1);															
    
    					System.Text.StringBuilder builder = new System.Text.StringBuilder(cFileToBackup);											
    					builder.Replace("\\", "/");																		
    					string cPathToAdd = builder.ToString();
    
    					try
    					{
    						{
    							var zipEntry=zip.AddFile(cFileFull, cPath);														
    							zipEntry.Comment=cPath.Substring(0,1);															
    						}
    						if (lResetArchivebit)																		
    						{
    							bool lArchive = ((File.GetAttributes(cFileFull) & FileAttributes.Archive) == FileAttributes.Archive);							
    							File.SetAttributes(cFileFull, File.GetAttributes(cFileFull) & ~FileAttributes.Archive);									
    						}
    					}
    					catch (Exception e)
    					{
    					}
    					return true;
    				}		// try mainloop
    				catch (Exception e)
    				{
    				}
    
    			};
    			// return taskZip1File.Result;
    		}
    Dick

    Please Log in or Create an account to join the conversation.

    DotNetZip created backup sometimes causes issues in (only) some unzip programs 15 May 2023 17:49 #26325

    • ic2
    • ic2's Avatar
    • Topic Author


  • Posts: 1662
  • Hello Arne,

    The original old ZIP-File formats had limits on the file sizes of single files and on the file size of the zipped file of 4 GB. Perhaps it is this the reason?

    No, that is not the problem. A full backup, over 4 different (logical) disks is 42 GB. When I create a separate backup for each of the disks, the one with the error is <6GB while one other without problems is 25 GB.

    Dick

    Please Log in or Create an account to join the conversation.

    DotNetZip created backup sometimes causes issues in (only) some unzip programs 16 May 2023 16:17 #26334

    • ArneOrtlinghaus
    • ArneOrtlinghaus's Avatar


  • Posts: 348
  • if Only 7-zip does not manage to read the zips then perhaps 7-zip is the problem. 7-zip surely has reprogrammed the zip-format and does not use another DLL.

    Otherwise perhaps some files/directories are changing while trying to zip the files? The bigger the list of files to save the bigger gets this risk.
    Or what is not excluded: Interaction with other tasks on the same computer, for example an Antivirus.

    Arne

    Please Log in or Create an account to join the conversation.

    DotNetZip created backup sometimes causes issues in (only) some unzip programs 17 May 2023 12:01 #26347

    • FFF
    • FFF's Avatar


  • Posts: 1419
  • Dick,
    just for completeness: Did you try to open your problem zips with the new 7-zip beta 23.00 from May, 7th?
    Regards
    Karl (X# 2.15.0.3; Xide 2.15; W8.1/64 German)

    Please Log in or Create an account to join the conversation.

    Last edit: by FFF.

    DotNetZip created backup sometimes causes issues in (only) some unzip programs 18 May 2023 10:54 #26387

    • ic2
    • ic2's Avatar
    • Topic Author


  • Posts: 1662
  • Hello Arne, Karl,

    I just installed that beta version of 7-Zip; same result. Earlier I installed a program called Peazip, same result. So you would say DotNetZip is doing something wrong but only in some unknown situation. But on the other hand, Explorer sees all directories (and can open files if not AES256 encrypted)

    Dick

    Please Log in or Create an account to join the conversation.

    DotNetZip created backup sometimes causes issues in (only) some unzip programs 20 May 2023 11:43 #26409

    • ArneOrtlinghaus
    • ArneOrtlinghaus's Avatar


  • Posts: 348
  • For our program delivery and for our Oracle database backups we are also using different ZIP mechanisms. Zipping big files or many files or open files gives sometimes undesired effects. Also "fighting" against Antivirus programs is time-consuming and difficult if the files are in one big zip-container. For example we had cases where open files were missing in the zips and nobody realized the danger of having incomplete backups.

    So If it is possible to devide zipping in some files I prefere this over having only one big zip. Better to find a conservative working way with existing possibilities then taking risks.

    Arne

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1