Deploy to IIS package error

Hi, I’m trying to deploy a package to IIS as web application. But this step keeps failing with the error “Operation is not valid due to the current state of the object”. The detailed error log is below -

8:23:53 Info | Deploying package: E:\Octopus\Tentacle\Files\PLC.API@S1.0.0.0@1342835A3BCA9E42A9F50CDFADC13DA4.nupkg
18:23:54 Verbose | Extracting package to: C:\Websites\dev-myplc.iapmo.org\Development\PLC.API\1.0.0.0_18
18:23:54 Error | System.InvalidOperationException: Operation is not valid due to the current state of the object.
18:23:54 Error | at SharpCompress.Common.Zip.SeekableZipHeaderFactory.GetLocalHeader(Stream stream, DirectoryEntryHeader directoryEntryHeader)
18:23:54 Error | at SharpCompress.Common.Zip.SeekableZipFilePart.LoadLocalHeader()
18:23:54 Error | at SharpCompress.Common.Zip.SeekableZipFilePart.GetCompressedStream()
18:23:54 Error | at SharpCompress.Archives.IArchiveEntryExtensions.WriteTo(IArchiveEntry archiveEntry, Stream streamToWriteTo)
18:23:54 Error | at SharpCompress.Archives.IArchiveEntryExtensions.<>c__DisplayClass2_0.b__0(String x, FileMode fm)
18:23:54 Error | at SharpCompress.Common.ExtractionMethods.WriteEntryToFile(IEntry entry, String destinationFileName, ExtractionOptions options, Action2 openAndWrite) 18:23:54 Error | at Calamari.Common.Features.Packages.NuGet.NupkgExtractor.Extract(String packageFile, String directory) 18:23:54 Error | at Calamari.Common.Features.Packages.ExtractPackage.Extract(PathToPackage pathToPackage, String targetPath, IPackageExtractor customPackageExtractor) 18:23:54 Error | at Calamari.Deployment.ConventionProcessor.RunInstallConventions() 18:23:54 Error | at Calamari.Deployment.ConventionProcessor.RunConventions() 18:23:54 Error | Running rollback conventions... 18:23:54 Verbose | Adding journal entry: 18:23:54 Verbose | <Deployment Id="9775b7c8-5d4d-4b4c-bc31-3828a30a25b9" EnvironmentId="Environments-2" TenantId="" ProjectId="Projects-1" InstalledOn="2020-12-09 02:23:54" RetentionPolicySet="Environments-2/Projects-1/Step-Deploy PLC API to IIS/Machines-1/&lt;default&gt;" ExtractedTo="" CustomInstallationDirectory="C:\websites\dev-myplc.api.iapmo.org" WasSuccessful="False"> 18:23:54 Verbose | <Package PackageId="PLC.API" PackageVersion="1.0.0.0" DeployedFrom="E:\Octopus\Tentacle\Files\PLC.API@S1.0.0.0@1342835A3BCA9E42A9F50CDFADC13DA4.nupkg" /> 18:23:54 Verbose | </Deployment> 18:23:54 Error | Operation is not valid due to the current state of the object. 18:23:54 Error | System.InvalidOperationException 18:23:54 Error | at SharpCompress.Common.Zip.SeekableZipHeaderFactory.GetLocalHeader(Stream stream, DirectoryEntryHeader directoryEntryHeader) 18:23:54 Error | at SharpCompress.Common.Zip.SeekableZipFilePart.LoadLocalHeader() 18:23:54 Error | at SharpCompress.Common.Zip.SeekableZipFilePart.GetCompressedStream() 18:23:54 Error | at SharpCompress.Archives.IArchiveEntryExtensions.WriteTo(IArchiveEntry archiveEntry, Stream streamToWriteTo) 18:23:54 Error | at SharpCompress.Archives.IArchiveEntryExtensions.<>c__DisplayClass2_0.<WriteToFile>b__0(String x, FileMode fm) 18:23:54 Error | at SharpCompress.Common.ExtractionMethods.WriteEntryToFile(IEntry entry, String destinationFileName, ExtractionOptions options, Action2 openAndWrite)
18:23:54 Error | at Calamari.Common.Features.Packages.NuGet.NupkgExtractor.Extract(String packageFile, String directory)
18:23:54 Error | at Calamari.Common.Features.Packages.ExtractPackage.Extract(PathToPackage pathToPackage, String targetPath, IPackageExtractor customPackageExtractor)
18:23:54 Error | at Calamari.Deployment.ConventionProcessor.RunInstallConventions()
18:23:54 Error | at Calamari.Deployment.ConventionProcessor.RunConventions()
18:23:54 Error | at Calamari.Commands.DeployPackageCommand.Execute(String[] commandLineArguments)
18:23:54 Error | at Calamari.Common.CalamariFlavourProgram.Run(String[] args)
18:23:54 Verbose | Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in E:\Octopus\Tentacle\Work\20201209022352-115-96 exited with code 100

Hi adnan.yousuf,

Thank you for reaching out to us with your query.

It would be great if you could advise on the following:

  • What is the file size of the package?
  • Does the package extract correctly when done manually?
  • Are you using the built in Octopus Deploy repository or an external feed?
  • If you’re using an external feed, can you try using the built in repository for a test deployment?

Best Regards,

Charles

Hi Charles,

Thanks for quick response. Please see the inline response.

Regards,

Adnan Yousuf

Hi Adnan,

Thank you for getting back to me with the details.

It sounds like there is a problem with the package itself, but there isn’t enough detail yet to be sure what the exact issue is. Could you please confirm if any other packages show the same error? Would it be possible to try re-creating the affected package?

Best Regards,

Charles

PS. Please reply in the main body if possible as the forum software isn’t able to handle inline replies.

Hi Charles, I’m new to Team City and Octopus Deployment.

To give you some background, I’m compiling a multi-project C# solution out of which 4 projects have the octopack deploy package installed. One of them is MVC/Angular website, one is WebApi, One is SignalR and last one is for db migration (EntityFramework).

At teamcity I build the solution (.sln file) with these command line parameters - /p:RunOctoPack=true /p:OctoPackPublishPackageToFileShare=E:\TeamCityWorkDir\BuildArtifact to create and publish the packages.

In the last step I push these packages to Octopus Url.

At Octopus only the website package is getting extracted and installed. The webapi package is what gives the error. Can you suggest where should I look into?

Regards,

Adnan Yousuf

Hi Adnan,

Thank you for your message.

We’ve seen similar issues before where rebuilding the package has helped. It sounds like it’s one specific package that’s causing the problem, so could you please try rebuilding that one and letting me know if you still see the error? Can you please also advise if previous builds of this package have worked correctly?

Best Regards,

Charles

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