Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

puppet: Could not back up <file>: Got passed new contents for sum

Tags:

puppet

I had a question I was hoping someone might have an answer to. Essentially what I'm doing is try to ensure I'm always using a fixed, slightly older version of phpunit, which I've placed in my module's file resources.

The manifest:

    file
    {
            "/usr/bin/phpunit":
            ensure => file,
            owner => 'root',
            group => 'root',
            mode => 0755,
            source => "puppet:///modules/php/phpunit"
    }

Preparation: I download the current ('wrong') version of phpunit and place it in /usr/bin.

So the first run puppet succeeds:

Notice: Compiled catalog for <hostname> in environment production in 3.06 seconds
Notice: /Stage[main]/Php/File[/usr/bin/phpunit]/content: content changed '{md5}9f61f732829f4f9e3d31e56613f1a93a' to '{md}38789acbf53196e20e9b89e065cbed94'
Notice: /Stage[main]/Httpd/Service[httpd]: Triggered 'refresh' from 1 events 
Notice: Finished catalog run in 15.86 seconds

Then I download the current (still 'wrong') version of phpunit and place it in /usr/bin again.

This time the puppet run fails.

Notice: Compiled catalog for <hostname> in environment production in 2.96 seconds
Error: Could not back up /usr/bin/phpunit: Got passed new contents for sum {md5}9f61f732829f4f9e3d31e56613f1a93a
Error: Could not back up /usr/bin/phpunit: Got passed new contents for sum {md5}9f61f732829f4f9e3d31e56613f1a93a
Error: /Stage[main]/Php/File[/usr/bin/phpunit]/content: change from {md5}9f61f732829f4f9e3d31e56613f1a93a to {md5}38789acbf53196e20e9b89e065cbed94 failed: Could not back up /usr/bin/phpunit: Got passed new contents for sum {md5}9f61f732829f4f9e3d31e56613f1a93a

What gives? If I delete the file ( /var/lib/puppet/clientbucket/9/f/6/1/f/7/3/2/9f61f732829f4f9e3d31e56613f1a93a/ ) from my filebucket it will work again... for the next run, but not the one after that.

What am I doing wrong?

I'd appreciate any input and thanks in advance.

like image 486
Arkandel Avatar asked Apr 09 '15 14:04

Arkandel


2 Answers

Been having this error as well. I solved it with a combination of two previous answers.

Firstly I had to delete /var/lib/puppet/clientbucket on the client node by running:

sudo rm -r /var/lib/puppet/clientbucket

Just doing this will only let it run once more.

Then I had to mark the backup => false to stop it recreating the file, missing out either step failed to solve it for me. The accepted answer is incorrect by saying there is

"no solution other than upgrading".

like image 140
user3144201 Avatar answered Sep 30 '22 14:09

user3144201


I was able to fix the same problem by removing /var/lib/puppet/clientbucket on the client node.

This node has been running out of disk space, so puppet has probably incorrectly stored empty files there.

like image 45
Michaël Witrant Avatar answered Sep 30 '22 14:09

Michaël Witrant