Start-DscConfiguration stuck!

This topic contains 6 replies, has 2 voices, and was last updated by  Prz 2 months, 1 week ago.

  • Author
    Posts
  • #79405

    Prz
    Participant

    Hello,

    I have a problem, on one of my servers cannot complete "Start-DscConfiguration". It always stucks in the same moment (line VERBOSE: Exporting alias 'nwsn'). I do not see anything interesting in logs (application and dsc). Does anybody knows what is wrong? (I reinstalled WMF 5.1 several times but it does not help).

    VERBOSE: Loading module from path
    'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\Get-DSCConfiguration.cdxml'.
    VERBOSE: Loading module from path
    'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\Get-DSCLocalConfigurationManager.cdxml'
    .
    VERBOSE: Loading module from path
    'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\Restore-DSCConfiguration.cdxml'.
    VERBOSE: Loading module from path
    'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\Get-DscConfigurationStatus.cdxml'.
    VERBOSE: Loading module from path
    'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\Stop-DscConfiguration.cdxml'.
    VERBOSE: Loading module from path
    'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\Remove-DscConfigurationDocument.cdxml'.
    VERBOSE: Loading module from path
    'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\Disable-DscDebug.cdxml'.
    VERBOSE: Loading module from path
    'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\Enable-DscDebug.cdxml'.
    VERBOSE: Loading module from path
    'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\DSCClassResources\WindowsPackageCab\Win
    dowsPackageCab.psd1'.
    VERBOSE: Loading module from path
    'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\DSCClassResources\WindowsPackageCab\Win
    dowsPackageCab.psm1'.
    VERBOSE: Loading module from path
    'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\DSCResources\CompositeResourceHelper.ps
    m1'.
    VERBOSE: Exporting function 'BuildResourceCommonParameters'.
    VERBOSE: Exporting function 'BuildResourceString'.
    VERBOSE: Importing function 'BuildResourceCommonParameters'.
    VERBOSE: Importing function 'BuildResourceString'.
    VERBOSE: Importing function 'BuildResourceCommonParameters'.
    VERBOSE: Importing function 'BuildResourceString'.
    VERBOSE: Importing function 'BuildResourceCommonParameters'.
    VERBOSE: Importing function 'BuildResourceString'.
    VERBOSE: Importing function 'BuildResourceCommonParameters'.
    VERBOSE: Importing function 'BuildResourceString'.
    VERBOSE: Importing function 'BuildResourceCommonParameters'.
    VERBOSE: Importing function 'BuildResourceString'.
    VERBOSE: Time taken for configuration job to complete is 0.082 seconds
    VERBOSE: Exporting function 'New-PSWorkflowSession'.
    VERBOSE: Exporting alias 'nwsn'.

  • #79541

    Don Jones
    Keymaster

    Does this occur with a "full" configuration MOF, or have you also experienced this with a "minimal" configuration that just attempts to... I dunno, set an environment variable? I wasn't expecting to see Workflow crop up, is why I ask.

    • #79559

      Prz
      Participant

      I have been running this command: Start-DscConfiguration -Path path to the mof file -ComputerName $env:COMPUTERNAME -Force.

      If I take a look at the powershell jobs, I can see one for the action and one child job that are in the "Running" status all the time.

      Main Job
      State : Running
      HasMoreData : True
      StatusMessage : Running
      Location : server name
      StartParameters : {}
      Command : Start-DscConfiguration -Path
      path -ComputerName $env:COMPUTERNAME -Force
      JobStateInfo : Running
      Finished : System.Threading.ManualResetEvent
      InstanceId : 3b081077-f2b5-440d-9905-4239056f83cd
      Id : 1
      Name : Job1
      ChildJobs : {Job2}
      PSBeginTime : 9/13/2017 10:24:02 AM
      PSEndTime :
      PSJobTypeName : ConfigurationJob
      Output : {}
      Error : {}
      Progress : {}
      Verbose : {}
      Debug : {}
      Warning : {}
      Information : {}

      Child Job
      State : Running
      StandardParameters : {ConfigurationData, Force}
      HasMoreData : True
      Location : server name
      StatusMessage : Running
      JobId :
      Bookmark :
      Streamed : False
      RestartInProgress : False
      InDisconnectedMode : False
      EnableWhatIf : False
      TestDscConfigurationCmdlet : False
      ApplyUseExisting : False
      UpdateConfigCall : False
      Session :
      ErrorRecordInStream : False
      StartParameters : {}
      Command : Start-DscConfiguration -Path path -ComputerName $env:COMPUTERNAME -Force
      JobStateInfo : Running
      Finished : System.Threading.ManualResetEvent
      InstanceId : bd308ad8-dea3-4f93-bbd2-4487a19dec08
      Id : 2
      Name : Job2
      ChildJobs : {}
      PSBeginTime : 9/13/2017 10:24:02 AM
      PSEndTime :
      PSJobTypeName : ConfigurationJob
      Output : {}
      Error : {}
      Progress : {}
      Verbose : {Perform operation 'Invoke CimMethod' with following parameters, "methodName' = SendConfigurationApply,'className' =
      MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.}
      Debug : {}
      Warning : {}
      Information : {}

      I'd like to find any error or warning why the jobs stuck but cannot...

  • #79562

    Don Jones
    Keymaster

    Details would be int he DSC Operational and Debug logs (the latter being hidden by default in Event Viewer). Anything there?

  • #79568

    Prz
    Participant

    unfortunately there is no events that might help. the only error I see is because current configuration was stopped by "-Force" parameter... 🙁

    I can also add that the command and whole script is ok because it has successfully run on many other servers. I was doing it many times on the server that has the problem, during one of tries it just stopped working correctly and I don't know why.

    • #79766

      Prz
      Participant

      hello I have an update. Today I found error message (event ID 4131) in the event viewer -> DSC operational logs. The error message is:

      Job DscTimerConsistencyOperationResult :
      DSC Engine Error :
      Error Message: NULL
      Error Code : 1

      It does not tell me anything, also in the internet there is no solution for such error.

      Is there any option to fully reinstall DSC engine? reinstall of WMF 5.1 does not help.

  • #79784

    Prz
    Participant

    I found the problem.

    I checked the most current json file in 'C:\Windows\System32\Configuration\ConfigurationStatus' – this is location where DSC logs are also being stored. In the log file I found such line:

    [DSCEngine] Warning LCM is in Debug 'ResourceScriptBreakAll' mode. Resource script processing will be stopped to wait for PowerShell script debugger to attach."},

    The 'ResourceScriptBreakAll mode' has been set when I enabled debugging by 'Enable-DscDebug -BreakAll' cmdlet.
    After I disabled debugging by the 'Disable-DscDebug' cmdlet, my script completed as expected.

    I hope this will help somebody.

You must be logged in to reply to this topic.