Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-2485

DSC - Setting LCM to "Pull" Refresh Mode Causes Crash

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • None
    • None
    • dsc
    • Module Version: 0.1.​​1​-​​b2​​0​0​​​78​​-​e​​c4​​7​2​​29​​​c
      Puppet Agent Version: 1.2.2 (Gold)
      Agent: Windows 2012 R2 x64

    Description

      Description

      If a user the "Pull" refresh mode for the LCM the module will crash:

      Notice: Compiled catalog for w2012r2.vm in environment production in 0.45 second
      s
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: VERBOSE: Performing the operation "Invoke-CimMethod:
       
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: SendMetaConfigurationApply" on target "MSFT_DSCLocal
      ConfigurationManager".
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: VERBOSE: Perform operation 'Invoke CimMethod' with f
      ollowing parameters,
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: ''methodName' = SendMetaConfigurationApply,'classNam
      e' =
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: MSFT_DSCLocalConfigurationManager,'namespaceName' =
       
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: ROOT/Microsoft/Windows/DesiredStateConfiguration'.
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: VERBOSE: An LCM method call arrived from computer W2
      012R2 with user sid
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: S-1-5-21-21471022-4190806042-1792990002-500.
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: VERBOSE: [W2012R2]: LCM:  [ Start  Set      ]
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: VERBOSE: [W2012R2]: LCM:  [ End    Set      ]
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: Invoke-CimMethod : The current refresh mode is PULL
      but there are no
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: configuration download managers defined.
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: At line:1 char:1
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: + Invoke-CimMethod @invokeParams
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns:     + CategoryInfo          : NotSpecified: (ROOT/Mi
      crosoft/...gurationManager
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns:    :String) [Invoke-CimMethod], CimException
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns:     + FullyQualifiedErrorId : MI RESULT 1,Microsoft.
      Management.Infrastructure.
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns:    CimCmdlets.InvokeCimMethodCommand
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns:     + PSComputerName        : localhost
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns:
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: VERBOSE: Operation 'Invoke CimMethod' complete.
      Error: $lcmRefreshMode = 'Pull'
      $generationDate = (Get-Date -Format 'M/d/yyyy HH:mm:ss')
      $encoding       = [Text.Encoding]::UTF8
      $namespace      = 'root/Microsoft/Windows/DesiredStateConfiguration'
      $className      = 'MSFT_DSCLocalConfigurationManager'
      $generationHost = [Environment]::MachineName
       
      $mofData = @"
      /*
      @TargetNode=''localhost''
      @GeneratedBy=PUPPET
      @GenerationDate=$generationDate
      @GenerationHost=$generationHost
      */
       
      instance of MSFT_DSCMetaConfiguration as `$MSFT_DSCMetaConfiguration1ref
      {
      RefreshMode = "$lcmRefreshMode";
      };
       
      instance of OMI_ConfigurationDocument
      {
      Version="2.0.0";
      MinimumCompatibleVersion = "1.0.0";
      CompatibleVersionAdditionalProperties= { "MSFT_DSCMetaConfiguration:StatusRetent
      ionTimeInDays" };
      Author="PUPPET";
      GenerationDate="$generationDate";
      GenerationHost="$generationHost";
      Name="LCMSettings";
      };
      "@
       
      $totalSize = [BitConverter]::GetBytes($mofData.Length + 4)
      $bytes     = $totalSize + $encoding.GetBytes($mofData)
       
      $cimClass       = Get-CimClass -Namespace $namespace -ClassName $className
      $sessionOptions = New-CimSessionOption -Protocol Wsman
      $wsmanSession   = New-CimSession -ComputerName localhost -SessionOption $session
      Options
       
      $invokeParams = @{
        Verbose    = $true
        CimClass   = $cimClass
        CimSession = $wsmanSession
        MethodName = 'SendMetaConfigurationApply'
        Arguments  = @{
          ConfigurationData = $bytes;
        }
      }
       
      Invoke-CimMethod @invokeParams
       returned 1 instead of one of [0]
      Error: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm_
      refreshmode_Pull]/returns: change from notrun to 0 failed: $lcmRefreshMode = 'Pu
      ll'
      $generationDate = (Get-Date -Format 'M/d/yyyy HH:mm:ss')
      $encoding       = [Text.Encoding]::UTF8
      $namespace      = 'root/Microsoft/Windows/DesiredStateConfiguration'
      $className      = 'MSFT_DSCLocalConfigurationManager'
      $generationHost = [Environment]::MachineName
       
      $mofData = @"
      /*
      @TargetNode=''localhost''
      @GeneratedBy=PUPPET
      @GenerationDate=$generationDate
      @GenerationHost=$generationHost
      */
       
      instance of MSFT_DSCMetaConfiguration as `$MSFT_DSCMetaConfiguration1ref
      {
      RefreshMode = "$lcmRefreshMode";
      };
       
      instance of OMI_ConfigurationDocument
      {
      Version="2.0.0";
      MinimumCompatibleVersion = "1.0.0";
      CompatibleVersionAdditionalProperties= { "MSFT_DSCMetaConfiguration:StatusRetent
      ionTimeInDays" };
      Author="PUPPET";
      GenerationDate="$generationDate";
      GenerationHost="$generationHost";
      Name="LCMSettings";
      };
      "@
       
      $totalSize = [BitConverter]::GetBytes($mofData.Length + 4)
      $bytes     = $totalSize + $encoding.GetBytes($mofData)
       
      $cimClass       = Get-CimClass -Namespace $namespace -ClassName $className
      $sessionOptions = New-CimSessionOption -Protocol Wsman
      $wsmanSession   = New-CimSession -ComputerName localhost -SessionOption $session
      Options
       
      $invokeParams = @{
        Verbose    = $true
        CimClass   = $cimClass
        CimSession = $wsmanSession
        MethodName = 'SendMetaConfigurationApply'
        Arguments  = @{
          ConfigurationData = $bytes;
        }
      }
       
      Invoke-CimMethod @invokeParams
       returned 1 instead of one of [0]
      Notice: Applied catalog in 2.09 seconds

      Attachments

      • None

      Repro Steps

      1. Install Puppet Agent on the Windows agent nodes.
      2. Install DSC module from the modules staging Forge on the agent nodes:

        puppet module install puppetlabs-dsc --module_repository https://api-module-staging.puppetlabs.com

      3. Configure LCM refresh mode:

        puppet apply -e "dsc::lcm_config { 'disable_lcm': refresh_mode => 'Pull' }"

      Expect

      The Puppet apply should complete successfully and change the LCM refresh mode to "Pull".

      Actual

      Puppet crashes:

      Notice: Compiled catalog for w2012r2.vm in environment production in 0.45 second
      s
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: VERBOSE: Performing the operation "Invoke-CimMethod:
       
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: SendMetaConfigurationApply" on target "MSFT_DSCLocal
      ConfigurationManager".
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: VERBOSE: Perform operation 'Invoke CimMethod' with f
      ollowing parameters,
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: ''methodName' = SendMetaConfigurationApply,'classNam
      e' =
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: MSFT_DSCLocalConfigurationManager,'namespaceName' =
       
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: ROOT/Microsoft/Windows/DesiredStateConfiguration'.
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: VERBOSE: An LCM method call arrived from computer W2
      012R2 with user sid
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: S-1-5-21-21471022-4190806042-1792990002-500.
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: VERBOSE: [W2012R2]: LCM:  [ Start  Set      ]
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: VERBOSE: [W2012R2]: LCM:  [ End    Set      ]
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: Invoke-CimMethod : The current refresh mode is PULL
      but there are no
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: configuration download managers defined.
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: At line:1 char:1
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: + Invoke-CimMethod @invokeParams
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns:     + CategoryInfo          : NotSpecified: (ROOT/Mi
      crosoft/...gurationManager
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns:    :String) [Invoke-CimMethod], CimException
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns:     + FullyQualifiedErrorId : MI RESULT 1,Microsoft.
      Management.Infrastructure.
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns:    CimCmdlets.InvokeCimMethodCommand
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns:     + PSComputerName        : localhost
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns:
      Notice: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm
      _refreshmode_Pull]/returns: VERBOSE: Operation 'Invoke CimMethod' complete.
      Error: $lcmRefreshMode = 'Pull'
      $generationDate = (Get-Date -Format 'M/d/yyyy HH:mm:ss')
      $encoding       = [Text.Encoding]::UTF8
      $namespace      = 'root/Microsoft/Windows/DesiredStateConfiguration'
      $className      = 'MSFT_DSCLocalConfigurationManager'
      $generationHost = [Environment]::MachineName
       
      $mofData = @"
      /*
      @TargetNode=''localhost''
      @GeneratedBy=PUPPET
      @GenerationDate=$generationDate
      @GenerationHost=$generationHost
      */
       
      instance of MSFT_DSCMetaConfiguration as `$MSFT_DSCMetaConfiguration1ref
      {
      RefreshMode = "$lcmRefreshMode";
      };
       
      instance of OMI_ConfigurationDocument
      {
      Version="2.0.0";
      MinimumCompatibleVersion = "1.0.0";
      CompatibleVersionAdditionalProperties= { "MSFT_DSCMetaConfiguration:StatusRetent
      ionTimeInDays" };
      Author="PUPPET";
      GenerationDate="$generationDate";
      GenerationHost="$generationHost";
      Name="LCMSettings";
      };
      "@
       
      $totalSize = [BitConverter]::GetBytes($mofData.Length + 4)
      $bytes     = $totalSize + $encoding.GetBytes($mofData)
       
      $cimClass       = Get-CimClass -Namespace $namespace -ClassName $className
      $sessionOptions = New-CimSessionOption -Protocol Wsman
      $wsmanSession   = New-CimSession -ComputerName localhost -SessionOption $session
      Options
       
      $invokeParams = @{
        Verbose    = $true
        CimClass   = $cimClass
        CimSession = $wsmanSession
        MethodName = 'SendMetaConfigurationApply'
        Arguments  = @{
          ConfigurationData = $bytes;
        }
      }
       
      Invoke-CimMethod @invokeParams
       returned 1 instead of one of [0]
      Error: /Stage[main]/Main/Dsc::Lcm_config[disable_lcm]/Exec[dsc_provider_set_lcm_
      refreshmode_Pull]/returns: change from notrun to 0 failed: $lcmRefreshMode = 'Pu
      ll'
      $generationDate = (Get-Date -Format 'M/d/yyyy HH:mm:ss')
      $encoding       = [Text.Encoding]::UTF8
      $namespace      = 'root/Microsoft/Windows/DesiredStateConfiguration'
      $className      = 'MSFT_DSCLocalConfigurationManager'
      $generationHost = [Environment]::MachineName
       
      $mofData = @"
      /*
      @TargetNode=''localhost''
      @GeneratedBy=PUPPET
      @GenerationDate=$generationDate
      @GenerationHost=$generationHost
      */
       
      instance of MSFT_DSCMetaConfiguration as `$MSFT_DSCMetaConfiguration1ref
      {
      RefreshMode = "$lcmRefreshMode";
      };
       
      instance of OMI_ConfigurationDocument
      {
      Version="2.0.0";
      MinimumCompatibleVersion = "1.0.0";
      CompatibleVersionAdditionalProperties= { "MSFT_DSCMetaConfiguration:StatusRetent
      ionTimeInDays" };
      Author="PUPPET";
      GenerationDate="$generationDate";
      GenerationHost="$generationHost";
      Name="LCMSettings";
      };
      "@
       
      $totalSize = [BitConverter]::GetBytes($mofData.Length + 4)
      $bytes     = $totalSize + $encoding.GetBytes($mofData)
       
      $cimClass       = Get-CimClass -Namespace $namespace -ClassName $className
      $sessionOptions = New-CimSessionOption -Protocol Wsman
      $wsmanSession   = New-CimSession -ComputerName localhost -SessionOption $session
      Options
       
      $invokeParams = @{
        Verbose    = $true
        CimClass   = $cimClass
        CimSession = $wsmanSession
        MethodName = 'SendMetaConfigurationApply'
        Arguments  = @{
          ConfigurationData = $bytes;
        }
      }
       
      Invoke-CimMethod @invokeParams
       returned 1 instead of one of [0]
      Notice: Applied catalog in 2.09 seconds

      Attachments

        Issue Links

          Activity

            People

              ryan.gard Ryan Gard
              ryan.gard Ryan Gard
              Ryan Gard Ryan Gard
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support