Uploaded image for project: 'Puppet Agent'
  1. Puppet Agent
  2. PA-1782

Check for file existence fails on deduplicated windows volumes

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Duplicate
    • Affects Version/s: puppet-agent 1.10.0
    • Fix Version/s: None
    • Component/s: Windows
    • Labels:
      None
    • Environment:

      Windows
      Windows volume with deduplication

    • Template:
    • QA Risk Assessment:
      Needs Assessment

      Description

      When accessing files on a deduplicated windows volume, e.g. while installing packages with something like

      package { "Adobe Acrobat Reader":
          ensure => "someversion",
          source => "//server/com.adobe/Acrobat_Reader_DC/AcroreadDC_Customized/setup.exe",
        }
      

      the check for file existence fails in puppet/lib/ruby/vendor_ruby/puppet/util/windows/file.rb

      def exist?(path)
      [...]
      # return true if path exists and it's not a symlink
            # Other file attributes are ignored. https://msdn.microsoft.com/en-us/library/windows/desktop/gg258117(v=vs.85).aspx
            return true if (result & FILE_ATTRIBUTE_REPARSE_POINT) != FILE_ATTRIBUTE_REPARSE_POINT
       
            # walk the symlink and try again...
            seen_paths << path.downcase
      [...]
      

      Since Windows reports the deduplicated file as link (or reparse point whatever...), the loop is executed once again and then returns false:

          # return false if this path has been seen before.  This is protection against circular symlinks
            return false if seen_paths.include?(path.downcase)
      

      This results in puppet agent failing with something like "file not found", although the file is there.

      I know that this is not mainly puppets fault (in my opinion windows should hide deduplication from applications...), but maybe there is a more robust/flexible check to distinguish between links and reparse points.

      I thought I'd share this, because it took me hours to find the reason and the only workaround I found so far is switching off deduplication on the volume in question.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sean.mcdonald Sean McDonald
              Reporter:
              troloff Torsten Roloff
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support