Steve
Steve

Reputation: 415

Powershell DSC - Buffer is not supported. Check encoding and length of the buffer

On a Windows Server 2012 R2 Virtual Machine, I am trying to run a Powershell DSC script:

Configuration Test {

    Node "localhost" 
    {    
        WindowsFeature WASDotNet3
        {
            Ensure = "Present"
            Name = "WAS-NET-Environment"
        }    
    }

}

Test -OutputPath 'D:\PSMofFiles' Start-DscConfiguration -Wait -Verbose -Path 'D:\PSMofFiles'

When I run this script, I get the following error:

Directory: D:\PSMofFiles

Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 5/20/2014 8:55 AM 1218 localhost.mof
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespace Name' = root/Microsoft/Windows/DesiredStateConfiguration'. Buffer is not supported. Check encoding and length of the buffer + CategoryInfo : InvalidArgument: (root/Microsoft/...gurationManager:String) [], CimException + FullyQualifiedErrorId : MiClientApiError_Failed + PSComputerName : localhost

VERBOSE: Operation 'Invoke CimMethod' complete. VERBOSE: Time taken for configuration job to complete is 0.19 seconds

PS C:\Windows\system32>

Would anyone know what is causing this? Also, it doesn't matter what DSC script I run. It can be any DSC script and I get the exact same error message.

Upvotes: 2

Views: 927

Answers (2)

Steve
Steve

Reputation: 415

I ended up installing a patch on Windows Server 2012 R2 located here: http://www.microsoft.com/en-us/download/details.aspx?id=40774 to fix the issue.

Upvotes: 0

mdonoughe
mdonoughe

Reputation: 535

I solved this problem with rm C:\Windows\System32\Configuration\DSCEngineCache.mof.

By manually inspecting these files (copy to the desktop if you want to use Explorer) I found that this mof file was all null characters. I don't know how that happened, but it could have something to do with "The device, \Device\Harddisk0\DR0, has a bad block" appearing in event log every few seconds.

Upvotes: 1

Related Questions