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

Errors while creating new DSC pull server #191

Closed
sameer-kumar opened this issue Aug 9, 2016 · 8 comments · Fixed by #462
Closed

Errors while creating new DSC pull server #191

sameer-kumar opened this issue Aug 9, 2016 · 8 comments · Fixed by #462
Labels
bug The issue is a bug.

Comments

@sameer-kumar
Copy link

sameer-kumar commented Aug 9, 2016

I'm trying to create a new DSC web pull server following the sample scripts provided at
https://github.com/PowerShell/Whitepapers/blob/master/PullServerCPIG/PullServerCPIG.md

However, I get following errors:

Exception calling "GetSection" with "2" argument(s): "Filename: redirection.config
Error: Cannot read configuration file
"
    + CategoryInfo          : NotSpecified: (:) [], CimException
    + FullyQualifiedErrorId : FileNotFoundException
    + PSComputerName        : localhost

The property 'OverrideMode' cannot be found on this object. Verify that the property exists and can be set.
    + CategoryInfo          : InvalidOperation: (:) [], CimException
    + FullyQualifiedErrorId : PropertyNotFound
    + PSComputerName        : localhost

And, when I try to run the new pull server in browser, I get this error:

HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.Detailed Error Information:
Module   WindowsAuthenticationModule
Notification   AuthenticateRequest
Handler   svc-Integrated-4.0
Error Code   0x80070021
Config Error   This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location 
tag with overrideMode="Deny" or the legacy allowOverride="false". 
Config File   \\?\C:\inetpub\wwwroot\PSDSCPullServer\web.config
Requested URL   http://localhost:8080/psdscpullserver.svc

My environment:

Windows 2012 with WMF 5 (latest)

Thanks for your help!

@kwirkykat kwirkykat added bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community. labels Aug 9, 2016
@sameer-kumar
Copy link
Author

sameer-kumar commented Aug 9, 2016

I realized an issue after debugging directly into the shipped psm1 files. I'm not saying this is directly link to my above reported issue but may have some deeper links.

The problem lies under this block:
https://github.com/PowerShell/xPSDesiredStateConfiguration/blob/dev/DSCResources/MSFT_xDSCWebService/MSFT_xDSCWebService.psm1#L562-L583

If user has both IIS and IIS Express installed on his machine, $appHostConfig variable would hold IISExpress' applicationHost.config by default. And if this file doesn't have a location section for $WebSite i.e. PSDSCPullServer then line number 580 poops out.

The real culprit is line number 573

The sample code below does succeeds for IIS and behaves as expected:

$assembly = [System.Reflection.Assembly]::LoadFrom("$env:systemroot\system32\inetsrv\Microsoft.Web.Administration.dll")
$iisHost = new-object Microsoft.Web.Administration.ServerManager "$env:systemroot\system32\inetsrv\config\applicationhost.config"
$appHostConfig = $iisHost.GetApplicationHostConfiguration()
$appHostConfigSection = $appHostConfig.GetSection("system.webServer/security/authentication/anonymousAuthentication", "PSDSCPullServer")
$appHostConfigSection

Here you can see I am brute forcing the correct dll for IIS.

Let me know if I can be of further help.

Sameer

@lfshr
Copy link
Contributor

lfshr commented Nov 25, 2016

Fixed with PR #277. Please close.

@johlju
Copy link
Member

johlju commented May 14, 2018

Closing this as per previous comment. If this was closed in error then please reopen or comment.

@johlju johlju closed this as completed May 14, 2018
@johlju johlju removed the help wanted The issue is up for grabs for anyone in the community. label May 14, 2018
@tmeckel
Copy link
Contributor

tmeckel commented Nov 13, 2018

Hello @johlju .. I tried to deploy a DSC Pullserver on a machine on which IIS and IIS Express are installed and surprisingly I ran into the above described error although the error has been marked as fixed. Shall I open new issue and refer to the old one? Or would you prefer to reopen the old issue #277

@johlju
Copy link
Member

johlju commented Nov 13, 2018

I don’t have the permission any longer to reopen this, so only the author or a maintainer can reopen it.
If you have a fix for this, then please send in a PR and reference this issue. If not, you can either wait if the issue is reopened (by one of the above), or open a new issue and reference this issue in the new issue.

@tmeckel
Copy link
Contributor

tmeckel commented Nov 13, 2018

@johlju because I already have implemented a working fix, I'll provide an PR without waiting for the reopening of this bug

@johlju
Copy link
Member

johlju commented Nov 13, 2018

Tag me in that PR and I can help you review it when I got a chance.

@tmeckel
Copy link
Contributor

tmeckel commented Nov 16, 2018

@mhendric is the current reviewer

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.

5 participants