rodjek / rspec-puppet

RSpec tests for your Puppet manifests
http://rspec-puppet.com
MIT License
364 stars 203 forks source link

Puppet 4.4.x generates `eContents` errors #377

Closed rnelson0 closed 8 years ago

rnelson0 commented 8 years ago

When using Puppet 4.4.x gems (not 4.3.x or below), a new error shows up related to an undefined method eContents. This happens with rspec-puppet 2.3.2 and 2.4.0, so I believe this has something to do with Puppet 4.4.x changes and how rspec-puppet interprets the catalog, rather than with rspec-puppet's latest version. This occurs without STRICT_VARIABLES being set as well so may not be related to #373 either.

$ cat ./spec/classes/zabbix__agent_spec.rb
require 'spec_helper'
describe 'profile::zabbix::agent', :type => :class do
  let :facts do
    {
      :id => 'root',
      :kernel => 'Linux',
      :osfamily => 'RedHat',
      :operatingsystem => 'RedHat',
      :operatingsystemrelease => '7.2',
      :operatingsystemmajrelease => '7',
      :concat_basedir => '/dne',
      :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
      :puppetversion => '4.3.1',
    }
  end

  context 'with defaults for all parameters' do
    it { is_expected.to create_class('profile::zabbix::agent') }
    it { is_expected.to contain_class('zabbix::agent') }
    it { is_expected.to contain_selboolean('zabbix_can_network').with_value('on') }
    it { is_expected.to contain_firewall('100 zabbix-client') }
  end
end
$ export PUPPET_GEM_VERSION="~> 4.4.0" STRICT_VARIABLES=yes
$ bundle update
$ be rspec spec/classes/zabbix__agent_spec.rb

  ...

  4) profile::zabbix::agent with defaults for all parameters should contain Firewall[100 zabbix-client]
     Failure/Error: it { is_expected.to contain_firewall('100 zabbix-client') }
     Puppet::PreformattedError:
       Evaluation Error: Error while evaluating a Function Call, undefined method `eContents' for Puppet::Pops::Model::LiteralString:Puppet::Pops::Model::LiteralString at <PATH>/puppet/controlrepo/dist/profile/spec/fixtures/modules/profile/manifests/zabbix/agent.pp:15:3 on node <NODE>
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/validation/checker4_0.rb:530:in `internal_check_illegal_assignment'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/validation/checker4_0.rb:521:in `check_Parameter'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/visitor.rb:57:in `visit_this_0'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/validation/checker4_0.rb:49:in `check'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/validation/checker4_0.rb:44:in `block in validate'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/containment.rb:67:in `block (2 levels) in eAllContents'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/containment.rb:66:in `each'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/containment.rb:66:in `block in eAllContents'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/containment.rb:63:in `each'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/containment.rb:63:in `eAllContents'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/containment.rb:72:in `block in eAllContents'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/containment.rb:63:in `each'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/containment.rb:63:in `eAllContents'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/containment.rb:51:in `each'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/validation/checker4_0.rb:44:in `validate'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/parser/evaluating_parser.rb:84:in `validate'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/parser/evaluating_parser.rb:101:in `assert_and_report'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/parser/evaluating_parser.rb:37:in `parse_file'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/e4_parser_adapter.rb:31:in `parse'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/type_loader.rb:86:in `parse_file'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/type_loader.rb:123:in `block in load_files'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/type_loader.rb:107:in `each'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/type_loader.rb:107:in `load_files'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/type_loader.rb:97:in `import_from_modules'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/type_loader.rb:68:in `block in try_load_fqname'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/type_loader.rb:66:in `each'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/type_loader.rb:66:in `try_load_fqname'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/resource/type_collection.rb:219:in `find_or_load'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/resource/type_collection.rb:161:in `find_hostclass'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/scope.rb:343:in `find_hostclass'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/compiler.rb:387:in `block in evaluate_classes'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/compiler.rb:386:in `collect'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/compiler.rb:386:in `evaluate_classes'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/functions/include.rb:33:in `block in <top (required)>'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/functions.rb:174:in `block (2 levels) in newfunction'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/util/profiler/around_profiler.rb:58:in `profile'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/util/profiler.rb:51:in `profile'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/functions.rb:167:in `block in newfunction'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/evaluator/runtime3_support.rb:281:in `call_function'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/evaluator/evaluator_impl.rb:849:in `call_function_with_block'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/evaluator/evaluator_impl.rb:829:in `eval_CallNamedFunctionExpression'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/visitor.rb:67:in `visit_this_1'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/evaluator/evaluator_impl.rb:77:in `evaluate'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/evaluator/evaluator_impl.rb:579:in `block in eval_BlockExpression'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/evaluator/evaluator_impl.rb:579:in `each'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/evaluator/evaluator_impl.rb:579:in `eval_BlockExpression'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/visitor.rb:67:in `visit_this_1'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/evaluator/evaluator_impl.rb:77:in `evaluate'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/parser/evaluating_parser.rb:59:in `evaluate'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/ast/pops_bridge.rb:32:in `evaluate'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/ast.rb:31:in `safeevaluate'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/resource/type.rb:182:in `evaluate_code'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/resource.rb:84:in `block in evaluate'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/util/profiler/around_profiler.rb:58:in `profile'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/util/profiler.rb:51:in `profile'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/resource.rb:76:in `evaluate'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/compiler.rb:400:in `each'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/compiler.rb:400:in `evaluate_classes'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/functions/include.rb:33:in `block in <top (required)>'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/functions.rb:174:in `block (2 levels) in newfunction'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/util/profiler/around_profiler.rb:58:in `profile'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/util/profiler.rb:51:in `profile'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/functions.rb:167:in `block in newfunction'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/evaluator/runtime3_support.rb:281:in `call_function'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/evaluator/evaluator_impl.rb:849:in `call_function_with_block'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/evaluator/evaluator_impl.rb:829:in `eval_CallNamedFunctionExpression'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/visitor.rb:67:in `visit_this_1'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/evaluator/evaluator_impl.rb:77:in `evaluate'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/evaluator/evaluator_impl.rb:653:in `eval_Program'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/visitor.rb:67:in `visit_this_1'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/evaluator/evaluator_impl.rb:77:in `evaluate'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/pops/parser/evaluating_parser.rb:59:in `evaluate'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/ast/pops_bridge.rb:115:in `evaluate'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/ast.rb:31:in `safeevaluate'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/resource/type.rb:182:in `evaluate_code'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/resource.rb:84:in `block in evaluate'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/util/profiler/around_profiler.rb:58:in `profile'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/util/profiler.rb:51:in `profile'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/resource.rb:76:in `evaluate'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/compiler.rb:637:in `evaluate_main'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/compiler.rb:179:in `block (2 levels) in compile'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/util/profiler/around_profiler.rb:58:in `profile'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/util/profiler.rb:51:in `profile'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/compiler.rb:179:in `block in compile'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/context.rb:65:in `override'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet.rb:240:in `override'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/compiler.rb:167:in `compile'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/parser/compiler.rb:35:in `compile'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/indirector/catalog/compiler.rb:265:in `block (2 levels) in compile'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/util/profiler/around_profiler.rb:58:in `profile'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/util/profiler.rb:51:in `profile'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/indirector/catalog/compiler.rb:263:in `block in compile'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/util.rb:223:in `block in benchmark'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/util.rb:222:in `benchmark'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/indirector/catalog/compiler.rb:261:in `compile'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/indirector/catalog/compiler.rb:53:in `find'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/indirector/indirection.rb:194:in `find'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/rspec-puppet-2.3.2/lib/rspec-puppet/support.rb:218:in `block in build_catalog_without_cache'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet/context.rb:65:in `override'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib/puppet.rb:240:in `override'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/rspec-puppet-2.3.2/lib/rspec-puppet/support.rb:216:in `build_catalog_without_cache'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/rspec-puppet-2.3.2/lib/rspec-puppet/support.rb:231:in `block in build_catalog'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/rspec-puppet-2.3.2/lib/rspec-puppet/cache.rb:17:in `call'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/rspec-puppet-2.3.2/lib/rspec-puppet/cache.rb:17:in `get'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/rspec-puppet-2.3.2/lib/rspec-puppet/support.rb:230:in `build_catalog'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/rspec-puppet-2.3.2/lib/rspec-puppet/support.rb:28:in `load_catalogue'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/rspec-puppet-2.3.2/lib/rspec-puppet/example/class_example_group.rb:7:in `catalogue'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/rspec-puppet-2.3.2/lib/rspec-puppet/support.rb:8:in `block in subject'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/rspec-puppet-2.3.2/lib/rspec-puppet/matchers/create_generic.rb:82:in `call'
     # <PATH>/puppet/controlrepo/vendor/ruby/1.9.1/gems/rspec-puppet-2.3.2/lib/rspec-puppet/matchers/create_generic.rb:82:in `matches?'
     # ./spec/classes/zabbix__agent_spec.rb:21:in `block (3 levels) in <top (required)>'
$ be gem list

*** LOCAL GEMS ***

addressable (2.4.0)
ansi (1.5.0)
ast (2.2.0)
astrolabe (1.3.1)
backports (3.6.8)
bundler (1.10.6)
coderay (1.1.1)
diff-lcs (1.2.5)
docile (1.1.5)
domain_name (0.5.20160310)
ethon (0.8.1)
facter (2.4.6)
facterdb (0.3.2)
faraday (0.9.2)
faraday_middleware (0.10.0)
ffi (1.9.10)
formatador (0.2.5)
generate-puppetfile (0.9.6)
gh (0.14.0)
guard (2.13.0)
guard-rake (1.0.0)
hiera (3.1.1)
highline (1.7.8)
hirb (0.7.3)
http-cookie (1.0.2)
jgrep (1.4.0)
json (1.8.3)
json_pure (1.8.3)
launchy (2.4.3)
listen (3.0.6)
lumberjack (1.0.10)
mcollective-client (2.8.4)
metaclass (0.0.4)
metadata-json-lint (0.0.11)
method_source (0.8.2)
mime-types (2.99.1)
mocha (1.1.0)
multi_json (1.11.2)
multipart-post (2.0.0)
nenv (0.3.0)
net-http-persistent (2.9.4)
net-http-pipeline (1.0.1)
netrc (0.11.0)
notiffany (0.0.8)
parser (2.3.0.7)
powerpack (0.1.1)
pry (0.10.3)
puppet (4.4.1)
puppet-blacksmith (3.3.1)
puppet-lint (1.1.0)
puppet-lint-absolute_classname-check (0.1.3)
puppet-lint-classes_and_types_beginning_with_digits-check (0.1.0)
puppet-lint-leading_zero-check (0.1.0)
puppet-lint-trailing_comma-check (0.3.1)
puppet-lint-unquoted_string-check (0.2.5)
puppet-lint-version_comparison-check (0.1.2)
puppet-syntax (2.1.0)
puppetlabs_spec_helper (1.1.1)
pusher-client (0.6.2)
rainbow (2.1.0)
rake (11.1.2)
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
rest-client (1.8.0)
rspec (3.1.0)
rspec-core (3.1.7)
rspec-expectations (3.1.2)
rspec-mocks (3.1.3)
rspec-puppet (2.3.2)
rspec-puppet-facts (1.5.0)
rspec-support (3.1.2)
rubocop (0.33.0)
ruby-progressbar (1.7.5)
shellany (0.0.1)
simplecov (0.11.2)
simplecov-console (0.3.0)
simplecov-html (0.10.0)
slop (3.6.0)
spdx-licenses (1.0.0)
stomp (1.3.5)
systemu (2.6.5)
thor (0.19.1)
travis (1.8.2)
travis-lint (2.0.0)
typhoeus (0.8.0)
unf (0.1.4)
unf_ext (0.0.7.2)
websocket (1.2.2)
rnelson0 commented 8 years ago

The file in question (the include line corresponds with L15 above), looks to be lookup() related:

class profile::zabbix::agent{
  include ::zabbix::agent

  selboolean{['zabbix_can_network',]:
    value => on,
    persistent => true,
  }

  firewall {'100 zabbix-client':
    dport => 10050,
    proto => tcp,
    action => accept,
  }
}
hlindberg commented 8 years ago

looks like the rgen gem is missing

rnelson0 commented 8 years ago

Is that a missing dependency in puppet 4.4.x or something I should be tracking separately in my Gemfile? I would think the former.

rnelson0 commented 8 years ago

@hlindberg adding gem "rgen" to my Gemfile and re-running bundle install lets the tests pass now. That would appear to be a missing dependency then.

hlindberg commented 8 years ago

Yes, please file a bug - In 3.x rgen was optional since it only applied if future parser was used. Must have been missed that it is always required.

rnelson0 commented 8 years ago

https://tickets.puppetlabs.com/browse/PUP-6106 opened. I think there may be benefit in leaving this ticket open for others to find, if they encounter similar issues, until 4.4.2 lands with the correct dependency.

hlindberg commented 8 years ago

We do not close tickets until the release goes out the door (they end up in Resolved state, but not closed once we have made the repair).

hlindberg commented 8 years ago

@rnelson0 do you by any chance have Rgen installed on this machine? If so, it may be older than the vendored version.

rnelson0 commented 8 years ago

@hlindberg It is not installed at the system level, but I've included a list of the system and bundle gems in case another one is causing a conflict:

problem$ gem list

*** LOCAL GEMS ***

arr-pm (0.0.10)
backports (3.6.4)
bigdecimal (1.1.0)
bundler (1.10.6)
cabin (0.7.1)
childprocess (0.5.6)
clamp (0.6.5)
deep_merge (1.0.0)
diff-lcs (1.2.5)
ffi (1.9.8)
fpm (1.3.3)
hiera-eyaml (2.0.8)
highline (1.6.21)
io-console (0.3)
json (1.8.3, 1.5.5)
metaclass (0.0.4)
minitest (2.5.1)
mocha (1.1.0)
net-ssh (2.1.4)
puppet-lint (1.1.0)
puppet-syntax (2.0.0)
puppetlabs_spec_helper (0.8.2)
rake (0.9.2.2)
rdoc (3.9.5)
rspec (3.2.0)
rspec-core (3.2.3)
rspec-expectations (3.2.1)
rspec-mocks (3.2.1)
rspec-puppet (2.1.0)
rspec-support (3.2.2)
trollop (2.1.2)

problem$ be gem list

*** LOCAL GEMS ***

addressable (2.4.0)
ansi (1.5.0)
ast (2.2.0)
astrolabe (1.3.1)
backports (3.6.8)
bundler (1.10.6)
coderay (1.1.1)
diff-lcs (1.2.5)
docile (1.1.5)
domain_name (0.5.20160310)
ethon (0.8.1)
facter (2.4.6)
facterdb (0.3.3)
faraday (0.9.2)
faraday_middleware (0.10.0)
ffi (1.9.10)
formatador (0.2.5)
generate-puppetfile (0.9.6)
gh (0.14.0)
guard (2.13.0)
guard-rake (1.0.0)
hiera (3.1.1)
highline (1.7.8)
hirb (0.7.3)
http-cookie (1.0.2)
jgrep (1.4.0)
json (1.8.3)
json_pure (1.8.3)
launchy (2.4.3)
listen (3.0.6)
lumberjack (1.0.10)
mcollective-client (2.8.4)
metaclass (0.0.4)
metadata-json-lint (0.0.11)
method_source (0.8.2)
mime-types (2.99.1)
mocha (1.1.0)
multi_json (1.11.2)
multipart-post (2.0.0)
nenv (0.3.0)
net-http-persistent (2.9.4)
net-http-pipeline (1.0.1)
netrc (0.11.0)
notiffany (0.0.8)
parser (2.3.0.7)
powerpack (0.1.1)
pry (0.10.3)
puppet (4.4.1)
puppet-blacksmith (3.3.1)
puppet-lint (1.1.0)
puppet-lint-absolute_classname-check (0.1.3)
puppet-lint-classes_and_types_beginning_with_digits-check (0.1.0)
puppet-lint-leading_zero-check (0.1.0)
puppet-lint-trailing_comma-check (0.3.1)
puppet-lint-unquoted_string-check (0.2.5)
puppet-lint-version_comparison-check (0.1.2)
puppet-syntax (2.1.0)
puppetlabs_spec_helper (1.1.1)
pusher-client (0.6.2)
rainbow (2.1.0)
rake (11.1.2)
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
rest-client (1.8.0)
rspec (3.1.0)
rspec-core (3.1.7)
rspec-expectations (3.1.2)
rspec-mocks (3.1.3)
rspec-puppet (2.4.0)
rspec-puppet-facts (1.5.0)
rspec-support (3.1.2)
rubocop (0.33.0)
ruby-progressbar (1.7.5)
shellany (0.0.1)
simplecov (0.11.2)
simplecov-console (0.3.0)
simplecov-html (0.10.0)
slop (3.6.0)
spdx-licenses (1.0.0)
stomp (1.3.5)
systemu (2.6.5)
thor (0.19.1)
travis (1.8.2)
travis-lint (2.0.0)
typhoeus (0.8.0)
unf (0.1.4)
unf_ext (0.0.7.2)
websocket (1.2.3)

When I add rgen to the Gemfile, there's only different gem:

problem$ diff without with
1d0
< Resolving dependencies....
80a80
> Using rgen 0.8.0
91c91
< Bundle complete! 24 Gemfile dependencies, 89 gems now installed.
---
> Bundle complete! 25 Gemfile dependencies, 90 gems now installed.
rnelson0 commented 8 years ago

@hlindberg @kylog Food for thought: the one repo I can replicate this on is at work, so Kylo and I started looking at the repo. But I just cloned it to a different system and I cannot repro.

broken$ ruby -v
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]

works$ ruby -v
ruby 2.0.0p598 (2014-11-13) [x86_64-linux]

I am guessing that maybe between ruby 1.9.3 and 2.0.0, some internal library changed, such that rgen is not a default until 2.0.0? Similar to the many Psych issues people run into with older ruby. Or maybe it's an interaction between 1.9.3 and how the vendored rgen is provided? Grasping at straws here, but it's the only significant difference I can discern between the broken and works nodes.

kylog commented 8 years ago

Yeah I looked at this for a while yesterday. I wasn't able to reproduce this with the control repo you shared. I thought about ruby diffs too, but with that control repo, I couldn't reproduce with either 1.9.3-p484 or several ruby 2.x versions.

We do have a couple partial ideas though: basically the offending line at https://github.com/puppetlabs/puppet/blob/4.4.1/lib/puppet/pops/validation/checker4_0.rb#L530 is the only direct use of eContents. Elsewhere we use eAllContents, which while it is an rgen method, we have re-implemented at https://github.com/puppetlabs/puppet/blob/4.4.1/lib/puppet/pops/containment.rb#L9-L11. So the theory would go that if you have an old rgen installed (before eContents was provided) in that control repo, that might be why it's failing.

The problem with that is I don't see rgen listed anywhere in the gem lists you provided.

One wild guess: on the broken node can you blow away the bundler cache? Maybe something is borked there. Yes, I'm grasping at straws too ....

rnelson0 commented 8 years ago

I've run git clean on it, is there another cache to wipe out?

Rob Nelson rnelson0@gmail.com

kylog commented 8 years ago

Might need a git clean -f to be sure.

Some other questions/ideas:

Thanks for poking around at this. It's making no sense to me ... at least not yet ;)

rnelson0 commented 8 years ago

I was using git clean -ffdx, just wanted to make sure there wasn't a higher level cache to worry about.

broken$ be ruby -e "puts $:"
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/travis-lint-2.0.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/travis-1.8.2/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/typhoeus-0.8.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/simplecov-console-0.3.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/simplecov-0.11.2/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/simplecov-html-0.10.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/rubocop-0.33.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/ruby-progressbar-1.7.5/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/rspec-puppet-facts-1.5.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/rainbow-2.1.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/pusher-client-0.6.2/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/websocket-1.2.3/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppetlabs_spec_helper-1.1.1/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/rspec-puppet-2.4.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/rspec-3.1.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/rspec-mocks-3.1.3/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/rspec-expectations-3.1.2/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/rspec-core-3.1.7/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/rspec-support-3.1.2/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-syntax-2.1.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-lint-version_comparison-check-0.1.2/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-lint-unquoted_string-check-0.2.5/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-lint-trailing_comma-check-0.3.1/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-lint-leading_zero-check-0.1.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-lint-classes_and_types_beginning_with_digits-check-0.1.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-lint-absolute_classname-check-0.1.3/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-lint-1.1.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-blacksmith-3.3.1/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/rest-client-1.8.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/puppet-4.4.1/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/powerpack-0.1.1/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/netrc-0.11.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/mocha-1.1.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/mime-types-2.99.1/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/metadata-json-lint-0.0.11/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/spdx-licenses-1.0.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/metaclass-0.0.4/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/mcollective-client-2.8.4/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/systemu-2.6.5/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/stomp-1.3.5/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/launchy-2.4.3/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/http-cookie-1.0.2/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/hirb-0.7.3/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/highline-1.7.8/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/hiera-3.1.1/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/json_pure-1.8.3/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/guard-rake-1.0.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/guard-2.13.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/thor-0.19.1/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/pry-0.10.3/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/slop-3.6.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/method_source-0.8.2/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/notiffany-0.0.8/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/shellany-0.0.1/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/nenv-0.3.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/lumberjack-1.0.10/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/listen-3.0.6/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/rb-inotify-0.9.7/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/rb-fsevent-0.9.7/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/gh-0.14.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/net-http-pipeline-1.0.1/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/net-http-persistent-2.9.4/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/multi_json-1.11.2/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/generate-puppetfile-0.9.6/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/formatador-0.2.5/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/faraday_middleware-0.10.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/faraday-0.9.2/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/multipart-post-2.0.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/facterdb-0.3.3/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/jgrep-1.4.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/json-1.8.3/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/facter-2.4.6/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/ethon-0.8.1/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/ffi-1.9.10/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/domain_name-0.5.20160310/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/unf-0.1.4/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/unf_ext-0.0.7.2/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/docile-1.1.5/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/diff-lcs-1.2.5/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/coderay-1.1.1/lib
/opt/puppet/lib/ruby/gems/1.9.1/gems/bundler-1.10.6/lib/gems/bundler-1.10.6/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/backports-3.6.8/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/astrolabe-1.3.1/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/parser-2.3.0.7/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/ast-2.2.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/ansi-1.5.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/addressable-2.4.0/lib
/home/username/puppet/controlrepo/vendor/ruby/1.9.1/gems/rake-11.1.2/lib
/opt/puppet/lib/ruby/gems/1.9.1/gems/bundler-1.10.6/lib
/opt/puppet/lib/ruby/site_ruby/1.9.1
/opt/puppet/lib/ruby/site_ruby/1.9.1/x86_64-linux
/opt/puppet/lib/ruby/site_ruby
/opt/puppet/lib/ruby/vendor_ruby/1.9.1
/opt/puppet/lib/ruby/vendor_ruby/1.9.1/x86_64-linux
/opt/puppet/lib/ruby/vendor_ruby
/opt/puppet/lib/ruby/1.9.1
/opt/puppet/lib/ruby/1.9.1/x86_64-linux
broken$ which ruby
/opt/puppet/bin/ruby
broken$ ruby --version
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]
broken$ puppet --version
3.8.5 (Puppet Enterprise 3.8.4)
kylog commented 8 years ago

We're using PE 3.8.4's ruby because EL6 has 1.8.7

Ah. My guess is that this is the problem. PE 3.8.x's ruby bundles rgen 0.6.5 which (I just checked) does not include the eContents method. I'd have to look at how the vendoring within puppet is setup to confirm, but my guess is that it's finding / using ruby's rgen in preference to puppet's own vendored rgen.

kylog commented 8 years ago

Ok, confirmed that the way puppet's vendoring logic works it will be last-one-in (it does a load after puppet itself is loaded so late in the game).

@rnelson0 as we we chatted about the other day in #voxpupuli I'm thinking we can close this (and https://tickets.puppetlabs.com/browse/PUP-6106, with background comments). I'm not sure if this is something we should document somewhere/somehow, or if it's too much of a corner case. Thoughts?

rnelson0 commented 8 years ago

I agree with closing it. Documentation I think would be best in PUP-6106. I'm happy to document it but suspect I may get some things wrong, so it may be better if you can document it there. I'll also drop a line on puppet-users to see if anyone has suggestions for where corner cases should be documented, given the recent thread where it was suggested that some of the usual channels may need augmented.