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

Bug #2631

show_diff no longer works

Added by Malcolm Howe about 5 years ago. Updated over 4 years ago.

Status:ClosedStart date:09/14/2009
Priority:NormalDue date:
Assignee:Jesse Wolfe% Done:

0%

Category:fileserving
Target version:0.25.2
Affected Puppet version:0.25.0 Branch:
Keywords:

We've Moved!

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

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


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 Magnifier (2.56 KB) Jesse Wolfe, 11/05/2009 02:31 am

History

#1 Updated by Markus Roberts about 5 years 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."

#2 Updated by James Turnbull about 5 years ago

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

commit:"ref"

Might help people.

#3 Updated by Markus Roberts about 5 years ago

  • Assignee set to Rein Henrichs

#4 Updated by Rein Henrichs about 5 years ago

  • Assignee deleted (Rein Henrichs)

#5 Updated by Steven Jenkins about 5 years 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.

#6 Updated by Steven Jenkins about 5 years 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

#7 Updated by Steven Jenkins about 5 years 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.

#8 Updated by Steven Jenkins about 5 years ago

  • Status changed from Accepted to Needs More Information

#9 Updated by R.I. Pienaar about 5 years 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

#10 Updated by Steven Jenkins about 5 years 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).

#11 Updated by James Turnbull about 5 years ago

  • Status changed from Needs More Information to Accepted

#12 Updated by James Turnbull about 5 years ago

  • Category set to fileserving
  • Assignee set to Steven Jenkins

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

#13 Updated by James Turnbull about 5 years ago

  • Target version changed from 0.25.1 to 0.25.2

#14 Updated by Steven Jenkins about 5 years 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

#15 Updated by Steven Jenkins about 5 years 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

#16 Updated by R.I. Pienaar about 5 years 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.

#17 Updated by Malcolm Howe about 5 years 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


#18 Updated by Markus Roberts almost 5 years ago

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

#19 Updated by Jesse Wolfe almost 5 years 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.

#20 Updated by Malcolm Howe almost 5 years 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

#21 Updated by James Turnbull almost 5 years ago

  • Status changed from In Topic Branch Pending Review to Ready For Checkin

#22 Updated by James Turnbull almost 5 years ago

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

#23 Updated by James Turnbull almost 5 years ago

  • Status changed from Ready For Checkin to Closed

Pushed in commit:136949da70f1a6715734faa6ac3c464f386fccfb in branch 0.25.x

Also available in: Atom PDF