TFS Push to Octopus failing

I setup a step in my TFS 2017 build to Push a nuget package to my Octo server. I’m having an issue with it failing on a “process cannot access file” error. See error below.

******************************************************************************
Starting: Push Tabs.Dispatch Package to Octopus
******************************************************************************
==============================================================================
Task         : Push Package(s) to Octopus
Description  : Push your NuGet or Zip package to your Octopus Deploy Server
Version      : 3.0.166
Author       : Octopus Deploy
Help         : Version: 3.0.166. [More Information](http://docs.octopusdeploy.com/display/OD/Use+the+Team+Foundation+Build+Custom+Task)
==============================================================================
5ef25d66-e619-412a-9307-cf10aea6edcb exists true
Checking local tool cache
Downloading: https://download.octopusdeploy.com/octopus-tools/4.38.1/OctopusTools.4.38.1.portable.zip
Extracting archive
C:\Windows\system32\chcp.com 65001
Active code page: 65001
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('C:\w\IA\_temp\dbf98a25-1d1a-4fcd-a6b4-a1ffc1dfd046', 'C:\w\IA\_temp\44616330-49c9-4e58-b73c-06f648bd1036')"
Exception calling "ExtractToDirectory" with "2" argument(s): "The process cannot access the file 
'C:\w\IA\_temp\44616330-49c9-4e58-b73c-06f648bd1036\Autofac.dll' because it is being used by another process."
At line:1 char:111
+ ... catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('C:\w ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : IOException
 
Error: Failed to download octo tools 4.38.1. Error: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe failed with return code: 1
Failed to push package. Failed to download octo tools 4.38.1. Error: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe failed with return code: 1
******************************************************************************
Finishing: Push Tabs.Dispatch Package to Octopus
******************************************************************************

Any ideas on why this is happening? I have this step in another build and it works fine.

I got this to work if I change the version to 2.. So, it fails like this when the version is set to 3..

Hi Dan.

Thanks for getting in touch.

It looks, from what you’ve posted, like VSTS is having trouble extracting a compressed file because it’s attempting to overwrite a copy of autofac.dll in the target directory while something has a lock on that target file.

I’d have thought that if Autofac.dll exists in the target folder, then we already have the tools extracted and we don’t need to re-extract them. How does the pipeline look? Do you have multiple Octopus steps? Are we maybe downloading and installing the tools twice when we don’t need to?

n.b. I suspect switching versions in the step will result in a different set of tools being downloaded, so the target files won’t clash in the same way during extraction

Thanks

Jason

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