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

Leftover /opt/puppet contents cause upgrades to fail on locale/config.yaml

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 4.10.1
    • Fix Version/s: PUP 4.10.2
    • Component/s: None
    • Template:
    • Team:
      Agent
    • Story Points:
      1
    • Sprint:
      Agent 2017-06-14
    • Method Found:
      Customer Feedback
    • Release Notes:
      Not Needed
    • QA Risk Assessment:
      No Action

      Description

      If there happens to be any leftover files from older PE installations, it will cause the PE 2017.2.1 installation to fail because Puppet will end up pulling the wrong locale path:

      2017-05-29 14:42:51,320 Running command: /opt/puppetlabs/puppet/bin/puppet infrastructure configure  --detailed-exitcodes --modulepath /opt/puppetlabs/server/data/enterprise/modules 
      /opt/puppetlabs/puppet/lib/ruby/2.1.0/psych.rb:464:in `initialize': No such file or directory @ rb_sysopen - /opt/puppet/share/locale/config.yaml (Errno::ENOENT)
      	from /opt/puppetlabs/puppet/lib/ruby/2.1.0/psych.rb:464:in `open'
      	from /opt/puppetlabs/puppet/lib/ruby/2.1.0/psych.rb:464:in `load_file'
      	from /opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/gettext-setup-0.20/lib/gettext-setup/gettext_setup.rb:21:in `initialize'
      	from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:80:in `singleton class'
      	from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:55:in `<module:Puppet>'
      	from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:49:in `<top (required)>'
      	from /opt/puppetlabs/puppet/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
      	from /opt/puppetlabs/puppet/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
      	from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:12:in `<top (required)>'
      	from /opt/puppetlabs/puppet/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
      	from /opt/puppetlabs/puppet/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
      	from /opt/puppetlabs/puppet/bin/puppet:4:in `<main>'
      * /opt/puppetlabs/puppet/bin/puppet infrastructure configure  --detailed-exitcodes --modulepath /opt/puppetlabs/server/data/enterprise/modules 
      * returned: 1
      

      This appears to be due to how Puppet searches for the locale directory in https://github.com/puppetlabs/puppet/blob/4.10.1/lib/puppet.rb#L56-L73. https://github.com/puppetlabs/puppet/blob/4.10.1/lib/puppet.rb#L60 will set posix_system_locale_path to /opt/puppetlabs/puppet/share/locale, which is the correct path. The problem is that https://github.com/puppetlabs/puppet/blob/4.10.1/lib/puppet.rb#L62 runs regardless of the Puppet master not being a Windows machine and sets win32_system_locale_path to /opt/puppet/share/locale/config.yaml (because that would be /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/../../../../../puppet/share/locale).

      Since win32_system_locale_path is checked before posix_system_locale_path in the if/else block at https://github.com/puppetlabs/puppet/blob/4.10.1/lib/puppet.rb#L64-L73, the "windows" path will be used. If the old directory still exists, this path gets passed to GettextSetup, which leads to the failure.

      I'd think the fix would be to add logic to https://github.com/puppetlabs/puppet/blob/4.10.1/lib/puppet.rb#L68 to check if we are actually on a Windows system

      or

      Move the posix_system_locale_path check above the win32_system_locale_path one in the if/else block.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              adam.bottchen Adam Bottchen
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support