Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-1334

Empty clientbucket files produce errors

    XMLWordPrintable

    Details

    • Template:
    • Acceptance Criteria:
      • Puppet treats filebucket entries where content and paths are empty as if those files do not exist.
      • Stretch goal: Puppet no longer generates bad filebucket entries.
    • Team:
      Agent
    • Story Points:
      5
    • Sprint:
      Agent 2017-03-22, Agent 2017-04-05
    • CS Priority:
      Reviewed
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      Prior to Puppet 4.10.0, if Puppet failed to fully write a filebucket backup, resulting in a corrupt or empty backup file, subsequent attempts to back up the same file could result in a failure with the message "Got passed new contents for sum (a check sum value)". The only way to correct this issue was to search for and delete the offending partial backup inside the filebucket backup directory.

      This was due to a false positive detection of a hash collision in the Filebucket. Puppet would detect a duplicate backup file, and subsequently detect that its checksum value did not match the incoming backup, but would not verify that the existing backup matched the *expected* checksum value.

      As of 4.10.0, if puppet detects a possible hash collision between an existing and incoming filebucket backup, it will first check if the existing backup has been corrupted (ie, if it does not match its expected contents/checksum value). If so, puppet will issue a warning and overwrite the corrupted existing backup rather than failing with the previous error message.

      The previous error message: "Got passed new contents for sum (checksum value)" has also been revised to:
      (a locally logged error message on the filebucket server):
      "Unable to verify existing FileBucket backup at (path to file)"
      (the raised exception):
      "Existing backup and new file have different content but same checksum, (checksum value). Verify existing backup and remove if incorrect."
      Show
      Prior to Puppet 4.10.0, if Puppet failed to fully write a filebucket backup, resulting in a corrupt or empty backup file, subsequent attempts to back up the same file could result in a failure with the message "Got passed new contents for sum (a check sum value)". The only way to correct this issue was to search for and delete the offending partial backup inside the filebucket backup directory. This was due to a false positive detection of a hash collision in the Filebucket. Puppet would detect a duplicate backup file, and subsequently detect that its checksum value did not match the incoming backup, but would not verify that the existing backup matched the *expected* checksum value. As of 4.10.0, if puppet detects a possible hash collision between an existing and incoming filebucket backup, it will first check if the existing backup has been corrupted (ie, if it does not match its expected contents/checksum value). If so, puppet will issue a warning and overwrite the corrupted existing backup rather than failing with the previous error message. The previous error message: "Got passed new contents for sum (checksum value)" has also been revised to: (a locally logged error message on the filebucket server): "Unable to verify existing FileBucket backup at (path to file)" (the raised exception): "Existing backup and new file have different content but same checksum, (checksum value). Verify existing backup and remove if incorrect."
    • QA Risk Assessment:
      Automate

      Description

      I'm not sure how it happened, but I ended up with an empty clientbucket entry for one of my files. The 'contents' and 'paths' files were both present and empty. It caused this error:

      err: /Stage[main]/Os::Ubuntu/File[/etc/motd]/content: change from {md5}82cdaef7f3ba52467fb4e65491369889 to {md5}cd657ddfb4ff1e73910088a1d1c669ff failed: Could not back up /etc/motd: Got passed new contents for sum {md5}82cdaef7f3ba52467fb4e65491369889
      

      Funky. Investigating, I see this:

      root@solr00-2:/var/lib/puppet/clientbucket/8/2/c/d/a/e/f/7# ls -l 82cdaef7f3ba52467fb4e65491369889/
      total 0
      -r--r----- 1 root root 0 2010-10-20 03:20 contents
      -rw-r--r-- 1 root root 0 2010-10-20 03:20 paths
      

      This could have been caused (theoretically) by me killing puppet mid-run with a reboot or something similar, so I'm not convinced this the original problem is a bug in puppet.

      My request specifically is this: I think puppet should handle this case better. If the filebucket files are empty, it's might safe to discard them - especially if 'paths' is empty.

      Feel free to close this as "not a bug" if you feel such; it was a strange-enough behavior I felt it was worth sharing

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              moses Moses Mendoza
              Reporter:
              redmine.exporter redmine.exporter
              Votes:
              6 Vote for this issue
              Watchers:
              22 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support