Deploy error applicationHost.config corruption

Hi,
I have this random problem on 2 environment server Test and Staging:

“The applicationHost.config corruption.”

The step of all deploy projects it’s very simple:

  • Send Email Start Deploy
  • Stop Application Pool
  • Deploy a package
  • Start Email End Deploy.

Version of Octopus Server on 2 nodes: Version 2020.4.11
Operative System Windows server 2019 Standard with 12Gb Ram.

The log error:

Blockquote

InvalidArgument: Cannot retrieve the dynamic parameters for the cmdlet. Filename: \?\C:\Windows\system32\inetsrv\config\applicationHost.config
Error: Configuration file is not well-formed XML
At D:\Octopus\OctoDeploy\Work\20201111090754-4498-1650\Script.ps1:12 char:13

  • if(Test-Path <<<< IIS:\AppPools$appPoolName) {
    The remote script failed with exit code 1
    November 11th 2020 10:08:00Fatal
    The action Stop Application Pool AreaIntermediariApiCore on NADMZ12-COLL02 failed

Blockquote

I have read a similar post on 2017 but i don’t find how fix it:


Does anyone have experience on the possible causes and how to fix it?

Thank’s

Hi @gennaro.riccio

Thanks for reaching out about this. Sorry to hear that you’ve run into an issue.

This isn’t something that often happens as you can see from the lack of forum posts on the topic.

You mentioned that it’s a random issue; how often do you see this? Were you able to run the deployment successfully on a subsequent attempt?

I’ve been searching for similar issues elsewhere as I kept seeing IIS mentioned and found this which has steps to restore a corrupt applicationhost.config if needed. This, of course, doesn’t explain how the file became corrupt in the first place, which would be difficult to track down.

Regards,
Stuart

Hi Stuart,

Very random, sometimes after 10 days other times after a few days.

Yes after restore a backup of applicationHost.config

It’s possible this issue it’s caused by concourrency stop application pool by other selfmade deploy tools?

In Octopus the Rolling deployment it’s set to 1.

Thank’s for you answer.

Hi @gennaro.riccio

Thank you for getting back to me. Great to hear that restoring the applicationHost.config got you back up and running.

It’s possible that is the case here. Please keep an eye on it and let us know if you see a pattern emerging or if you find what is causing your config file to become corrupt.

Regards,
Stuart

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