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

"contain" cannot contain a fully qualified class

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 3.4.2
    • Fix Version/s: PUP 3.7.0
    • Component/s: Compiler
    • Labels:
      None
    • Template:
    • Story Points:
      1
    • Sprint:
      Week 2014-4-30 to 2014-5-7, Week 2014-5-7 to 2014-5-14, Week 2014-5-21 to 2014-5-28

      Description

      nested contains don't appeare to work. I'm hitting this issue when trying to contain puppetlabs/mysql::client, but the issue can be reproduced quite simply:

      #
      class mybug::client (
        $package_ensure  = 'present',
        $package_name    = 'mysql',
      ){
        package { 'mybug_client':
          ensure => $mybug::client::package_ensure,
          name   => $mybug::client::package_name,
        }
      }
      

      class profile::mybug {
        contain ::mybug::client
      }
      

      Now, if we call puppet apply --debug -e 'include ::profile::mybug', we get:

      WARNING: Nokogiri was built against LibXML version 2.9.0, but has dynamically loaded 2.9.1
      Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb
      Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb
      Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb
      Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/pe_version.rb
      Warning: Could not retrieve fact fqdn
      Debug: importing '/etc/puppet/modules/profile/manifests/mybug.pp' in environment production
      Debug: Automatically imported profile::mybug from profile/mybug into production
      Debug: importing '/etc/puppet/modules/mybug/manifests/init.pp' in environment production
      Debug: importing '/etc/puppet/modules/mybug/manifests/client.pp' in environment production
      Debug: Automatically imported mybug::client from mybug/client into production
      Debug: hiera(): Hiera YAML backend starting
      Debug: hiera(): Looking up mybug::client::package_ensure in YAML backend
      Debug: hiera(): Looking for data source production
      Debug: hiera(): Cannot find datafile /var/lib/hiera/production.yaml, skipping
      Debug: hiera(): Looking for data source global
      Debug: hiera(): Looking up mybug::client::package_name in YAML backend
      Debug: hiera(): Looking for data source production
      Debug: hiera(): Cannot find datafile /var/lib/hiera/production.yaml, skipping
      Debug: hiera(): Looking for data source global
      Error: undefined method `ref' for nil:NilClass on node levix
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/resource/catalog.rb:527:in `block in to_catalog'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/resource/catalog.rb:515:in `each'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/resource/catalog.rb:515:in `to_catalog'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/resource/catalog.rb:402:in `to_resource'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/parser/compiler.rb:24:in `compile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/indirector/catalog/compiler.rb:116:in `block (2 levels) in compile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util/profiler/none.rb:6:in `profile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util/profiler.rb:31:in `profile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/indirector/catalog/compiler.rb:114:in `block in compile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util.rb:161:in `block in benchmark'
      /usr/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util.rb:160:in `benchmark'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/indirector/catalog/compiler.rb:113:in `compile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/indirector/catalog/compiler.rb:46:in `find'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/indirector/indirection.rb:201:in `find'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/application/apply.rb:204:in `main'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/application/apply.rb:146:in `run_command'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/application.rb:364:in `block (2 levels) in run'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/application.rb:470:in `plugin_hook'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/application.rb:364:in `block in run'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util.rb:478:in `exit_on_fail'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/application.rb:364:in `run'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util/command_line.rb:137:in `run'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util/command_line.rb:91:in `execute'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/bin/puppet:4:in `<top (required)>'
      /usr/local/bin/puppet:23:in `load'
      /usr/local/bin/puppet:23:in `<main>'
      Error: undefined method `ref' for nil:NilClass on node levix
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/resource/catalog.rb:527:in `block in to_catalog'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/resource/catalog.rb:515:in `each'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/resource/catalog.rb:515:in `to_catalog'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/resource/catalog.rb:402:in `to_resource'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/parser/compiler.rb:24:in `compile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/indirector/catalog/compiler.rb:116:in `block (2 levels) in compile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util/profiler/none.rb:6:in `profile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util/profiler.rb:31:in `profile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/indirector/catalog/compiler.rb:114:in `block in compile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util.rb:161:in `block in benchmark'
      /usr/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util.rb:160:in `benchmark'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/indirector/catalog/compiler.rb:113:in `compile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/indirector/catalog/compiler.rb:46:in `find'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/indirector/indirection.rb:201:in `find'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/application/apply.rb:204:in `main'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/application/apply.rb:146:in `run_command'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/application.rb:364:in `block (2 levels) in run'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/application.rb:470:in `plugin_hook'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/application.rb:364:in `block in run'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util.rb:478:in `exit_on_fail'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/application.rb:364:in `run'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util/command_line.rb:137:in `run'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util/command_line.rb:91:in `execute'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/bin/puppet:4:in `<top (required)>'
      /usr/local/bin/puppet:23:in `load'
      /usr/local/bin/puppet:23:in `<main>'
      

      Alternatively, if we call sudo puppet apply --debug -e 'contain ::mybug::client', we get

      WARNING: Nokogiri was built against LibXML version 2.9.0, but has dynamically loaded 2.9.1
      Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb
      Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb
      Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb
      Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/pe_version.rb
      Warning: Could not retrieve fact fqdn
      Debug: importing '/etc/puppet/modules/mybug/manifests/init.pp' in environment production
      Debug: importing '/etc/puppet/modules/mybug/manifests/client.pp' in environment production
      Debug: Automatically imported mybug::client from mybug/client into production
      Debug: hiera(): Hiera YAML backend starting
      Debug: hiera(): Looking up mybug::client::package_ensure in YAML backend
      Debug: hiera(): Looking for data source production
      Debug: hiera(): Cannot find datafile /var/lib/hiera/production.yaml, skipping
      Debug: hiera(): Looking for data source global
      Debug: hiera(): Looking up mybug::client::package_name in YAML backend
      Debug: hiera(): Looking for data source production
      Debug: hiera(): Cannot find datafile /var/lib/hiera/production.yaml, skipping
      Debug: hiera(): Looking for data source globalError: undefined method `tag' for nil:NilClass on node levix
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/parser/compiler.rb:443:in `block in add_resource_metaparams'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/graph/simple_graph.rb:355:in `block in walk'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/graph/simple_graph.rb:354:in `each'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/graph/simple_graph.rb:354:in `walk'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/parser/compiler.rb:432:in `add_resource_metaparams'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/parser/compiler.rb:419:in `finish'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/parser/compiler.rb:119:in `block in compile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util/profiler/none.rb:6:in `profile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util/profiler.rb:31:in `profile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/parser/compiler.rb:119:in `compile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/parser/compiler.rb:24:in `compile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/indirector/catalog/compiler.rb:116:in `block (2 levels) in compile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util/profiler/none.rb:6:in `profile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util/profiler.rb:31:in `profile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/indirector/catalog/compiler.rb:114:in `block in compile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util.rb:161:in `block in benchmark'
      /usr/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util.rb:160:in `benchmark'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/indirector/catalog/compiler.rb:113:in `compile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/indirector/catalog/compiler.rb:46:in `find'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/indirector/indirection.rb:201:in `find'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/application/apply.rb:204:in `main'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/application/apply.rb:146:in `run_command'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/application.rb:364:in `block (2 levels) in run'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/application.rb:470:in `plugin_hook'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/application.rb:364:in `block in run'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util.rb:478:in `exit_on_fail'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/application.rb:364:in `run'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util/command_line.rb:137:in `run'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util/command_line.rb:91:in `execute'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/bin/puppet:4:in `<top (required)>'
      /usr/local/bin/puppet:23:in `load'
      /usr/local/bin/puppet:23:in `<main>'
      Error: undefined method `tag' for nil:NilClass on node levix
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/parser/compiler.rb:443:in `block in add_resource_metaparams'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/graph/simple_graph.rb:355:in `block in walk'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/graph/simple_graph.rb:354:in `each'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/graph/simple_graph.rb:354:in `walk'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/parser/compiler.rb:432:in `add_resource_metaparams'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/parser/compiler.rb:419:in `finish'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/parser/compiler.rb:119:in `block in compile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util/profiler/none.rb:6:in `profile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util/profiler.rb:31:in `profile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/parser/compiler.rb:119:in `compile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/parser/compiler.rb:24:in `compile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/indirector/catalog/compiler.rb:116:in `block (2 levels) in compile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util/profiler/none.rb:6:in `profile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util/profiler.rb:31:in `profile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/indirector/catalog/compiler.rb:114:in `block in compile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util.rb:161:in `block in benchmark'
      /usr/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util.rb:160:in `benchmark'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/indirector/catalog/compiler.rb:113:in `compile'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/indirector/catalog/compiler.rb:46:in `find'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/indirector/indirection.rb:201:in `find'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/application/apply.rb:204:in `main'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/application/apply.rb:146:in `run_command'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/application.rb:364:in `block (2 levels) in run'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/application.rb:470:in `plugin_hook'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/application.rb:364:in `block in run'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util.rb:478:in `exit_on_fail'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/application.rb:364:in `run'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util/command_line.rb:137:in `run'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/lib/puppet/util/command_line.rb:91:in `execute'
      /var/lib/gems/1.9.1/gems/puppet-3.4.2/bin/puppet:4:in `<top (required)>'
      /usr/local/bin/puppet:23:in `load'
      /usr/local/bin/puppet:23:in `<main>'
      

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  igalic Igor Galić
                  QA Contact:
                  Kurt Wall
                • Votes:
                  2 Vote for this issue
                  Watchers:
                  11 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: