Jira (PUP-9820) managing a File user or group or mode breaks require on Windows

15 views
Skip to first unread message

Thomas Kishel (JIRA)

unread,
Jul 11, 2019, 2:14:03 PM7/11/19
to puppe...@googlegroups.com
Thomas Kishel created an issue
 
Puppet / Bug PUP-9820
managing a File user or group or mode breaks require on Windows
Issue Type: Bug Bug
Assignee: Unassigned
Components: Windows
Created: 2019/07/11 11:13 AM
Priority: Normal Normal
Reporter: Thomas Kishel
  • 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

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Thomas Kishel (JIRA)

unread,
Jul 11, 2019, 2:20:03 PM7/11/19
to puppe...@googlegroups.com

Jorie Tappa (JIRA)

unread,
Jul 15, 2019, 1:06:02 PM7/15/19
to puppe...@googlegroups.com
Jorie Tappa commented on Bug PUP-9820

Validation should happen here instead: https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/file/windows.rb#L42

We want to make sure we've mounted the drive before we make the check.

Jorie Tappa (JIRA)

unread,
Jul 15, 2019, 1:06:03 PM7/15/19
to puppe...@googlegroups.com

Austin Boyd (JIRA)

unread,
Dec 12, 2019, 9:12:05 AM12/12/19
to puppe...@googlegroups.com
Austin Boyd updated an issue
Change By: Austin Boyd
Zendesk Ticket IDs: 35491
Zendesk Ticket Count: 1

Josh Cooper (Jira)

unread,
Mar 4, 2020, 12:26:03 PM3/4/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Team: Coremunity Night's Watch
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Josh Cooper (Jira)

unread,
Mar 4, 2020, 12:26:04 PM3/4/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Team: Night's Watch Coremunity

Josh Cooper (Jira)

unread,
Jun 11, 2020, 2:59:02 AM6/11/20
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages