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

Bug #6541

File type truncates target when filebucket can not retrieve hash

Added by donavan m over 3 years ago. Updated over 2 years ago.

Status:ClosedStart date:03/01/2011
Priority:ImmediateDue date:
Assignee:-% Done:

0%

Category:-
Target version:2.6.14
Affected Puppet version:2.6.5 Branch:https://github.com/mmrobins/puppet/tree/ticket/2.6.next/6541-md5_in_content_truncates
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

This looks to be introduced in fd73874, fixing #6107, and is regression from 2.6.4.

If the File type has a content param with a checksum the filebucket should be used to retrieve the content (#3822). If the filebucket can’t retrieve the content the target file is truncated and reported as replaced with correct checksum. Using this sample manifest

file { "/tmp/bar": content => '{md5}invalidhash' }

Running a simple master with that manifest

puppet master --debug --no-daemonize --masterport 8100 --trace --manifest /tmp/test.pp

Expected behavior from 2.6.4 (commit f135a64 actually)

[localhost puppet]$ git checkout fd73874^
HEAD is now at f135a64... Merge branch 'bug/2.6.next/5755' into 2.6.next
[root@localhost puppet]# puppet agent -t --masterport 8100
info: Retrieving plugin
info: Caching catalog for localhost
info: Applying configuration version 'puppetmaster.domain;'
err: /Stage[main]//File[/tmp/bar]: Could not evaluate: Could not retrieve content for {md5}invalidhash from filebucket: Invalid checksum "invalidhash" at /tmp/test.pp:1
notice: Finished catalog run in 0.17 seconds

And the behavior introduced in 2.6.5rc1 (commit fd73874)

[localhost puppet]$ git checkout fd73874
Previous HEAD position was f135a64... Merge branch 'bug/2.6.next/5755' into 2.6.next
HEAD is now at fd73874... (#6107) Fix an error when auditing a file with empty content
[localhost puppet]# puppet agent -t --masterport 8100
info: Retrieving plugin
info: Caching catalog for localhost
info: Applying configuration version 'puppetmaster.domain;'
info: FileBucket got a duplicate file {md5}d41d8cd98f00b204e9800998ecf8427e
info: /Stage[main]//File[/tmp/bar]: Filebucketed /tmp/bar to puppet with sum d41d8cd98f00b204e9800998ecf8427e
notice: /Stage[main]//File[/tmp/bar]/content: content changed '{md5}d41d8cd98f00b204e9800998ecf8427e' to '{md5}invalidhash'
notice: Finished catalog run in 0.24 seconds
[root@localhost puppet]# wc /tmp/bar
0 0 0 /tmp/bar

Related issues

Related to Puppet - Bug #6107: Auditing an empty file the you're ensuring present produc... Closed 02/01/2011
Related to Puppet - Feature #3822: Files should be able to retrieve content by checksum from... Closed 05/20/2010
Related to Puppet - Bug #4781: Filebuckets intended to be remote are still local Accepted 09/15/2010
Related to Puppet - Bug #12115: 'Local' file bucket behavior doesn't match documentation Needs Decision 01/24/2012

History

#1 Updated by donavan m over 3 years ago

Linked to #4781 as any filebucket failure will manifest this, not just an invalid checksum:

filebucket { main: server => "invalid.server" }
File { backup => main }
file { "/tmp/bar": content => '{md5}e201e7cd19bab1b09c8587c30baa48aa' }
[root@localhost puppet]# puppet agent -t --masterport 8100
info: Retrieving plugin
info: Caching catalog for localhost
info: Applying configuration version 'puppetmaster.domain;'
info: FileBucket got a duplicate file {md5}d41d8cd98f00b204e9800998ecf8427e
info: /Stage[main]//File[/tmp/bar]: Filebucketed /tmp/bar to main with sum d41d8cd98f00b204e9800998ecf8427e
notice: /Stage[main]//File[/tmp/bar]/content: content changed '{md5}d41d8cd98f00b204e9800998ecf8427e' to '{md5}e201e7cd19bab1b09c8587c30baa48aa'
notice: Finished catalog run in 0.21 seconds

#2 Updated by Nigel Kersten over 3 years ago

  • Status changed from Unreviewed to Accepted
  • Priority changed from High to Immediate
  • Target version set to 2.6.6

#3 Updated by Matt Robinson over 3 years ago

  • Branch set to https://github.com/mmrobins/puppet/tree/ticket/2.6.next/6541-md5_in_content_truncates

#4 Updated by Matt Robinson over 3 years ago

  • Status changed from Accepted to Merged - Pending Release

This will somehow get into the 2.6.6rc ahead of the other stuff in the 2.6.next branch, we need to discuss how best to do this.

commit:9571c99b6c8a1244e0cdda416a2e9ca0c52b25cb

#5 Updated by Andrew Forgue over 3 years ago

Confirmed fixed in 2.6.6rc1

#6 Updated by James Turnbull over 3 years ago

  • Status changed from Merged - Pending Release to Closed

Pushed in commit:7c2a980212055dc41f0ab163857b8a91316d8185 in branch 2.6.x

#7 Updated by James Turnbull over 3 years ago

  • Target version changed from 2.6.6 to 2.6.7

#8 Updated by Anonymous almost 3 years ago

The failing acceptance test on 2.6.x has been fixed, and the change merged.

#10 Updated by Matthaus Owens over 2 years ago

  • Target version changed from 2.6.7 to 2.6.14

Released in 2.6.14

Also available in: Atom PDF