Code Monkey home page Code Monkey logo

Comments (7)

kwirkykat avatar kwirkykat commented on September 6, 2024 1

@csharmath Odd. I can't get it to reproduce either. The only difference I have here is that I didn't import xWebAdministration because I don't currently have that module on my test VM. Can you try separating the two module imports into different lines?
Like this:

Import-DscResource -ModuleName xWebAdministration
Import-DscResource -ModuleName PSDesiredStateConfiguration

I have seen this error before but it only came up when this code was written:

Import-DscResource -ModuleName PSDscResources, PSDesiredStateConfiguration

And the fix for that is to separate the imports into two lines.

from psdscresources.

CJHarmath avatar CJHarmath commented on September 6, 2024 1

Hey, sorry for the slow response.

Seems like I can't reproduce it either now.
Looking at patching, I can see lots of hotfixes installed on that server since then.
When I've tried it was a fresh build from a not so fresh image, so it can very well be that some of the hotfix fixed it then.
Looking at the patches, the first one is from 3/14/2016 so thats almost a years worth of patches which is a lot.
WMF 5.1 was manually installed.

I guess the lesson learned for me is to double check that the patching is done before I start working on new builds / get the base image updated.

If someone landed here from a google search: patch & retry :)
Thanks @kwirkykat & @mbreakey3 for taking a look as well!

from psdscresources.

CJHarmath avatar CJHarmath commented on September 6, 2024

I was able to work around this by adding a try/catch swallow as shown in the gist
https://gist.github.com/csharmath/f2918d4f0dc7e14bdff1fa579b49ebbb#file-psdesiredstateconfiguration-psm1-L2108

But I was not yet able to figure out the root cause and this does not seem like the best way to go of course.

Any ideas on how to debug this ?

Thanks

from psdscresources.

mbreakey3 avatar mbreakey3 commented on September 6, 2024

Is this only coming up on 2012 R2? Sorry for the late response, I was trying to repro your issue but it wasn't coming up on my machine (2016 nor 2012 R2). It looks like it could be an issue with PSDesiredStateConfiguration rather than PSDscResources. Have you tried importing PSDesiredStateConfiguration first and then PSDscResources to see if the issue still comes up?

from psdscresources.

CJHarmath avatar CJHarmath commented on September 6, 2024

Yes, Server 2012R2.
I guess it's environment specific, so some combination of settings/installed modules, env vars, etc. not sure yet what exactly, but will try to remove things / set them to defaults...

from psdscresources.

mbreakey3 avatar mbreakey3 commented on September 6, 2024

Have you tried running Get-Module -ListAvailable to see if there's any duplicates listed there?

from psdscresources.

alexjebens avatar alexjebens commented on September 6, 2024

@csharmath Odd. I can't get it to reproduce either. The only difference I have here is that I didn't import xWebAdministration because I don't currently have that module on my test VM. Can you try separating the two module imports into different lines?
Like this:

Import-DscResource -ModuleName xWebAdministration
Import-DscResource -ModuleName PSDesiredStateConfiguration

I have seen this error before but it only came up when this code was written:

Import-DscResource -ModuleName PSDscResources, PSDesiredStateConfiguration

And the fix for that is to separate the imports into two lines.

I had the same error using an entirely different set of modules.
I was able to solve it by separating import-dscresource statements.

from psdscresources.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.