Unzip File In Use Error

We have been deploying the same way for years without issue; however, our latest deployment to production environment has led to file in use errors.

Powershell line causing issue in Octopus Step
[System.IO.Compression.ZipFile]::ExtractToDirectory('c:\installs\' + $Version + '.zip', 'c:\installs\' + $Version)

Error Log related to the code:

Error cannot access the file 'c:\installs\\Web\WebApplication\***.dll' because it is being used by another process."

This particular error occurs at random (different dll and servers) and some servers seem to work as well. The install directory is unused it’s specific to just unzipping the file and then it’s copied over to the correct folder.

We thought, “Ok maybe it’s our powershell script” so we rewrote it as the built-in Octopus Transfer step:

System.IO.IOException: The process cannot access the file 'C:\Octopus\Applications\****\Web\WorkProcessor\bin\WorkProcessor.exe' because it is being used by another process.

Our best guess is antivirus (Trend) which we do not currently have control over (managed servers).

Unzipping on the server through RDP seems to work fine, however. Just looking for some direction on the issue and if users are still having issue like this post in your forums and if there is a work-around aside from shutting off antivirus?

Hi @jg1,

Thanks for getting in touch!

Trend does sound like they likely culprit here, unfortunately, there isn’t likely to be a workaround other than adding an exclusion to Trend for the folders that your deployment is using.


The directories we need for extraction are now white listed to not do active scans. This solved the problem. Thanks for the reply, @paul.calvert

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.