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

Corrupt Windows environment variables crash Puppet

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: PUP 4.10.5, PUP 5.0.1
    • Fix Version/s: PUP 4.10.7, PUP 5.2.0
    • Component/s: Windows
    • Labels:
      None
    • Template:
    • Acceptance Criteria:
      • New integration test demonstrating the environment variable conversion failure
      • New test showing debug output when converting bad strings
    • Team:
      Windows
    • Story Points:
      2
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      On Windows, a corrupt environment variable will crash Puppet. This issue has been resolved.
    • QA Risk Assessment:
      Needs Assessment

      Description

      On Windows, a corrupt environment variable will crash Puppet when initializing settings with a stack like the following when running any command (like puppet agent or puppet facts):

      C:\>puppet facts --debug --verbose
      C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/vendor_ruby/puppet/util/windows/api_types.rb:59:in `encode': "t\xDD" on UTF-16LE (Encoding::InvalidByteSequenceError)
              from C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/vendor_ruby/puppet/util/windows/api_types.rb:59:in `read_wide_string'
              from C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/vendor_ruby/puppet/util/windows/api_types.rb:76:in `block in read_arbitrary_wide_string_up_to'
              from C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/vendor_ruby/puppet/util/windows/api_types.rb:75:in `each'
              from C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/vendor_ruby/puppet/util/windows/api_types.rb:75:in `read_arbitrary_wide_string_up_to'
              from C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/vendor_ruby/puppet/util/windows/process.rb:239:in `get_environment_strings'
              from C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/vendor_ruby/puppet/util.rb:43:in `get_env'
              from C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/vendor_ruby/puppet/defaults.rb:273:in `block in <module:Puppet>'
              from C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/vendor_ruby/puppet/settings.rb:923:in `block in define_settings'
              from C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/vendor_ruby/puppet/settings.rb:922:in `each'
              from C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/vendor_ruby/puppet/settings.rb:922:in `define_settings'
              from C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/vendor_ruby/puppet.rb:140:in `define_settings'
              from C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/vendor_ruby/puppet/defaults.rb:152:in `<module:Puppet>'
              from C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/vendor_ruby/puppet/defaults.rb:1:in `<top (required)>'
              from C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
              from C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
              from C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/vendor_ruby/puppet.rb:175:in `<module:Puppet>'
              from C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/vendor_ruby/puppet.rb:81:in `<top (required)>'
              from C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
              from C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
              from C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/vendor_ruby/puppet/util/command_line.rb:12:in `<top (required)>'
              from C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
              from C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
              from C:/Program Files/Puppet Labs/Puppet/puppet/bin/puppet:3:in `<main>'
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ethan Ethan Brown
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support