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

puppetlabs-dsc : xSQLServer error when copying files

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: dsc 1.5.0
    • Component/s: None
    • Labels:
      None
    • QA Risk Assessment:
      Needs Assessment

      Description

      Basic Info
      Module Version: 1.4.0
      Puppet Version: 4.8.2
      OS Name/Version: Windows Server 2016

      First, I rebuild puppetlabs-dsc module (version 1.4.0) using the new DSC resources available in Microsoft repositories (using the rebuild guide).
      After running a puppet run with a manifest (that was not using the xSQLServer DSC resource) the following error occurs:

      Could not set 'file' on ensure: No such file or directory @ dir_s_mkdir - C:/ProgramData/PuppetLabs/puppet/cache/lib/puppet_x/dsc_resources/xSQLServer/DSCResources/MSFT_xSQLServerAlwaysOnAvailabilityGroupDatabaseMembership/en-US/MSFT_xSQLServerAlwaysOnAvailabilityGroupDatabaseMembership.strings.psd120171005-3496-3p8e1p.lock
      Wrapped exception:
      No such file or directory @ dir_s_mkdir - C:/ProgramData/PuppetLabs/puppet/cache/lib/puppet_x/dsc_resources/xSQLServer/DSCResources/MSFT_xSQLServerAlwaysOnAvailabilityGroupDatabaseMembership/en-US/MSFT_xSQLServerAlwaysOnAvailabilityGroupDatabaseMembership.strings.psd120171005-3496-3p8e1p.lock
      

      Desired Behavior:
      Apply the manifest without this error

      Actual Behavior:
      When running, brfore trying to apply the resources in the puppet manifest, the error described above occurs.

      PS C:\Windows\system32> puppet agent -t -v
      Info: Using configured environment 'rchavesg_dsc'
      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Error: Could not set 'file' on ensure: No such file or directory @ dir_s_mkdir - C:/ProgramData/PuppetLabs/puppet/cache/lib/puppet_x/dsc_resources/xSQLServer/DS
      CResources/MSFT_xSQLServerAlwaysOnAvailabilityGroupDatabaseMembership/en-US/MSFT_xSQLServerAlwaysOnAvailabilityGroupDatabaseMembership.strings.psd120171005-2760
      -6u89g1.lock
      Error: Could not set 'file' on ensure: No such file or directory @ dir_s_mkdir - C:/ProgramData/PuppetLabs/puppet/cache/lib/puppet_x/dsc_resources/xSQLServer/DS
      CResources/MSFT_xSQLServerAlwaysOnAvailabilityGroupDatabaseMembership/en-US/MSFT_xSQLServerAlwaysOnAvailabilityGroupDatabaseMembership.strings.psd120171005-2760
      -6u89g1.lock
      Wrapped exception:
      No such file or directory @ dir_s_mkdir - C:/ProgramData/PuppetLabs/puppet/cache/lib/puppet_x/dsc_resources/xSQLServer/DSCResources/MSFT_xSQLServerAlwaysOnAvail
      abilityGroupDatabaseMembership/en-US/MSFT_xSQLServerAlwaysOnAvailabilityGroupDatabaseMembership.strings.psd120171005-2760-6u89g1.lock
      Error: /File[C:/ProgramData/PuppetLabs/puppet/cache/lib/puppet_x/dsc_resources/xSQLServer/DSCResources/MSFT_xSQLServerAlwaysOnAvailabilityGroupDatabaseMembershi
      p/en-US/MSFT_xSQLServerAlwaysOnAvailabilityGroupDatabaseMembership.strings.psd1]/ensure: change from absent to file failed: Could not set 'file' on ensure: No s
      uch file or directory @ dir_s_mkdir - C:/ProgramData/PuppetLabs/puppet/cache/lib/puppet_x/dsc_resources/xSQLServer/DSCResources/MSFT_xSQLServerAlwaysOnAvailabil
      ityGroupDatabaseMembership/en-US/MSFT_xSQLServerAlwaysOnAvailabilityGroupDatabaseMembership.strings.psd120171005-2760-6u89g1.lock
      Info: Loading facts
      Info: Caching catalog for windev-test-07
      Info: Applying configuration version '1507206753'
      Info: A reboot is required to progress further. Notifying Puppet.
      Warning: No reboot resource found in the graph that has 'dsc_reboot' as its name. Cannot signal reboot to Puppet.
      Notice: /Stage[main]/Hg_windows_dev::Dsc_tests/Dsc_xsystemvirtualmemory[set-pagefile-with-dsc]/ensure: created
      Notice: Applied catalog in 17.27 seconds
      

      the manifest I'm running is this:

      class hg_windows_dev::dsc_tests {
       
       # test default puppet resource
        file{'c:/puppet_file_resource.txt':
          ensure  => present,
          content => 'This is a test! Using Puppet File resource.'
        }
       
        # test simple resource
        dsc_file { 'create-file-DSC':
          dsc_ensure          => 'Present',
          dsc_destinationpath => 'c:/puppet_dsc_file.txt',
          dsc_contents        => 'this is a test! Using DSC through Puppet'
        }
       
        # TO TEST CONFLICTS WITH PUPPET-POWERSHELL MODULE
        # Setting Powershell Execution Policy to unrestricted
        exec { 'Set PowerShell execution policy unrestricted':
          command  => 'Set-ExecutionPolicy Unrestricted',
          unless   => 'if ((Get-ExecutionPolicy -Scope LocalMachine) -eq "Unrestricted") { exit 0 } else { exit 1 }',
          provider => powershell
        }
       
       
       # Windows Components/Remote Desktop Services/Remote Desktop Session Host/Licensing
         dsc_cadministrativetemplatesetting { 'test-dsc_cAdministrativeTemplateSetting dword':
           dsc_keyvaluename => 'SOFTWARE\\Policies\\Microsoft\\Windows NT\\Terminal Services\\LicensingMode',
           dsc_policytype   => 'Machine',
           dsc_data         => ['2'],
           dsc_ensure       => 'Present',
           dsc_type         => 'DWord',
        }
       
       # User Configuration/Administrative Templates/System/User Profiles
         dsc_cadministrativetemplatesetting { 'ExcludeProfileDirs':
           dsc_keyvaluename => 'SOFTWARE\\Policies\\Microsoft\\Windows\\System\\ExcludeProfileDirs',
           dsc_policytype   => 'User',
           dsc_data         => 'dropbox;downloads;My Documents',
           dsc_ensure       => 'Present',
           dsc_type         => 'String',
        }
       
       # test with security setting
         dsc_cadministrativetemplatesetting { 'Certification Path Validation-1':
           dsc_keyvaluename => 'SOFTWARE\\Policies\\Microsoft\\SystemCertificates\\AuthRoot\\DisableRootAutoUpdate',
           dsc_policytype   => 'Machine',
           dsc_data         => '0',
           dsc_ensure       => 'Present',
           dsc_type         => 'DWord',
        }
        
        dsc_cadministrativetemplatesetting { 'Certification Path Validation-2':
           dsc_keyvaluename => 'SOFTWARE\\Policies\\Microsoft\\SystemCertificates\\ChainEngine\\Config\\ChainRevAccumulativeUrlRetrievalTimeoutMilliseconds',
           dsc_policytype   => 'Machine',
           dsc_data         => '36000',
           dsc_ensure       => 'Present',
           dsc_type         => 'DWord',
        }
       
        dsc_cadministrativetemplatesetting { 'Certification Path Validation-3':
           dsc_keyvaluename => 'SOFTWARE\\Policies\\Microsoft\\SystemCertificates\\ChainEngine\\Config\\ChainUrlRetrievalTimeoutMilliseconds',
           dsc_policytype   => 'Machine',
           dsc_data         => '69000',
           dsc_ensure       => 'Present',
           dsc_type         => 'DWord',
        }
       
        dsc_cadministrativetemplatesetting { 'Certification Path Validation-4':
           dsc_keyvaluename => 'SOFTWARE\\Policies\\Microsoft\\SystemCertificates\\ChainEngine\\Config\\CrossCertDownloadIntervalHours',
           dsc_policytype   => 'Machine',
           dsc_data         => '963',
           dsc_ensure       => 'Present',
           dsc_type         => 'DWord',
        }
       
        dsc_cadministrativetemplatesetting { 'Certification Path Validation-5':
           dsc_keyvaluename => 'SOFTWARE\\Policies\\Microsoft\\SystemCertificates\\ChainEngine\\Config\\Options',
           dsc_policytype   => 'Machine',
           dsc_data         => '0',
           dsc_ensure       => 'Present',
           dsc_type         => 'DWord',
        }
       
       
      # test a custom resource
        dsc_xsystemvirtualmemory { 'set-pagefile-with-dsc':
          dsc_configureoption => 'CustomSize',
          dsc_initialsize         => 2176,
          dsc_maximumsize         => 4224,
          dsc_driveletter         => 'C:'
        }
      }
      
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                james.pogran James Pogran
                Reporter:
                ricardogaspar2 Ricardo Gaspar
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support