Deploy error - web.config

Got the following error
Failed: Octopus.Features.IISWebSite_BeforePostDeploy.ps1
Finding SSL certificate with thumbprint 586fca952574f94be13e5472854f72184bebb4b4
Found certificate: SERIALNUMBER=967013056, CN=*.optimera.no, O=OPTIMERA AS, L=OSLO, PostalCode=0976, C=NO
Application pool “authorizationtest.optimera.no” already exists
Set application pool identity: ApplicationPoolIdentity
Set .NET framework version: v4.0
Site “authorizationtest.optimera.no” already exists
Assigning website to application pool…
Home directory: C:\Octopus\Applications\Test-Web\WebSite\1.0.61
Assigning bindings to website…
Binding: https *:443:authorizationtest.optimera.no 586fca952574f94be13e5472854f72184bebb4b4
Anonymous authentication enabled: True
Set-WebConfigurationProperty : Filename: \?\C:\Octopus\Applications\Test-Web\WebSite\1.0.61\web.config
Line number: 34
Error: The configuration section ‘system.serviceModel’ cannot be read because it is missing a section declaration
At C:\Program Files\Octopus Deploy\Tentacle\Scripts\Octopus.Features.IISWebSite_BeforePostDeploy.ps1:132 char:29

  • Set-WebConfigurationProperty <<<< -filter /system.webServer/security/authentication/anonymousAuthentication -name enabled -value “$enableAnonymous” -location $WebSiteName -PSPath “IIS:”
  • CategoryInfo : NotSpecified: (:slight_smile: [Set-WebConfigurationProperty], COMException
  • FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Microsoft.IIs.PowerShell.Provider.SetConfigurationPropertyCommand
    PowerShell script returned a non-zero exit code: 1

The web.config section it is complainig about is this:

<system.serviceModel>




</system.serviceModel>

The site is working perfectly with this web.config.

Why is Octopus complaingi about this setting?

Regards
Lars Kolsaker
Making Waves as

Hi Lars,

Thanks for getting in touch! This was fixed in a recent release. Are you able to upgrade to the latest version?

Thanks!
Vanessa

Thanks.

We will do an upgrade.

Lars

Hi Lars,

Here is the detailed upgrade guide from 2.0 to 2.4+

Please let me know if you have any issues at all.

Thanks
Vanessa

Hi.
I have an issue with deploying applications on our servers. Step “IIS Application - Create” is not working properly.

Line written below is generating an error.
Set-WebConfigurationProperty -filter /system.webServer/security/authentication/anonymousAuthentication -name enabled -value “True” -PSPath IIS:\ -location “Default Web Site/Websites/TestApp”

Error message:
The configuration section ‘system.serviceModel’ cannot be read because it is missing a section declaration.
Authentication options could not be set. This can happen when there is a problem with your application’s web.config. For example, you might be using a section that requires an extension that is not installed on this web server (such as URL Rewrtiting). It can also happen when you have selected an authentication option and the appropriate IIS module is not installed (for example, for Windows authentication, you need to enable the Windows Authentication module in IIS/Windows first).

What can I do?
Looking forward to your reply.

Marcelo

Hi Marcelo,

Thanks for reaching out.

The core of the error message goes like this:

Authentication options could not be set. This can happen when there is a problem with your application's web.config. For example, you might be using a section that requires an extension that is not installed on this web server (such as URL Rewrtiting). It can also happen when you have selected an authentication option and the appropriate IIS module is not installed (for example, for Windows authentication, you need to enable the Windows Authentication module in IIS/Windows first).

Are you by any chance trying to use a specific authentication option, but you don’t have the IIS module installed in your IIS?

Thanks,
Dalmiro

Hi.

Thank you for your prompt reply.
I’ll take a look on monday. However, I’ve found out, that script is not generating any errors on one machine with Powershell 2.0. Seems strange. Although uninstalling specific version of Windows Management Framework is not the best solution, because it requires server to be restarted.

Thanks,
Marcelo

For those who have this issue - installing .Net Framework 3.5.1 and updating modules in PowerShell resolved the problem .

Marcelo