Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xWebAppPool: 'logEventOnRecyle' causes configuration to return false if the order of your desired events does not match what is written to applicationHost.config #434

Closed
mcbobke opened this issue Jul 30, 2019 · 1 comment · Fixed by #439
Labels
bug The issue is a bug.

Comments

@mcbobke
Copy link
Contributor

mcbobke commented Jul 30, 2019

Details of the scenario you tried and the problem that is occurring

When defining xWebAppPool and setting the logEventOnRecycle property, the order in which each desired event is placed in the string should not matter. However, if this string is written with each item in a different order than will be written to applicationHost.config then the resource will fail on Test-DscConfiguration every time.

For example, setting logEventOnRecycle = 'Time,Memory,PrivateMemory' is fine because that's the order that will show in applicationHost.config, but logEventOnRecycle = 'PrivateMemory,Time,Memory' will fail.

Verbose logs showing the problem

  {"time": "2019-07-30T12:13:58.019-7:00", "type": "verbose", "message": "[HOSTNAME]: LCM:  [ Start  Resource ]  [[xWebAppPool]ProdAppPool]  "},
  {"time": "2019-07-30T12:13:58.019-7:00", "type": "verbose", "message": "[HOSTNAME]: LCM:  [ Start  Test     ]  [[xWebAppPool]ProdAppPool]  "},
  {"time": "2019-07-30T12:13:58.285-7:00", "type": "verbose", "message": "[HOSTNAME]:                            [[xWebAppPool]ProdAppPool] Application pool \"ProdAppPool\" was found."},
  {"time": "2019-07-30T12:13:58.425-7:00", "type": "verbose", "message": "[HOSTNAME]:                            [[xWebAppPool]ProdAppPool] The \"logEventOnRecycle\" property of application pool \"ProdAppPool\" does not match the desired state."},
  {"time": "2019-07-30T12:13:58.472-7:00", "type": "verbose", "message": "[HOSTNAME]:                            [[xWebAppPool]ProdAppPool] The target resource is not in the desired state."},
  {"time": "2019-07-30T12:13:58.472-7:00", "type": "verbose", "message": "[HOSTNAME]: LCM:  [ End    Test     ]  [[xWebAppPool]ProdAppPool] False in 0.4530 seconds."},
  {"time": "2019-07-30T12:13:58.472-7:00", "type": "verbose", "message": "[HOSTNAME]: LCM:  [ End    Resource ]  [[xWebAppPool]ProdAppPool]  "}

Suggested solution to the issue

Make the property value string be order-agnostic and test against each individual event in the sting.

The DSC configuration that is used to reproduce the issue (as detailed as possible)

        xWebAppPool 'ProdAppPool' {
            Name                           = 'Prod'
            Ensure                         = 'Present'
            managedRuntimeVersion          = 'v4.0'
            enable32BitAppOnWin64          = $false
            managedPipelineMode            = 'Integrated'
            queueLength                    = 1000
            startMode                      = 'OnDemand'
            cpuLimit                       = 0
            cpuAction                      = 'NoAction'
            cpuResetInterval               = (New-TimeSpan -Minutes 5).ToString()
            cpuSmpAffinitized              = $false
            logEventOnProcessModel         = 'IdleTimeout'
            Credential                     = $ProdCredential
            identityType                   = 'SpecificUser'
            idleTimeout                    = (New-TimeSpan -Minutes 20).ToString()
            idleTimeoutAction              = 'Terminate'
            loadUserProfile                = $false
            maxProcesses                   = 1
            pingingEnabled                 = $true
            pingResponseTime               = (New-TimeSpan -Seconds 90).ToString()
            pingInterval                   = (New-TimeSpan -Seconds 30).ToString()
            shutdownTimeLimit              = (New-TimeSpan -Seconds 90).ToString()
            startupTimeLimit               = (New-TimeSpan -Seconds 90).ToString()
            orphanWorkerProcess            = $false
            rapidFailProtection            = $true
            rapidFailProtectionInterval    = (New-TimeSpan -Minutes 5).ToString()
            rapidFailProtectionMaxCrashes  = 5
            autoShutdownExe                = ''
            autoShutdownParams             = ''
            disallowOverlappingRotation    = $false
            disallowRotationOnConfigChange = $false
            logEventOnRecycle              = 'PrivateMemory,Time,Memory'
            restartPrivateMemoryLimit      = 0
            restartTimeLimit               = (New-TimeSpan -Minutes 1740).ToString()
            restartRequestsLimit           = 0
            restartSchedule                = @()
            restartMemoryLimit             = 0
        }

The operating system the target node is running

OsName               : Microsoft Windows Server 2019 Datacenter
OsOperatingSystemSKU : DatacenterServerEdition
OsArchitecture       : 64-bit
WindowsVersion       : 1809
WindowsBuildLabEx    : 17763.1.amd64fre.rs5_release.180914-1434
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

Version and build of PowerShell the target node is running

Name                           Value
----                           -----
PSVersion                      5.1.17763.592
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.592
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Version of the DSC module that was used ('dev' if using current dev branch)

PS C:\Windows\system32> Get-Module -Name xWebAdministration -ListAvailable


    Directory: C:\Program Files\WindowsPowerShell\Modules


ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Manifest   2.6.0.0    xWebAdministration
@regedit32 regedit32 added the help wanted The issue is up for grabs for anyone in the community. label Jul 31, 2019
@johlju johlju added the bug The issue is a bug. label Sep 6, 2019
@mcbobke
Copy link
Contributor Author

mcbobke commented Sep 6, 2019

This issue is being addressed by #439.

johlju pushed a commit that referenced this issue Sep 9, 2019
- Changes to xWebAppPool
  - Fix false `Test-TargetResource` failure for `logEventOnRecycle` if items
    in the Configuration property are specified in a different order than IIS natively
    stores them (issue #434).
@johlju johlju removed the help wanted The issue is up for grabs for anyone in the community. label Sep 9, 2019
gstorme pushed a commit to gstorme/xWebAdministration that referenced this issue Feb 14, 2020
…ccommunity#439)

- Changes to xWebAppPool
  - Fix false `Test-TargetResource` failure for `logEventOnRecycle` if items
    in the Configuration property are specified in a different order than IIS natively
    stores them (issue dsccommunity#434).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants