IO Exception causes archive file to be deleted

Jan 7, 2010 at 6:38 PM

I have a job that backs up multiple folders to a zip archive.  It successfully backs up most of the folders, then throws an IO exception ("Cannot create a file when that file already exists.").  At that point, the zip archive file has also been deleted.  This is version 1.8 of DotNetZip.  Has anyone else encountered this problem?

Thanks in advance.

Coordinator
Jan 7, 2010 at 7:19 PM
Edited Jan 7, 2010 at 7:21 PM

Never heard of anyone else encountering this problem.

Is it reproducable?

If so, can you send a snip of code that shows how you create the problem?  And also a stack trace?

There's a window of exposure between deleting the old file and copying over the new file.  If an exception occurs while copying, you have the chance to lose the old file. I even put a comment in the source code describing this exposure. I neevr saw the problem occur, so I wrote that it's better to just keep it simple.

as an immediate workaround, I suggest that you save the zip to a new, unique filename, and do the file management yourself.  Once the zip file is properly saved, rename it to whatever you like. You have to do the rename outside of the Using clause that you use for the ZipFile in question.

 

Jan 8, 2010 at 11:51 PM

Hi,

Thanks for responding.  The group that can reproduce the problem are getting a stack trace and I will send it to you as soon as I get it.  The code is contained in the attached zip file.  It is C# source code (Archive.cs).

BTW, the group that is having this problem also reported another strange problem.  If they try to back up an empty directory, they get an IO exception of “Nullable object must have a value”.  They can reproduce this, also, but when we try it we just get an empty zip file, as expected.  Both of these problems occur in the attached code, in the call to Save.

Thank you. I appreciate any help you can give us.

Regards,

Joe Affrunti

jaffrunti@advsyscon.com

From: Cheeso [mailto:notifications@codeplex.com]
Sent: Thursday, January 07, 2010 2:20 PM
To: Joseph Affrunti
Subject: Re: IO Exception causes archive file to be deleted [DotNetZip:80095]

From: Cheeso

Never heard anyone else encountering this problem.

Is it reproducable?

If so, can you send a snip of code that shows how you create the problem? And also a stack trace?

There's a window of exposure between deleting the old file and copying over the new file. If an exception occurs while copying, you have the chance to lose the old file. I even put a comment in the source code describing this exposure. I neevr saw the problem occur, so I wrote that it's better to just keep it simple.

as an immediate workaround, I suggest that you save the zip to a new, unique filename, and do the file management yourself. Once the zip file is properly saved, rename it to whatever you like. You have to do the rename outside of the Using clause that you use for the ZipFile in question.

Read the full discussion online.

To add a post to this discussion, reply to this email (DotNetZip@discussions.codeplex.com)

To start a new discussion for this project, email DotNetZip@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com

Coordinator
Jan 9, 2010 at 1:10 AM

What version of DotNetZip?  (both "we" and "they")

 

Jan 10, 2010 at 7:03 PM

1.8

From: Cheeso [mailto:notifications@codeplex.com]
Sent: Friday, January 08, 2010 8:11 PM
To: Joseph Affrunti
Subject: Re: IO Exception causes archive file to be deleted [DotNetZip:80095]

From: Cheeso

What version of DotNetZip? (both "we" and "they")

Read the full discussion online.

To add a post to this discussion, reply to this email (DotNetZip@discussions.codeplex.com)

To start a new discussion for this project, email DotNetZip@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com

Jan 13, 2010 at 9:17 PM

Hi,

I’m still waiting for the other group to reproduce the “archive file deleted” problem.  When they do, I will send you the stack trace from it.  The attached file contains a stack trace from the other problem, in which a “nullable object” error occurs when trying to zip an empty directory.

Thank you for any help you can give us.

Joe Affrunti

jaffrunti@advsyscon.com

Advanced System Concepts, Inc.

Coordinator
Jan 13, 2010 at 11:21 PM

Hi Joe -

I'm not getting any attached files. The replies you send get posted to the DotNetZip forums, but any attachments are stripped.

For s aimple stack trace, it'd be best if you just included it into the message, as text.  Then it will show up on the forums.

thanks

 

Jan 13, 2010 at 11:30 PM

Thanks.  Here’s the trace:

09:39:48.349 E  InvalidOperationException in step 'ForEachRow': Nullable object must have a value.<Workflow.Activity>

09:39:48.349 V  TrackData('Status')<Workflow.Runtime>

09:39:48.349 I  Activity 'ForEachValueAppFolders' failed<Workflow.Runtime>

09:39:48.349 V  TrackData('Status')<Workflow.Runtime>

09:39:48.349 E  InvalidOperationException in step 'ForEachValueAppFolders': Nullable object must have a value.<Workflow.Activity>

09:39:48.349 V  TrackData('Status')<Workflow.Runtime>

09:39:48.349 E  The workflow has faulted<Workflow.Runtime>

09:39:48.396 E     at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)

   at Asci.ActiveBatch.JobSteps.FileSystem.Archive.WildCardZip() in c:\TFS\Builds\V70\ActiveBatch\V70-Release\Sources\DotNet\AddIns\JobSteps\FileSystem\Archive.cs:line 367

   at Asci.ActiveBatch.JobSteps.FileSystem.Archive.Asci.ActiveBatch.Workflow.Runtime.IActivityExecutionHandler.Execute(IActivityExecutionContext executionContext) in c:\TFS\Builds\V70\ActiveBatch\V70-Release\Sources\DotNet\AddIns\JobSteps\FileSystem\Archive.cs:line 191

   at Asci.ActiveBatch.Workflow.ActivityExecutionContext.TryInvokeHandler(Activity activity, IActivityExecutionHandler executionHandler)

   at Asci.ActiveBatch.Workflow.ActivityExecutionContext.InvokeHandler(Activity activity, IActivityExecutionHandler executionHandler)

   at Asci.ActiveBatch.Workflow.ActivityExecutionContext.ExecuteActivity(Activity activity)

   at Asci.ActiveBatch.JobSteps.JobStepSequence.Asci.ActiveBatch.Workflow.Runtime.IActivityExecutionHandler.Execute(IActivityExecutionContext executionContext)

   at Asci.ActiveBatch.Workflow.ActivityExecutionContext.TryInvokeHandler(Activity activity, IActivityExecutionHandler executionHandler)

   at Asci.ActiveBatch.Workflow.ActivityExecutionContext.InvokeHandler(Activity activity, IActivityExecutionHandler executionHandler)

   at Asci.ActiveBatch.Workflow.ActivityExecutionContext.ExecuteActivity(Activity activity)

   at Asci.ActiveBatch.JobSteps.Database.ForEachRow.Execute(ForEachRow forEachRow, IActivityExecutionContext executionContext) in c:\TFS\Builds\V70\ActiveBatch\V70-Release\Sources\DotNet\AddIns\JobSteps\Database\ForEachRow.cs:line 135

   at Asci.ActiveBatch.JobSteps.Database.ForEachRow.Asci.ActiveBatch.Workflow.Runtime.IActivityExecutionHandler.Execute(IActivityExecutionContext executionContext) in c:\TFS\Builds\V70\ActiveBatch\V70-Release\Sources\DotNet\AddIns\JobSteps\Database\ForEachRow.cs:line 95

   at Asci.ActiveBatch.Workflow.ActivityExecutionContext.TryInvokeHandler(Activity activity, IActivityExecutionHandler executionHandler)

   at Asci.ActiveBatch.Workflow.ActivityExecutionContext.InvokeHandler(Activity activity, IActivityExecutionHandler executionHandler)

   at Asci.ActiveBatch.Workflow.ActivityExecutionContext.ExecuteActivity(Activity activity)

   at Asci.ActiveBatch.JobSteps.JobStepSequence.Asci.ActiveBatch.Workflow.Runtime.IActivityExecutionHandler.Execute(IActivityExecutionContext executionContext)

   at Asci.ActiveBatch.Workflow.ActivityExecutionContext.TryInvokeHandler(Activity activity, IActivityExecutionHandler executionHandler)

   at Asci.ActiveBatch.Workflow.ActivityExecutionContext.InvokeHandler(Activity activity, IActivityExecutionHandler executionHandler)

   at Asci.ActiveBatch.Workflow.ActivityExecutionContext.ExecuteActivity(Activity activity)

   at Asci.ActiveBatch.JobSteps.FlowControl.ForEachValue.Asci.ActiveBatch.Workflow.Runtime.IActivityExecutionHandler.Execute(IActivityExecutionContext executionContext) in c:\TFS\Builds\V70\ActiveBatch\V70-Release\Sources\DotNet\AddIns\JobSteps\FlowControl\ForEachValue.cs:line 84

   at Asci.ActiveBatch.Workflow.ActivityExecutionContext.TryInvokeHandler(Activity activity, IActivityExecutionHandler executionHandler)

   at Asci.ActiveBatch.Workflow.ActivityExecutionContext.InvokeHandler(Activity activity, IActivityExecutionHandler executionHandler)

   at Asci.ActiveBatch.Workflow.ActivityExecutionContext.ExecuteActivity(Activity activity)

   at Asci.ActiveBatch.JobSteps.JobStepSequence.Asci.ActiveBatch.Workflow.Runtime.IActivityExecutionHandler.Execute(IActivityExecutionContext executionContext)

   at Asci.ActiveBatch.Workflow.ActivityExecutionContext.TryInvokeHandler(Activity activity, IActivityExecutionHandler executionHandler)

   at Asci.ActiveBatch.Workflow.ActivityExecutionContext.InvokeHandler(Activity activity, IActivityExecutionHandler executionHandler)

   at Asci.ActiveBatch.Workflow.ActivityExecutionContext.ExecuteActivity(Activity activity)

   at Asci.ActiveBatch.Workflow.WorkflowInstance.StartCallback()<Workflow.Runtime>

From: Cheeso [mailto:notifications@codeplex.com]
Sent: Wednesday, January 13, 2010 6:21 PM
To: Joseph Affrunti
Subject: Re: IO Exception causes archive file to be deleted [DotNetZip:80095]

From: Cheeso

Hi Joe -

I'm not getting any attached files. The replies you send get posted to the DotNetZip forums, but any attachments are stripped.

For s aimple stack trace, it'd be best if you just included it into the message, as text. Then it will show up on the forums.

thanks

Read the full discussion online.

To add a post to this discussion, reply to this email (DotNetZip@discussions.codeplex.com)

To start a new discussion for this project, email DotNetZip@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com

Coordinator
Jan 14, 2010 at 2:12 AM

Hi Joe,

it sure seems like the exception is not coming from DotNetZip code.  If I were you, I would start looking at line 367 in \V70\ActiveBatch\V70-Release\Sources\DotNet\AddIns\JobSteps\FileSystem\Archive.cs, in the ActiveBatch source code.

Jan 14, 2010 at 3:51 PM

Thank you.  My dumb!!! Sorry to bother you with that.

From: Cheeso [mailto:notifications@codeplex.com]
Sent: Wednesday, January 13, 2010 9:12 PM
To: Joseph Affrunti
Subject: Re: IO Exception causes archive file to be deleted [DotNetZip:80095]

From: Cheeso

Hi Joe,

it sure seems like the exception is not coming from DotNetZip code. If I were you, I would start looking at line 367 in \V70\ActiveBatch\V70-Release\Sources\DotNet\AddIns\JobSteps\FileSystem\Archive.cs, in the ActiveBatch source code.

Read the full discussion online.

To add a post to this discussion, reply to this email (DotNetZip@discussions.codeplex.com)

To start a new discussion for this project, email DotNetZip@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com