Offline deployment hanging after IIS configuration- how do I debug/diagnose the deploy?

I have a project with an offline deployment target and PostDeploy.ps1 script. The project is an ASP.NET Website under a custom relative folder. When I run the offline package, it gets to the point where it has finished configuring IIS security, then it hangs. My PostDeploy.ps1 has a write-host before doing any work, and I’m not seeing that, so I suspect the problem is prior to the script. If I break the script where it hung (control-C) the AppPool and WebSite are both configured.

The point where the application hangs is after: "Applied configuration changes to section “system.webServer/security/authentication/windowsAuthentication” for “MACHINE/WEBROOT/APPHOST/InsightWebsite” at configuration commit path “MACHINE/WEBROOT/APPHOST"
IIS configuration complete”

Any thoughts on what this could be? What is the best way to track down errors in an offline deployment?

Thanks,
Erick

Hi Erick,

Thanks for getting in touch! The offline deployment package contains a script that has all the commands run via Calamari. You could attempt a troubleshoot by running the commands individually. I would also suggest trying different users that run to see if you get different output. Sending us your package would help us diagnose or at least your custom script to see if we can see anything out of the ordinary.
Does it run fine for a Tentacle deployment?

Let me know what you find,
Vanessa

Hey Vanessa,

I figured out what the problem was. In the post-deploy script, there were some usages of PowerShell 5 cmdlets (in particular Write-Info). When I removed those, it started working as expected.

The interesting part was that the offline deployment didn’t show an error, it just hung. When I debugged it, I saw that it was waiting for something (looking at the IL debugger). I discovered the issue but running on various hosts and seeing what was different. If it would help, I can send you the package to repo the issue.

Thanks,
Erick

Hi Erick,

I am glad you were able to find the problem! Unfortunately I don’t know if there is much that can be done from an error point of view. I know that Calamari (which is running those commands) is the poor messenger and the Octopus Server is usually what translates and interprets the responses to make them behave in a particular way.
We do think that it should have at least returned the error for you though. So I have created a task to investigate why it might have hung https://github.com/OctopusDeploy/Issues/issues/2480

We should be able to replicate this on our own, but someone will be in touch if they are unable to.
Vanessa