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

Could not autoload puppet/provider/package/gem: superclass must be a Class (Module given)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 6.5.0
    • Component/s: None
    • Environment:
    • Template:
      PUP Bug Template
    • Agent OS:
      Ubuntu 16.04 (i386, amd64)
    • Master OS:
      Ubuntu 16.04 (amd64)
    • Team:
      Night's Watch
    • Method Found:
      Customer Feedback
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Fix provider autoloading issue introduced in 6.5.0.
    • QA Risk Assessment:
      Needs Assessment

      Description

      Puppet Version: 6.5.0
      Puppet Server Version: 6.4.0
      OS Name/Version: Linux ip-10-0-42-40 4.4.0-1047-aws #56-Ubuntu SMP Sat Jan 6 19:39:06 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

      Error: Could not autoload puppet/provider/package/gem: superclass must be a Class (Module given)
      Error: Facter: error while resolving custom facts in /opt/puppetlabs/puppet/cache/lib/facter/package_provider.rb: Could not autoload puppet/provider/package/gem: superclass must be a Class (Module given)
      

      Describe steps to reproduce…

      Limited to AWS Kernel ...

      uname -a
      Linux ip-10-0-42-40 4.4.0-1047-aws #56-Ubuntu SMP Sat Jan 6 19:39:06 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
      

      Install Puppet 6 and puppetlabs-stdlib ...

      sudo -i
      wget https://apt.puppetlabs.com/puppet6-release-xenial.deb
      dpkg -i puppet6-release-xenial.deb
      apt update
      apt install -y puppetserver
      source /etc/profile.d/puppet-agent.sh
      puppet config set server $(hostname -f)
      puppetserver ca setup
      systemctl start puppetserver
      puppet module install puppetlabs-stdlib
      

      Trigger ...

      puppet agent -t
      Info: Using configured environment 'production'
      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Notice: /File[/opt/puppetlabs/puppet/cache/lib/facter]/ensure: created
      ...
      Info: Retrieving locales
      Info: Loading facts
      Error: Could not autoload puppet/provider/package/gem: superclass must be a Class (Module given)
      Error: Facter: error while resolving custom facts in /opt/puppetlabs/puppet/cache/lib/facter/package_provider.rb: Could not autoload puppet/provider/package/gem: superclass must be a Class (Module given)
      Info: Caching catalog for ip-10-0-42-40.us-west-2.compute.internal
      Info: Applying configuration version '1561145391'
      Info: Creating state file /opt/puppetlabs/puppet/cache/state/state.yaml
      Notice: Applied catalog in 0.02 seconds
      

      Or ...

      facter -p os
      2019-06-21 19:36:32.606934 ERROR puppetlabs.facter - error while resolving custom facts in /opt/puppetlabs/puppet/cache/lib/facter/package_provider.rb: Could not autoload puppet/provider/package/gem: superclass must be a Class (Module given)
      {
        architecture => "amd64",
        distro => {
          codename => "xenial",
          description => "Ubuntu 16.04.3 LTS",
          id => "Ubuntu",
          release => {
            full => "16.04",
            major => "16.04"
          }
        },
        family => "Debian",
        hardware => "x86_64",
        name => "Ubuntu",
        release => {
          full => "16.04",
          major => "16.04"
        },
        selinux => {
          enabled => false
        }
      }
      

      Or ...

      /opt/puppetlabs/puppet/bin/ruby /opt/puppetlabs/puppet/cache/lib/facter/package_provider.rb
      Traceback (most recent call last):
      	15: from /opt/puppetlabs/puppet/cache/lib/facter/package_provider.rb:11:in `<main>'
      	14: from /opt/puppetlabs/puppet/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
      	13: from /opt/puppetlabs/puppet/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
      	12: from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/package.rb:9:in `<top (required)>'
      	11: from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/package.rb:10:in `<module:Puppet>'
      	10: from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/metatype/manager.rb:127:in `newtype'
      	 9: from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/autoload.rb:215:in `loadall'
      	 8: from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/autoload.rb:79:in `loadall'
      	 7: from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/autoload.rb:79:in `each'
      	 6: from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/autoload.rb:81:in `block in loadall'
      	 5: from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/autoload.rb:66:in `load_file'
      	 4: from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/autoload.rb:66:in `load'
      	 3: from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider/package/gem.rb:1:in `<top (required)>'
      	 2: from /opt/puppetlabs/puppet/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
      	 1: from /opt/puppetlabs/puppet/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider/package_targetable.rb:23:in `<top (required)>': Could not autoload puppet/provider/package/gem: superclass must be a Class (Module given) (Puppet::Error)
      

      Resolve ...

      puppet module uninstall puppetlabs-stdlib
      puppet agent -t
      Info: Using configured environment 'production'
      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Info: Retrieving locales
      Info: Caching catalog for ip-10-0-42-40.us-west-2.compute.internal
      Info: Applying configuration version '1561145919'
      Notice: Applied catalog in 0.05 seconds
      

      Unable to reproduce with Generic Kernel ...

      uname -a
      Linux fy4y57a54szfeln 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tom.kishel Thomas Kishel
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support