File Locking Issue in Octopus during deployment

Hello,

We deploy to 4 servers as part of our deployment process. During deployment process we are seeing the locking issue happen randomly on any one of the server. The locked file is with in the Octopus folder and we have excluded Anti VIrus for that folder. Please find the error below. When we do a restart on the tentacle service the deployment works fine. Please advise on what could cause the issue.

Deploying package: D:\Octopus\Files\GallagherGlobal91.Release.Web@S3.0.14138@AC4381B335EB7540BE062A189226384E.zip
June 24th 2019 18:57:36
Error
System.IO.IOException: The process cannot access the file ‘D:\Octopus\Applications\CORP-STAGE\GallagherGlobal91.Release.Web\3.0.14138\App_Data\Dianoga Tools\SVGO\node.exe’ because it is being used by another process.
June 24th 2019 18:57:36
Error
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
June 24th 2019 18:57:36
Error
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
June 24th 2019 18:57:36
Error
at System.IO.FileStream…ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
June 24th 2019 18:57:36
Error
at System.IO.File.OpenFile(String path, FileAccess access, SafeFileHandle& handle)
June 24th 2019 18:57:36
Error
at System.IO.File.SetLastWriteTimeUtc(String path, DateTime lastWriteTimeUtc)
June 24th 2019 18:57:36
Error
at System.IO.FileSystemInfo.set_LastWriteTimeUtc(DateTime value)
June 24th 2019 18:57:36
Error
at System.IO.FileSystemInfo.set_LastWriteTime(DateTime value)
June 24th 2019 18:57:36
Error
at SharpCompress.Common.IEntryExtensions.PreserveExtractionOptions(IEntry entry, String destinationFileName, ExtractionOptions options)
June 24th 2019 18:57:36
Error
at SharpCompress.Archives.IArchiveEntryExtensions.WriteToDirectory(IArchiveEntry entry, String destinationDirectory, ExtractionOptions options)
June 24th 2019 18:57:36
Error
at Calamari.Integration.Packages.ZipPackageExtractor.Extract(String packageFile, String directory, Boolean suppressNestedScriptWarning)
June 24th 2019 18:57:36
Error
at Calamari.Deployment.Conventions.ExtractPackageConvention.Install(RunningDeployment deployment)
June 24th 2019 18:57:36
Error
at Calamari.Deployment.ConventionProcessor.RunInstallConventions()
June 24th 2019 18:57:36
Error
at Calamari.Deployment.ConventionProcessor.RunConventions()
June 24th 2019 18:57:36
Error
Running rollback conventions…
June 24th 2019 18:57:37
Error
The process cannot access the file ‘D:\Octopus\Applications\CORP-STAGE\GallagherGlobal91.Release.Web\3.0.14138\App_Data\Dianoga Tools\SVGO\node.exe’ because it is being used by another process.
June 24th 2019 18:57:37
Error
System.IO.IOException
June 24th 2019 18:57:37
Error
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
June 24th 2019 18:57:37
Error
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
June 24th 2019 18:57:37
Error
at System.IO.FileStream…ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
June 24th 2019 18:57:37
Error
at System.IO.File.OpenFile(String path, FileAccess access, SafeFileHandle& handle)
June 24th 2019 18:57:37
Error
at System.IO.File.SetLastWriteTimeUtc(String path, DateTime lastWriteTimeUtc)
June 24th 2019 18:57:37
Error
at System.IO.FileSystemInfo.set_LastWriteTimeUtc(DateTime value)
June 24th 2019 18:57:37
Error
at System.IO.FileSystemInfo.set_LastWriteTime(DateTime value)
June 24th 2019 18:57:37
Error
at SharpCompress.Common.IEntryExtensions.PreserveExtractionOptions(IEntry entry, String destinationFileName, ExtractionOptions options)
June 24th 2019 18:57:37
Error
at SharpCompress.Archives.IArchiveEntryExtensions.WriteToDirectory(IArchiveEntry entry, String destinationDirectory, ExtractionOptions options)
June 24th 2019 18:57:37
Error
at Calamari.Integration.Packages.ZipPackageExtractor.Extract(String packageFile, String directory, Boolean suppressNestedScriptWarning)
June 24th 2019 18:57:37
Error
at Calamari.Deployment.Conventions.ExtractPackageConvention.Install(RunningDeployment deployment)
June 24th 2019 18:57:37
Error
at Calamari.Deployment.ConventionProcessor.RunInstallConventions()
June 24th 2019 18:57:37
Error
at Calamari.Deployment.ConventionProcessor.RunConventions()
June 24th 2019 18:57:37
Error
at Calamari.Commands.DeployPackageCommand.Execute(String[] commandLineArguments)
June 24th 2019 18:57:37
Error
at Calamari.Program.Execute(String[] args)
June 24th 2019 18:57:37
Fatal
The remote script failed with exit code 100

Hi @prudvi,

Thanks for getting in touch!

That looks like an interesting problem, especially as you have eliminated the most obvious cause of this issue (anti-virus). What I would recommend at this point is monitoring the files with Process Explorer to identify what is locking the files.

Once you have identified what is causing the locks we should be able to work out a way to prevent them from occuring.

Thanks @prudvi, I look forward to hearing from you.

Regards,
Alex

Alex Thanks for the response. I have couple of questions

  1. For anti virus excluding the folder from Anti Virus scan is enough or do we need to do anything more. We definitely excluded the folder from Anti Virus scan, let us know if we need to do anything else.

  2. Do we have to add a step to restart the octopus tentacle everytime. I dont think this is a good solution and required but are there any options.

Thanks
Prudvi Krishna

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