The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #4386

Absent files should not be treated as empty when fileserving

Added by Tom Vachon about 4 years ago. Updated almost 4 years ago.

Status:Needs More InformationStart date:07/28/2010
Priority:NormalDue date:
Assignee:Nick Lewis% Done:

0%

Category:file
Target version:-
Affected Puppet version:2.6.0 Branch:
Keywords:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This ticket may be automatically exported to the PUP project on JIRA using the button below:


Description

I am seeing inconstant behavior with file copies. I have pasted my code below and some proof. One all except one node (all worked prior to 2.6.0 upgrade), the /tmp/sudoers.tmp gets copied from the proper source. When run on the “bad” node, the /tmp/sudoers.tmp is copied over empty and hoses my sudoers file (somehow a empty file passed the visudo smoketest).

executing every time (and null'ing the file)

[root@pbsec01 tmp]# wc -l sudoers.tmp
0 sudoers.tmp

executing properly (only when changed, etc)

[root@pbjump01 tmp]# wc -l sudoers.tmp 63 sudoers.tmp

module config

class sudo {

file { "sudoers":
    name    => "/etc/sudoers",
    source  => "/tmp/sudoers.tmp",
    owner   => "root",
    group   => "root",
    mode    => "440",
    require => Exec['check_sudo'],
}   

    file { "sudo_tmp":
            name    => "/tmp/sudoers.tmp",
            source  => "puppet:///sudo/sudoers",
            before  => Exec['check_sudo'],
    }

    exec { "check_sudo":
            command => "visudo -c -f /tmp/sudoers.tmp",
            unless  => "diff /tmp/sudoers.tmp /etc/sudoers",
    }

}

I have attached the output of a run on the “bad” client with verbose and test enabled.

bad-node.out (6.12 KB) Tom Vachon, 07/28/2010 02:44 pm

History

#1 Updated by James Turnbull about 4 years ago

  • Status changed from Unreviewed to Investigating
  • Assignee set to Markus Roberts

#2 Updated by Tom Vachon about 4 years ago

I’m able to duplicate this on seemingly any file resource now and any server

#3 Updated by Tom Vachon about 4 years ago

I believe I found the root cause. Since I missed the 0.25.0 upgrade (went 0.24.x to 0.25.4 with a job change in between) I did not see the deprecation notice about the source path not including “modules”. Some of my file sources did not have it, when they changed on the master, they null'ed on the client, but when they were the same, nothing happened.

I think behavior should most likely be changed to not “null” the file, but just throw a fatal error instead, and fail the run completely. “Null'ing” the file is a bad idea and in my case, locked me out of the box until I got console into it.

#4 Updated by Markus Roberts almost 4 years ago

  • Subject changed from Unexpected behavior in between nodes to Absent files should not be treated as empty when fileserving
  • Status changed from Investigating to Needs Decision
  • Assignee deleted (Markus Roberts)
  • Priority changed from High to Normal

#5 Updated by Nick Lewis almost 4 years ago

  • Status changed from Needs Decision to Needs More Information
  • Assignee set to Nick Lewis

Tom,

I’m having trouble reproducing this. My understanding is that the issue is with sourcing from a non-existent module file. Is that correct, or is there any more detail you can give me?

The messages I get when trying to do this are:

notice: DEPRECATION NOTICE: Files found in modules without specifying 'modules' in file path will be deprecated in the next major release.  Please fix module 'sudo' when no 0.24.x clients are present
info: Could not find file_metadata for 'sudo/sudoers'

Also available in: Atom PDF