Bug #2631

show_diff no longer works

Added by Malcolm Howe 11 months ago. Updated 3 months ago.

Status:Closed Start:09/14/2009
Priority:Normal Due date:
Assigned to:Jesse Wolfe % Done:

0%

Category:fileserving
Target version:0.25.2
Affected version:0.25.0 Branch:
Keywords:
Votes: 0

Description

After upgrading from 0.24.8 to 0.25.0 diffs of modified files are no longer shown when puppetd —test is run with show_diff=true in puppet.conf.

0001-Fixing-2631-show_diff-sometimes-doesn-t-happen.patch (2.6 KB) Jesse Wolfe, 11/05/2009 02:31 am

Associated revisions

Revision 136949da70f1a6715734faa6ac3c464f386fccfb
Added by Jesse Wolfe 9 months ago

Fixing #2631 show_diff sometimes doesn’t happen

This patch fixes a code-path in Puppet::Type::File::Content#insync? that was failing to show a diff when the content’s source came from a template.

I was only able to reproduce one of the two such failures that Malcolm Howe reported, but I think it’s likely that they were both caused by this same bug.

Signed-off-by: Jesse Wolfe jes5199@gmail.com

History

Updated by Markus Roberts 11 months ago

  • Status changed from Unreviewed to Accepted
  • Target version set to 0.25.1

This apparently went away with commit:“0149e2e125fc09bb5a8c1ff206cd46e06c0593” cd "Converting the file ‘source’ property to a parameter."

Updated by James Turnbull 11 months ago

Markus – I edited your comment – you can actually create a reference to the commit using the syntax:

commit:"ref"

Might help people.

Updated by Markus Roberts 11 months ago

  • Assigned to set to Rein Henrichs

Updated by Rein Henrichs 11 months ago

  • Assigned to deleted (Rein Henrichs)

Updated by Steven Jenkins 10 months ago

Have not been able to reproduce this problem:

Server:

sbin/puppetmasterd —version

0.25.0

Client:

sbin/puppetd —version

0.25.0

File in question: /tmp/testfile.conf

(change contents on client)

Run client, and the following is output:

sbin/puppetd —test once-only —no-daemonize —verbose

… —– /tmp/testfile.conf 2009-09-18 19:56:15.000000000 -0400 +++ /tmp/puppet-diffing.23319.0 2009-09-18 19:56:38.000000000 -0400 @@ -1,2 +1 @@ -Sep 18, 2009 -Changed to test Redmine 2631 +sep 18, 2009 …

I’ll try mixed versions next.

Updated by Steven Jenkins 10 months ago

Steven Jenkins wrote:

Have not been able to reproduce this problem:

Server:

sbin/puppetmasterd —version

0.25.0

Client:

sbin/puppetd —version

0.25.0

File in question: /tmp/testfile.conf

(change contents on client)

Run client, and the following is output:

sbin/puppetd —test once-only —no-daemonize —verbose

… —– /tmp/testfile.conf 2009-09-18 19:56:15.000000000 -0400 +++ /tmp/puppet-diffing.23319.0 2009-09-18 19:56:38.000000000 -0400 @@ -1,2 +1 @@ -Sep 18, 2009 -Changed to test Redmine 2631 +sep 18, 2009 …

I’ll try mixed versions next.

Also, my puppet.conf on the client:

[puppetd] server = geppetto.endpoint.com show_diff = true

Updated by Steven Jenkins 10 months ago

Steven Jenkins wrote:

Steven Jenkins wrote:

Have not been able to reproduce this problem:

Server:

sbin/puppetmasterd —version

0.25.0

Client:

sbin/puppetd —version

0.25.0

Also confirmed

Server: 0.25.0 Client: 0.24.8

works.

Updated by Steven Jenkins 10 months ago

  • Status changed from Accepted to Needs more information

Updated by R.I. Pienaar aka Volcane 10 months ago

I can reproduce this:

  • client and master 0.25.0
  • simple file copy operation using a template to produce the file in question
  • added the words ‘foo foo foo’ to the file on the node
# puppetd --genconfig|grep show_diff
   show_diff = true
# puppetd --test
info: Caching catalog for dev2.pinetecltd.net
info: Applying configuration version '1253416116'
notice: //bugtest/File[/tmp/foo]/checksum: checksum changed '{md5}97573593b3049fbfc1a50625f34b50ad' to '{md5}ee52431cf3f63f2b24b854b36def4ff9'
info: Filebucket[/var/lib/puppet/clientbucket]: Adding /tmp/foo(ee52431cf3f63f2b24b854b36def4ff9)
info: //bugtest/File[/tmp/foo]: Filebucketed /tmp/foo to puppet with sum ee52431cf3f63f2b24b854b36def4ff9
notice: //bugtest/File[/tmp/foo]/content: content changed '{md5}ee52431cf3f63f2b24b854b36def4ff9' to 'unknown checksum'
notice: Finished catalog run in 0.06 seconds

Updated by Steven Jenkins 10 months ago

Thanks for the additional testing. It might be useful to know that I had turned off filebuckets for my tests (i.e., I was trying to simplify down to the essentials).

Updated by James Turnbull 10 months ago

  • Status changed from Needs more information to Accepted

Updated by James Turnbull 10 months ago

  • Category set to fileserving
  • Assigned to set to Steven Jenkins

Steve – what’s the status of a fix for this?

Updated by James Turnbull 10 months ago

  • Target version changed from 0.25.1 to 0.25.2

Updated by Steven Jenkins 10 months ago

I just reran the tests with filebuckets turned on and have still not been able to replicate the problem.

# sbin/puppetmasterd --version
0.25.0

# cat /etc/puppet/manifests/site.pp
import "classes/*"

filebucket {
        main:
                server => "geppetto.endpoint.com"
}

File {
        backup => main
}

node default {
    include sudo
}
node 'pinocchio.endpoint.com' {
 include test_class 
 include b_class
}
node 'geppetto.endpoint.com' {
 include test_class 
}

# cat /etc/puppet/manifests/classes/test_class.pp 
# Create "/tmp/testfile" if it doesn't exist.
class test_class {
  file { "/tmp/testfile":
    ensure => present,
    mode   => 644,
    owner  => root,
    group  => root
  }
}
# cat /etc/puppet/manifests/classes/b_class.pp 
class b_class {
        file {
                "/tmp/testfile.conf":
                checksum => md5,
                owner => root,
                mode => 440,
        source => "puppet://geppetto.endpoint.com/pupfiles/testfile.conf"
        }
}

then on the client:

# sbin/puppetd --version
0.25.0

# cat /etc/puppet/puppet.conf 
[puppetd]
  server = geppetto.endpoint.com
  show_diff = true

(modify the file):

# sbin/puppetd --test once-only --no-daemonize
info: Caching catalog for pinocchio.endpoint.com
info: Applying configuration version '1253669576'
--- /tmp/testfile.conf  2009-09-22 21:32:02.000000000 -0400
+++ /tmp/puppet-diffing.19136.0 2009-09-22 21:32:56.000000000 -0400
@@ -1,2 +1 @@
-sep 22, 2009
-Server: 0.25.0, client 0.25.0
+sep 18, 2009
notice: //b_class/File[/tmp/testfile.conf]/checksum: checksum changed '{md5}acb9da296ee9ac12b2f3252792a8fb30' to '{md5}7b336f08d37b4bdc8b55a2e6590e5873'
info: Filebucket[/var/puppet/clientbucket]: Adding /tmp/testfile.conf(7b336f08d37b4bdc8b55a2e6590e5873)
info: //b_class/File[/tmp/testfile.conf]: Filebucketed /tmp/testfile.conf to main with sum 7b336f08d37b4bdc8b55a2e6590e5873
notice: //b_class/File[/tmp/testfile.conf]/content: content changed '{md5}7b336f08d37b4bdc8b55a2e6590e5873' to '{md5}acb9da296ee9ac12b2f3252792a8fb30'
notice: Finished catalog run in 0.58 seconds

Updated by Steven Jenkins 10 months ago

Malcom or Volcane – could either of you please provide your full configurations so that we can check? As you can see from my tests, I’ve not been able to reproduce this problem.

Also, so that everyone knows: I’m actually on vacation until Oct 5 (yes, I’m checking email some, but corresponding here rather than to me directly is best, that way someone else could step in and pick up the ticket if needed).

Thanks, Steven

Updated by R.I. Pienaar aka Volcane 10 months ago

Steven Jenkins wrote:

Malcom or Volcane – could either of you please provide your full configurations so that we can check? As you can see from my tests, I’ve not been able to reproduce this problem.

Have you tried it with a template? That’s what I did, reproduces it.

Updated by Malcolm Howe 10 months ago

Here are my configuration details and test output:

Puppet.conf:


[main]

    # What syslog facility to use when logging to syslog.

    syslogfacility = local5

    certname = dsmt.int

#
# [puppetd] section applies to puppetd, i.e. client configuration
#

[puppetd]

    # The server to which server puppetd should connect

    server = dsmt.int

    # How often puppetd applies the client configuration; in seconds.
    # This is ignored when we run puppetd with the --no-client option

    runinterval = 86400

    # print a transaction summary

    summarize = true

    # Show diffs of changed files

    show_diff = true

    # Fetch plugins from the server
    pluginsync = true

    # Ignore subversion directories

    pluginsignore = .svn


#
# [puppetmasterd] section applies to puppetmasterd, i.e. server configuration
#

[puppetmasterd]

    # The DNS names on the Server certificate as a colon-separated list.
    # If it's anything other than an empty string, it will be used as an
    # alias in the created certificate.  By default, only the server
    # gets an alias set up, and only for 'puppet'.

    certdnsnames = dsmt.int

    # The default TTL for new certificates
    # ca_ttl = 5y

    # Whether to enable autosign.
    autosign = false

Manifest file used for this test:

node default {
    file {"/tmp/test1":
          ensure => present,
          owner => root, group => system, mode => "0644",
          source => "puppet:///test/test1"
    }
    file {"/tmp/test2":
          ensure => present,
          owner => root, group => system,
          content => template("/etc/puppet/test/test2")
    }
}

File {
    backup => false
}

Output with Puppet 0.24.8 server and client (some facter lines removed) Added lines “11111” and “22222” to source files.

sh-3.2# facter -p
aixversion => 5.3
facterversion => 1.5.5
hardwaremodel => IBM,9131-52A
id => root
kernel => AIX
kernelmajversion => 5300
kernelrelease => 5300-08-05-0846
kernelversion => 5300
operatingsystem => AIX
operatingsystemrelease => 5300-08-05-0846
processor0 => PowerPC_POWER5
processor2 => PowerPC_POWER5
processorcount => 2
ps => ps -ef
puppetversion => 0.24.8
rubysitedir => /usr/local/PACK/puppet-0.24.8/lib/ruby/site_ruby/1.8
rubyversion => 1.8.7
swapfree => 1.78 GB
swapsize => 2.00 GB
timezone => BST
uniqueid => 0x7f000001
uptime => 54 days

sh-3.2# puppetd --test
info: Retrieving plugins
info: Caching catalog at /var/puppet/state/localconfig.yaml
notice: Starting catalog run
1a2
> 22222
notice: //Node[default]/File[/tmp/test2]/content: content changed '{md5}f399cca040803a41bd5786445961d179' to '{md5}204e3a3218d2df3313651d971631fd9c'
1a2
> 11111
notice: //Node[default]/File[/tmp/test1]/source: replacing from source puppet:///test/test1 with contents {md5}07b7242d492f40e25bf44f6a49c78063
Changes:
            Total: 2
Resources:
          Applied: 2
      Out of sync: 2
        Scheduled: 9
            Total: 11
Time:
   Config retrieval: 22.58
             File: 1.01
       Filebucket: 0.00
         Schedule: 0.00
            Total: 23.59
notice: Finished catalog run in 1.56 seconds
sh-3.2# exit


Output with Puppet 0.25.0 server and client (some facter lines removed). Again added additional lines “11111” and “22222” to source files.

sh-3.2# facter -p
aixversion => 5.3
facterversion => 1.5.6
hardwaremodel => IBM,9131-52A
hostname => dsmt
id => root
kernel => AIX
kernelmajversion => 5300
kernelrelease => 5300-08-05-0846
kernelversion => 5300
operatingsystem => AIX
operatingsystemrelease => 5300-08-05-0846
processor0 => PowerPC_POWER5
processor2 => PowerPC_POWER5
processorcount => 2
ps => ps -ef
puppetversion => 0.25.0
rubysitedir => /usr/local/PACK/puppet-0.25.0/lib/ruby/site_ruby/1.8
rubyversion => 1.8.7
swapfree => 1.78 GB
swapsize => 2.00 GB
timezone => BST
uniqueid => 0x7f000001
uptime => 54 days

sh-3.2# /usr/local/sbin/puppetd --test
info: Retrieving plugin
info: Loading facts in aixversion
info: Loading facts in privateip
info: Loading facts in publicaddresses
info: Loading facts in aixversion
info: Loading facts in privateip
info: Loading facts in publicaddresses
info: Caching catalog for dsmt.int
info: Applying configuration version '1253698041'
notice: //Node[default]/File[/tmp/test1]/content: content changed '{md5}07b7242d492f40e25bf44f6a49c78063' to '{md5}18022e96bab0a5367aad5bd116e74443'
notice: //Node[default]/File[/tmp/test2]/content: content changed '{md5}204e3a3218d2df3313651d971631fd9c' to 'unknown checksum'
Changes:
            Total: 2
Resources:
          Applied: 2
      Out of sync: 2
        Scheduled: 2
            Total: 4
Time:
   Config retrieval: 0.31
             File: 0.67
            Total: 0.97
notice: Finished catalog run in 1.01 seconds
sh-3.2# exit


Updated by Markus Roberts 9 months ago

  • Status changed from Accepted to Investigating
  • Assigned to changed from Steven Jenkins to Jesse Wolfe

Updated by Jesse Wolfe 9 months ago

Like Volcane, I was only able to reproduce the failure with a template (Malcolm’s “test2”). Despite that, I think it’s possible that this patch fixes both errors.

Updated by Malcolm Howe 9 months ago

Yes, that fixes the problem for me.

It turns out I had an additional problem. I had not defined diff_args in my configuration. In 0.24.8 diff_args was defaulting to “” but in 0.25.0 it is defaulting to “-u” which is not valid in AIX. Putting that right gives me diffs for files not templates, which is what others have been able to reproduce. So it seems the bug ony applies to templates and the patch fixes it.

Thanks

Updated by James Turnbull 9 months ago

  • Status changed from Ready for Testing to Ready for Checkin

Updated by James Turnbull 9 months ago

The -u was added to make output unified diff. I did not know that wasn’t supported on AIX.

Updated by James Turnbull 9 months ago

  • Status changed from Ready for Checkin to Closed

Pushed in commit:“136949da70f1a6715734faa6ac3c464f386fccfb” in branch 0.25.x

Also available in: Atom PDF