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

spec files are named incorrectly causing gem dependency lookup failures

    XMLWordPrintable

Details

    • Release Engineering
    • Release Engineering Kanban
    • Needs Assessment
    • Bug Fix
    • Hide
      When trying to install tools that rely on gems like facter, puppet and hiera gem dependencies are not able to be referenced. This causes the gem command to then reach out to rubygems.org and grab the latest gem.

      For facterdb this means facter 2.5.1 would be installed which then tries to overwrite the bin/facter binary upon installation because facter is a dependency of facterdb (regardless of version).
      Show
      When trying to install tools that rely on gems like facter, puppet and hiera gem dependencies are not able to be referenced. This causes the gem command to then reach out to rubygems.org and grab the latest gem. For facterdb this means facter 2.5.1 would be installed which then tries to overwrite the bin/facter binary upon installation because facter is a dependency of facterdb (regardless of version).
    • Needs Assessment

    Description

      When trying to install tools that rely on gems like facter, puppet and hiera gem dependencies are not able to be referenced.  This causes the gem command to then reach out to rubygems.org and grab the latest gem. 

      For facterdb this means facter 2.5.1 would be installed which then tries to overwrite the bin/facter binary upon installation because facter is a dependency of facterdb (regardless of version).

      https://github.com/camptocamp/facterdb/blob/master/facterdb.gemspec#L25

      [root@8344aaab113c /]# /opt/puppetlabs/puppet/bin/gem install facterdb
      facter's executable "facter" conflicts with /opt/puppetlabs/puppet/bin/facter
      Overwrite the executable? [yN]
      

      This also occurs on anything that requires puppet or hiera as well.  The gem command is unable to determine which version of puppet, hiera and facter is installed so it gives up and downloads the latest version of that gem. 

       

      After some troubleshooting it was discovered that the gem specification files put there by puppet agent packaging names the specification files incorrectly.

      As you an see below all other gems are named with the version embedded in the name.  This files named with puppet, facter, and hiera are named incorrectly.

      [root@212b27e2869a specifications]# ls -l
      total 76
      -rw-r--r-- 1 root root 2909 Mar 28 19:39 bundler-2.0.1.gemspec
      drwxr-xr-x 2 root root 4096 Mar 28 19:23 default
      -rw-r--r-- 1 root root 1524 Mar  8 19:26 did_you_mean-1.1.0.gemspec
      -rw-r--r-- 1 root root  604 Mar 25 09:38 facter.gemspec
      -rw-r--r-- 1 root root 2954 Mar  8 19:28 gettext-3.2.2.gemspec
      -rw-r--r-- 1 root root 2955 Mar  8 19:28 gettext-setup-0.30.gemspec
      -rw-r--r-- 1 root root  911 Mar 25 09:34 hiera.gemspec
      -rw-r--r-- 1 root root 4916 Mar  8 19:26 minitest-5.10.1.gemspec
      -rw-r--r-- 1 root root 4153 Mar  8 19:28 net-ssh-4.2.0.gemspec
      -rw-r--r-- 1 root root 1261 Mar  8 19:26 net-telnet-0.1.1.gemspec
      -rw-r--r-- 1 root root 1753 Mar  8 19:26 power_assert-0.4.1.gemspec
      -rw-r--r-- 1 root root 3659 Mar 25 09:34 puppet.gemspec
      -rw-r--r-- 1 root root 2273 Mar  8 19:26 rake-12.0.0.gemspec
      -rw-r--r-- 1 root root 1583 Mar  8 19:28 stomp-1.4.4.gemspec
      -rw-r--r-- 1 root root 2265 Mar  8 19:26 test-unit-3.2.3.gemspec
      -rw-r--r-- 1 root root 1342 Mar  8 19:28 text-1.3.1.gemspec
      -rw-r--r-- 1 root root 1595 Mar  8 19:26 xmlrpc-0.2.1.gemspec
      [root@212b27e2869a specifications]# pwd
      /opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/specifications
      

      In order to fix this the specification files need to be named according to the version of the gem installed.

      So a simple solution applied post install:

      cd /opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/specifications 
      mv puppet.gemspec puppet-5.5.12.gemspec
      mv facter.gemspec facter-3.11.8.gemspec
      mv hiera.gemspec hiera-3.4.6.gemspec
      

      This then solves the dependency issue and facter 2.5.1 is never downloaded.  Thus it does not try and overwrite the facter binary.

      [root@212b27e2869a specifications]# /opt/puppetlabs/puppet/bin/gem install facterdb
      Fetching: jgrep-1.5.0.gem (100%)
      Successfully installed jgrep-1.5.0
      Fetching: facterdb-0.6.0.gem (100%)
      Successfully installed facterdb-0.6.0
      Parsing documentation for jgrep-1.5.0
      Installing ri documentation for jgrep-1.5.0
      Parsing documentation for facterdb-0.6.0
      Installing ri documentation for facterdb-0.6.0
      Done installing documentation for jgrep, facterdb after 0 seconds
      2 gems installed
      

      Attachments

        Issue Links

          Activity

            People

              morgan Morgan Rhodes
              corey.osman Corey Osman
              Votes:
              4 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support