Thursday, November 14, 2013

PowerShell DSC: Cannot invoke the SendConfigurationApply method

Been hitting this error when doing some PowerShell Desired State Configuration (DSC) work:


Cannot invoke the SendConfigurationApply method. The SendConfigurationApply method is in progress and must return before SendConfigurationApply can be invoked.

    + CategoryInfo          : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException

    + FullyQualifiedErrorId : MI RESULT 1

    + PSComputerName        : localhost



Found a nice blog post where the same error was hit, and was hoping to get root cause on this but got lucky instead.  This error was transient in his case, and proved transient in mine too.  I tried to flush it by resetting DSC surgically:



### find the Process that is hosting the DSC engine


$dscProcessID = Get-WmiObject msft_providers |

Where-Object {$_.provider -like 'dsccore'} |

Select-Object -ExpandProperty HostProcessIdentifier



### Kill it


Get-Process -Id $dscProcessID | Stop-Process


No luck.

Tried then to force the matter by restarting the WMI service (REALLY BAD idea on a real server), but still no luck. 

Walked away, grabbed a beer, came back and the repro was gone.  Moral of the story is that Canadians are onto something with all that beer consumption.

No comments: