Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-9820

managing a File user or group or mode breaks require on Windows

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Accepted
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Windows
    • Labels:
      None
    • Template:
      PUP Bug Template
    • Team:
      Coremunity
    • Method Found:
      Needs Assessment
    • Zendesk Ticket IDs:
      35491
    • Zendesk Ticket Count:
      1
    • QA Risk Assessment:
      Needs Assessment

      Description

      • Puppet Version:* 6.0.9
      • Puppet Server Version: 2019.0.3
      • OS Name/Version: Windows 2002

      A File resource that depends (via require) on another resource to create the volume of the file fails to honor the dependency when managing owner, group, and/or mode ... but only on Windows where it generates a Validation ... failed error.

      node 'pe-201903-agent-win2012' {
        exec { 'Make Drive':
          command  => 'sleep 5',
          provider => powershell,
        }
        file { 'z:\test.txt':
          owner   => 'SYSTEM',
          group   => 'BUILTIN\Administrators',
          mode    => '0777',
          content => 'Test',
          require => Exec['Make Drive'],
        }
      }
       
      node 'pe-201903-agent' {
        exec { 'Make Drive':
          command  => '/bin/sleep 5',
        }
        file { '/xxx/test.txt':
          owner   => 'root',
          group   => 'root',
          mode    => '0770',
          content => 'Test',
          require => Exec['Make Drive'],
        }
      }
      

      Windows:

      C:\Users\Administrator>puppet agent -t
      Info: Using configured environment 'production'
      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Info: Retrieving locales
      Info: Loading facts
      Info: Caching catalog for pe-201903-agent-win2012
      Error: Failed to apply catalog: Validation of File[z:\test.txt] failed: Failed to get volume information: 
      The system cannot find the path specified. (file: /etc/puppetlabs/code/environments/production/manifests/site.pp, line: 9)
      

      Commenting out the owner, group, and mode results in the expected dependency:

      C:\Users\Administrator>puppet agent -t
      Info: Using configured environment 'production'
      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Info: Retrieving locales
      Info: Loading facts
      Info: Caching catalog for pe-201903-agent-win2012
      Info: Applying configuration version '1562863643'
      Notice: /Stage[main]/Main/Node[pe-201903-agent-win2012]/Exec[Make Drive]/returns: executed successfully (corrective)
      Error: Could not set 'file' on ensure: No such file or directory @ dir_s_mkdir - z:/test.txt20190711-3000-1tsuh6b.lock (file: /etc/puppetlabs/code/environments/production/manifests/site.pp, line: 9)
      Error: Could not set 'file' on ensure: No such file or directory @ dir_s_mkdir - z:/test.txt20190711-3000-1tsuh6b.lock (file: /etc/puppetlabs/code/environments/production/manifests/site.pp, line: 9)
      Wrapped exception:
      No such file or directory @ dir_s_mkdir - z:/test.txt20190711-3000-1tsuh6b.lock
      Error: /Stage[main]/Main/Node[pe-201903-agent-win2012]/File[z:\test.txt]/ensure: change from 'absent' to 'file' failed: Could not set 'file' on ensure: No such file or directory @ dir_s_mkdir - z:/test.txt20190711-3000-1tsuh6b.lock (file: /etc/puppetlabs/code/environments/production/manifests/site.pp, line: 9)
      Info: Node[pe-201903-agent-win2012]: Unscheduling all events on Node[pe-201903-agent-win2012]
      Notice: Applied catalog in 6.62 seconds
      

      This issue does not occur on Linux:

      [root@pe-201903-agent ~]# puppet agent -t
      Info: Using configured environment 'production'
      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Info: Retrieving locales
      Info: Loading facts
      Info: Caching catalog for pe-201903-agent
      Info: Applying configuration version '1562863624'
      Notice: /Stage[main]/Main/Node[pe-201903-agent]/Exec[Make Drive]/returns: executed successfully (corrective)
      Error: Could not set 'file' on ensure: No such file or directory @ dir_s_mkdir - /xxx/test.txt20190711-4817-1j2ypyr.lock (file: /etc/puppetlabs/code/environments/production/manifests/site.pp, line: 24)
      Error: Could not set 'file' on ensure: No such file or directory @ dir_s_mkdir - /xxx/test.txt20190711-4817-1j2ypyr.lock (file: /etc/puppetlabs/code/environments/production/manifests/site.pp, line: 24)
      Wrapped exception:
      No such file or directory @ dir_s_mkdir - /xxx/test.txt20190711-4817-1j2ypyr.lock
      Error: /Stage[main]/Main/Node[pe-201903-agent]/File[/xxx/test.txt]/ensure: change from 'absent' to 'file' failed: Could not set 'file' on ensure: No such file or directory @ dir_s_mkdir - /xxx/test.txt20190711-4817-1j2ypyr.lock (file: /etc/puppetlabs/code/environments/production/manifests/site.pp, line: 24)
      Info: Node[pe-201903-agent]: Unscheduling all events on Node[pe-201903-agent]
      Notice: Applied catalog in 5.05 seconds
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            tom.kishel Thomas Kishel
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support