Closed rnelson0 closed 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,
}
}
looks like the rgen gem is missing
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.
@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.
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.
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.
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).
@rnelson0 do you by any chance have Rgen installed on this machine? If so, it may be older than the vendored version.
@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.
@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.
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 ....
I've run git clean on it, is there another cache to wipe out?
Rob Nelson rnelson0@gmail.com
Might need a git clean -f
to be sure.
Some other questions/ideas:
be rake spec
(I couldn't get an individual be rspec spec/classes/zabbix__agent_spec.rb
to behave, probably due to some missing setup on my part, so I took the easier path.) Are you seeing the failure with be rake spec
as well as with the individual spec file? Just trying to rule out diffs in our setups.be ruby -e "puts $:"
on the broken node?checker4_0.rb and edit line 530 to replace
eContentswith
eAllContents` and see if that changes anything? This is not a solution (and may break unrelated things), just an experiment.Thanks for poking around at this. It's making no sense to me ... at least not yet ;)
I was using git clean -ffdx
, just wanted to make sure there wasn't a higher level cache to worry about.
eContents
errors.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)
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.
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?
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.
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 withoutSTRICT_VARIABLES
being set as well so may not be related to #373 either.