Uploaded image for project: 'Puppet Server'
  1. Puppet Server
  2. SERVER-1954

Puppet Server incorrectly handling URI decoding

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • SERVER 5.1.5, SERVER 5.2.0
    • None
    • None
    • RHEL7

    • PUP Bug Template
    • Hide

      1. Agent should pluginsync directories and files with spaces, e.g. given a module with a "lib/foo bar" directory.
      2. Agent should apply file resources whose source parameter points to files with spaces. Test when the source parameter contains spaces, and when the target it points to contains spaces (both directories and files). To test directories use "recurse => true"
      3. When a file resource has "backup => true" it should be able to backup files to a local and remote filebucket.
      4. When a recurse => true directory resource has "purge => true", it should be able to delete files with spaces.
      5. Puppet filebucket command should get/restore/list files with spaces. The resulting "paths" file should contain an entry with spaces (not the URI encoded value).

      Show
      1. Agent should pluginsync directories and files with spaces, e.g. given a module with a "lib/foo bar" directory. 2. Agent should apply file resources whose source parameter points to files with spaces. Test when the source parameter contains spaces, and when the target it points to contains spaces (both directories and files). To test directories use "recurse => true" 3. When a file resource has "backup => true" it should be able to backup files to a local and remote filebucket. 4. When a recurse => true directory resource has "purge => true", it should be able to delete files with spaces. 5. Puppet filebucket command should get/restore/list files with spaces. The resulting "paths" file should contain an entry with spaces (not the URI encoded value).
    • Froyo
    • Platform Core KANBAN
    • Customer Feedback
    • Normal
    • 4 - 50-90% of Customers
    • 2 - Annoyance
    • 3 - $$$$
    • Users want to have files with spaces in the names, we should support that.
    • Bug Fix
    • Puppet Server will now correctly parse URIs with spaces in them, thanks to a bug fix in the bidi dependency.
    • Needs Assessment

    Description

      Update:

      It looks like in the last major version of our route handling library (bidi 2.x) they've changed where/when URI decoding takes place. (Note: a dependency upgraded this transitive dependency for us so moving major versions of a supporting library was not on our radar) Consequently, our URI escaping is incorrect for at least how we pass routes to Puppet's Ruby routes. See the examples below


      I created a vm to test my existing puppet configuration with puppet-5.1 and I've followed the guide about replacing hiera/hiera_hash calls with lookup in my custom modules to make them future proof.

      In my hierarchy, I have a hiera define for multiple os versions.
      osfamily/%{::osfamily}/%{::operatingsystemmajrelease}.yaml

      I have a custom file source location defined in auth.conf to serve an environment or what I refer to as product_area.

      I'm getting a server 500 error when it attempts to fetch the metadata for a couple files that have spaces in their names.
      Obscuring my exact hostnames due to policy.

      Error: /File[/etc/puppetlabs/code/hieradata/osfamily/windows/2008 R2.yaml]: Could not retrieve file metadata for puppet:///products/product_puppetserver/common/etc/puppetlabs/code/hieradata/osfamily/windows/2008 R2.yaml: Error 500 on SERVER: Server Error
      Error: /File[/etc/puppetlabs/code/hieradata/osfamily/windows/2012 R2.yaml]: Could not retrieve file metadata for puppet:///products/product_puppetserver/common/etc/puppetlabs/code/hieradata/osfamily/windows/2012 R2.yaml: Error 500 on SERVER: Server Error

      This configuration worked with puppetserver-2.2.1-1 and puppet-agent-1.3.2-1, the file path for puppet:///products points to /opt/puppetlabs/local_product_areas
      under which I have a directory structure product_puppetserver/common/etc
      and product_puppetserver/puppetserver.example.com/etc

      Attachments

        Issue Links

          Activity

            People

              maggie Maggie Dreyer
              bahmer Eric V. Bahmer
              Votes:
              8 Vote for this issue
              Watchers:
              18 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support