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

asked 2015-04-09 09:25:35 -0500

Arkandel gravatar image

Hello,

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 '{md5}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.

edit retag flag offensive close merge delete

Comments

Which versions of Puppet are you using? Is Puppet Server being used as the master that your agent is submitting backup data to?

csharpsteen gravatar imagecsharpsteen ( 2015-04-09 10:05:36 -0500 )edit

The puppet version is the same (3.6.2) for both the client and the master.

Arkandel gravatar imageArkandel ( 2015-04-09 10:26:13 -0500 )edit

Something possibly noteworthy is that when I made a test plain text file and used it instead of the real phpunit (which seems like it's a mixture of tar-binary and PHP code) it worked fine in replacing it with the desired version in puppet's file resource even when ran more than once in a row.

Arkandel gravatar imageArkandel ( 2015-04-09 10:29:32 -0500 )edit
1

Adding backup => false to the manifest works as a workaround in my case. It's not ideal though, and it still leaves the question open of why a plain text file works fine but a mixed text/binary one does not.

Arkandel gravatar imageArkandel ( 2015-04-09 10:44:51 -0500 )edit
1

There was a bug that caused this sort of issue in one of the Puppet Server releases. What are you using to run your puppet master?

csharpsteen gravatar imagecsharpsteen ( 2015-04-09 12:15:09 -0500 )edit