rodjek / rspec-puppet

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

Puppet::Error: Unsupported data type: 'Symbol' on node xxxxxxx #361

Closed alex-harvey-z3q closed 8 years ago

alex-harvey-z3q commented 8 years ago

To reproduce:

$ git clone https://github.com/puppetlabs/puppetlabs-haproxy
$ bundle install
$ bundle exec rake spec
...
  1) haproxy on supported platforms for OS-agnostic configuration on Debian family operatingsystems should install the haproxy package
     Failure/Error: subject.should contain_package('haproxy').with(
     Puppet::Error:
       Unsupported data type: 'Symbol' on node 192-168-1-3.tpgi.com.au
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet/parser/scope.rb:677:in `deep_freeze'
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet/parser/scope.rb:670:in `block in deep_freeze'
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet/parser/scope.rb:670:in `each'
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet/parser/scope.rb:670:in `deep_freeze'
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet/parser/scope.rb:653:in `set_facts'
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet/parser/compiler.rb:850:in `set_node_parameters'
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet/parser/compiler.rb:172:in `block (2 levels) in compile'
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet/util/profiler/around_profiler.rb:58:in `profile'
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet/util/profiler.rb:51:in `profile'
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet/parser/compiler.rb:172:in `block in compile'
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet/context.rb:65:in `override'
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet.rb:240:in `override'
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet/parser/compiler.rb:168:in `compile'
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet/parser/compiler.rb:36:in `compile'
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet/indirector/catalog/compiler.rb:93:in `block (2 levels) in compile'
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet/util/profiler/around_profiler.rb:58:in `profile'
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet/util/profiler.rb:51:in `profile'
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet/indirector/catalog/compiler.rb:91:in `block in compile'
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet/util.rb:129:in `block in benchmark'
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet/util.rb:128:in `benchmark'
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet/indirector/catalog/compiler.rb:90:in `compile'
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet/indirector/catalog/compiler.rb:50:in `find'
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet/indirector/indirection.rb:194:in `find'
     # /Library/Ruby/Gems/2.0.0/gems/rspec-puppet-2.3.1/lib/rspec-puppet/support.rb:229:in `block in build_catalog_without_cache'
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet/context.rb:65:in `override'
     # /Library/Ruby/Gems/2.0.0/gems/puppet-4.3.2/lib/puppet.rb:240:in `override'
     # /Library/Ruby/Gems/2.0.0/gems/rspec-puppet-2.3.1/lib/rspec-puppet/support.rb:227:in `build_catalog_without_cache'
     # /Library/Ruby/Gems/2.0.0/gems/rspec-puppet-2.3.1/lib/rspec-puppet/support.rb:242:in `block in build_catalog'
     # /Library/Ruby/Gems/2.0.0/gems/rspec-puppet-2.3.1/lib/rspec-puppet/cache.rb:15:in `call'
     # /Library/Ruby/Gems/2.0.0/gems/rspec-puppet-2.3.1/lib/rspec-puppet/cache.rb:15:in `get'
     # /Library/Ruby/Gems/2.0.0/gems/rspec-puppet-2.3.1/lib/rspec-puppet/support.rb:241:in `build_catalog'
     # /Library/Ruby/Gems/2.0.0/gems/rspec-puppet-2.3.1/lib/rspec-puppet/support.rb:39:in `load_catalogue'
     # /Library/Ruby/Gems/2.0.0/gems/rspec-puppet-2.3.1/lib/rspec-puppet/example/class_example_group.rb:7:in `catalogue'
     # /Library/Ruby/Gems/2.0.0/gems/rspec-puppet-2.3.1/lib/rspec-puppet/support.rb:8:in `block in subject'
     # /Library/Ruby/Gems/2.0.0/gems/rspec-puppet-2.3.1/lib/rspec-puppet/matchers/create_generic.rb:82:in `call'
     # /Library/Ruby/Gems/2.0.0/gems/rspec-puppet-2.3.1/lib/rspec-puppet/matchers/create_generic.rb:82:in `matches?'
     # ./spec/classes/haproxy_spec.rb:25:in `block (6 levels) in <top (required)>'

Platform is Mac OS X Yosemite.

alex-harvey-z3q commented 8 years ago

See also http://ask.puppetlabs.com/question/23605/puppeterror-unsupported-data-type-symbol-on-node-xxxxxxx/?answer=23618#post-id-23618

DavidS commented 8 years ago

I just released 2.3.2 to address this issue

ferventcoder commented 8 years ago

@DavidS still seeing this one on rspec-puppet 2.3.2 / Puppet 4.3.2.

alex-harvey-z3q commented 8 years ago

For what it's worth I can't reproduce any more using the steps above on my platform using rspec-puppet 2.3.2 / Puppet 4.3.2.

mcanevet commented 8 years ago

@DavidS I can confirm that the problem persist with rspec-puppet 2.4.0 on https://github.com/camptocamp/puppet-augeas

alex-harvey-z3q commented 8 years ago

Fwiw I can't reproduce on that module on my platform:

$ bundle show
Gems included by the bundle:
  * CFPropertyList (2.2.8)
  * addressable (2.4.0)
  * aws-sdk (1.66.0)
  * aws-sdk-v1 (1.66.0)
  * beaker (2.42.0)
  * beaker-answers (0.5.0)
  * beaker-hiera (0.1.1)
  * beaker-pe (0.3.0)
  * beaker-rspec (5.3.0)
  * beaker_spec_helper (0.1.0)
  * builder (3.2.2)
  * bundler (1.10.5)
  * diff-lcs (1.2.5)
  * docker-api (1.28.0)
  * domain_name (0.5.20160310)
  * excon (0.49.0)
  * facter (2.4.6)
  * facterdb (0.3.5)
  * faraday (0.9.2)
  * fission (0.5.0)
  * fog (1.34.0)
  * fog-atmos (0.1.0)
  * fog-aws (0.9.2)
  * fog-brightbox (0.10.1)
  * fog-core (1.40.0)
  * fog-dynect (0.0.3)
  * fog-ecloud (0.3.0)
  * fog-google (0.0.9)
  * fog-json (1.0.2)
  * fog-local (0.3.0)
  * fog-powerdns (0.1.1)
  * fog-profitbricks (0.0.5)
  * fog-radosgw (0.0.5)
  * fog-riakcs (0.1.0)
  * fog-sakuracloud (1.7.5)
  * fog-serverlove (0.1.2)
  * fog-softlayer (1.1.1)
  * fog-storm_on_demand (0.1.1)
  * fog-terremark (0.1.0)
  * fog-vmfusion (0.1.0)
  * fog-voxel (0.1.0)
  * fog-xml (0.1.2)
  * formatador (0.2.5)
  * google-api-client (0.9.4)
  * googleauth (0.5.1)
  * hiera (3.2.0)
  * hocon (0.9.5)
  * http-cookie (1.0.2)
  * httpclient (2.8.0)
  * hurley (0.2)
  * inflecto (0.0.2)
  * inifile (2.0.2)
  * ipaddress (0.8.3)
  * jgrep (1.4.1)
  * json (1.8.3)
  * json_pure (1.8.3)
  * jwt (1.5.4)
  * little-plugger (1.1.4)
  * logging (2.1.0)
  * mcollective-client (2.8.4)
  * memoist (0.14.0)
  * metaclass (0.0.4)
  * metadata-json-lint (0.0.11)
  * mime-types (2.99.2)
  * mini_portile2 (2.0.0)
  * minitest (5.9.0)
  * mocha (1.1.0)
  * multi_json (1.12.1)
  * multipart-post (2.0.0)
  * net-scp (1.2.1)
  * net-ssh (2.9.4)
  * net-telnet (0.1.1)
  * netrc (0.11.0)
  * nokogiri (1.6.7.2)
  * open_uri_redirections (0.2.1)
  * os (0.9.6)
  * puppet (4.5.0)
  * puppet-blacksmith (3.3.1)
  * puppet-lint (1.1.0)
  * puppet-lint-absolute_classname-check (0.1.3)
  * puppet-lint-alias-check (0.1.0)
  * puppet-lint-empty_string-check (0.2.1)
  * puppet-lint-file_ensure-check (0.2.1)
  * puppet-lint-file_source_rights-check (0.1.0)
  * puppet-lint-leading_zero-check (0.1.0)
  * puppet-lint-spaceship_operator_without_tag-check (0.1.0)
  * puppet-lint-trailing_comma-check (0.3.1)
  * puppet-lint-undef_in_function-check (0.1.0)
  * puppet-lint-unquoted_string-check (0.2.5)
  * puppet-lint-variable_contains_upcase (1.0.0)
  * puppet-lint-version_comparison-check (0.1.2)
  * puppet-syntax (2.1.0)
  * puppetlabs_spec_helper (1.1.1)
  * rake (11.1.2)
  * rbvmomi (1.8.2)
  * representable (2.3.0)
  * require_all (1.3.3)
  * rest-client (1.8.0)
  * retriable (2.1.0)
  * rspec (3.4.0)
  * rspec-core (3.4.4)
  * rspec-expectations (3.4.0)
  * rspec-its (1.2.0)
  * rspec-mocks (3.4.1)
  * rspec-puppet (2.4.0)
  * rspec-puppet-facts (1.6.1)
  * rspec-support (3.4.1)
  * rsync (1.0.9)
  * ruby-augeas (0.5.0)
  * serverspec (2.36.0)
  * sfl (2.2)
  * signet (0.7.2)
  * spdx-licenses (1.1.0)
  * specinfra (2.57.5)
  * stomp (1.3.5)
  * stringify-hash (0.0.2)
  * systemu (2.6.5)
  * thor (0.19.1)
  * trollop (2.1.2)
  * uber (0.0.15)
  * unf (0.1.4)
  * unf_ext (0.0.7.2)
$ ruby -v
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
sspreitzer commented 8 years ago

Can confirm with 2.4.0 on customer internal environment. Rspec goes fine with 2.4.0 on my laptop but fails in customer build tooling with Symbol error. Sry can not disclose details

Worked around by pinning rspec-puppet to 2.3.0

gem 'rspec-puppet', '<= 2.3.0'