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

DSC - Package Resource Fails with Forward Slashes in "Path" Parameter

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: dsc
    • Labels:
    • Environment:

      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

    • Template:
    • Story Points:
      1
    • Sprint:
      Windows 2015-09-23

      Description

      Description

      NOTE: This is a DSC bug and not a module bug!

      If a user specifies a path with forward slashes (C:/Windows/Temp/python-2.7.10.msi) for the "Path" parameter of the "Package" DSC resource the invoke will fail to install the MSI

      PS C:\> Invoke-DscResource -Name Package -Method Set -Verbose -Property @{Ensure="Present";Path="C:/Windows/Temp/python-
      2.7.10.msi";ProductID="E2B51919-207A-43EB-AE78-733F9C6797C2";Name="Python 2.7.10"}
      VERBOSE: Performing the operation "Invoke-CimMethod: ResourceSet" on target "MSFT_DSCLocalConfigurationManager".
      VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = ResourceSet,'className' =
      MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
      VERBOSE: An LCM method call arrived from computer W2012R2 with user sid S-1-5-21-21471022-4190806042-1792990002-500.
      VERBOSE: [W2012R2]: LCM:  [ Start  Set      ]  [[Package]DirectResourceAccess]
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] Validate-StandardArguments, Path was
      C:/Windows/Temp/python-2.7.10.msi
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] The path extension was .msi
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] Parsing
      E2B51919-207A-43EB-AE78-733F9C6797C2 as an identifyingNumber
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] Parsed
      E2B51919-207A-43EB-AE78-733F9C6797C2 as {E2B51919-207A-43EB-AE78-733F9C6797C2}
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] Ensure is Present
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] product installation cannot be
      determined
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] product as boolean is False
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] The package Python 2.7.10 is not
      installed
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] Validate-StandardArguments, Path was
      C:/Windows/Temp/python-2.7.10.msi
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] The path extension was .msi
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] Parsing
      E2B51919-207A-43EB-AE78-733F9C6797C2 as an identifyingNumber
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] Parsed
      E2B51919-207A-43EB-AE78-733F9C6797C2 as {E2B51919-207A-43EB-AE78-733F9C6797C2}
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] Package configuration starting
      VERBOSE: [W2012R2]: LCM:  [ End    Set      ]  [[Package]DirectResourceAccess]  in 1.8580 seconds.
      VERBOSE: Operation 'Invoke CimMethod' complete.
      Invoke-DscResource : PowerShell DSC resource MSFT_PackageResource  failed to execute Set-TargetResource functionality
      with error message: The specified Name (Python 2.7.10) and IdentifyingNumber ({E2B51919-207A-43EB-AE78-733F9C6797C2})
      do not match Name () and IdentifyingNumber () in the MSI file
      At line:1 char:1
      + Invoke-DscResource -Name Package -Method Set -Verbose -Property @{Ens ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidOperation: (root/Microsoft/...gurationManager:String) [Invoke-DscResource], CimEx
         ception
          + FullyQualifiedErrorId : ProviderOperationExecutionFailure,Microsoft.PowerShell.DesiredStateConfiguration.Command
         s.InvokeDscResourceMethodCommand

      This bug is interesting because other DSC resources (i.e. File) allow for using both types of path separators.

      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 => 'Disable' }"

      4. Download the Python 2.7.10 MSI to the location "C:\Windows\Temp" on the SUT.
      5. Open a PowerShell console and execute the following command:

        Invoke-DscResource -Name Package -Method Set -Verbose -Property @{Ensure="Present";Path="C:/Windows/Temp/python-2.7.10.msi";ProductID="E2B51919-207A-43EB-AE78-733F9C6797C2";Name="Python 2.7.10"}

      Expect

      DSC should install the MSI successfully.

      Actual

      DSC fails

      PS C:\> Invoke-DscResource -Name Package -Method Set -Verbose -Property @{Ensure="Present";Path="C:/Windows/Temp/python-
      2.7.10.msi";ProductID="E2B51919-207A-43EB-AE78-733F9C6797C2";Name="Python 2.7.10"}
      VERBOSE: Performing the operation "Invoke-CimMethod: ResourceSet" on target "MSFT_DSCLocalConfigurationManager".
      VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = ResourceSet,'className' =
      MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
      VERBOSE: An LCM method call arrived from computer W2012R2 with user sid S-1-5-21-21471022-4190806042-1792990002-500.
      VERBOSE: [W2012R2]: LCM:  [ Start  Set      ]  [[Package]DirectResourceAccess]
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] Validate-StandardArguments, Path was
      C:/Windows/Temp/python-2.7.10.msi
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] The path extension was .msi
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] Parsing
      E2B51919-207A-43EB-AE78-733F9C6797C2 as an identifyingNumber
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] Parsed
      E2B51919-207A-43EB-AE78-733F9C6797C2 as {E2B51919-207A-43EB-AE78-733F9C6797C2}
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] Ensure is Present
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] product installation cannot be
      determined
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] product as boolean is False
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] The package Python 2.7.10 is not
      installed
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] Validate-StandardArguments, Path was
      C:/Windows/Temp/python-2.7.10.msi
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] The path extension was .msi
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] Parsing
      E2B51919-207A-43EB-AE78-733F9C6797C2 as an identifyingNumber
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] Parsed
      E2B51919-207A-43EB-AE78-733F9C6797C2 as {E2B51919-207A-43EB-AE78-733F9C6797C2}
      VERBOSE: [W2012R2]:                            [[Package]DirectResourceAccess] Package configuration starting
      VERBOSE: [W2012R2]: LCM:  [ End    Set      ]  [[Package]DirectResourceAccess]  in 1.8580 seconds.
      VERBOSE: Operation 'Invoke CimMethod' complete.
      Invoke-DscResource : PowerShell DSC resource MSFT_PackageResource  failed to execute Set-TargetResource functionality
      with error message: The specified Name (Python 2.7.10) and IdentifyingNumber ({E2B51919-207A-43EB-AE78-733F9C6797C2})
      do not match Name () and IdentifyingNumber () in the MSI file
      At line:1 char:1
      + Invoke-DscResource -Name Package -Method Set -Verbose -Property @{Ens ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidOperation: (root/Microsoft/...gurationManager:String) [Invoke-DscResource], CimEx
         ception
          + FullyQualifiedErrorId : ProviderOperationExecutionFailure,Microsoft.PowerShell.DesiredStateConfiguration.Command
         s.InvokeDscResourceMethodCommand

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              ryan.gard Ryan Gard
              QA Contact:
              Ryan Gard
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support