Ask Your Question
0

hiera-eyaml: undefined method `[]' for nil:NilClass (NoMethodError) error

asked 2014-10-17 07:50:29 -0500

robrwo gravatar image

While trying to diagnose some issues with hiera, on a brand new puppet enterprise installation, I installed a puppetmaster and hiera-eyaml.

When running hiera, I get the following error:

# hiera -h test::hash -c hiera.yaml 
/opt/puppet/lib/ruby/gems/1.9.1/gems/hiera-eyaml-2.0.3/lib/hiera/backend/eyaml_backend.rb:19:in `initialize': undefined method `[]' for nil:NilClass (NoMethodError)
    from /opt/puppet/lib/ruby/site_ruby/1.9.1/hiera/backend.rb:205:in `new'
    from /opt/puppet/lib/ruby/site_ruby/1.9.1/hiera/backend.rb:205:in `block in lookup'
    from /opt/puppet/lib/ruby/site_ruby/1.9.1/hiera/backend.rb:203:in `each'
    from /opt/puppet/lib/ruby/site_ruby/1.9.1/hiera/backend.rb:203:in `lookup'
    from /opt/puppet/lib/ruby/site_ruby/1.9.1/hiera.rb:60:in `lookup'
    from /usr/local/bin/hiera:221:in `<main>'

The hiera.yaml configuration seems fine. If I change it to yse the yaml backend, it does not give this error.

edit retag flag offensive close merge delete

Comments

What version of PE and what version of eyaml?

llowder gravatar imagellowder ( 2014-10-17 08:40:10 -0500 )edit

I've tried hiera-eyaml 2.0.3 with Puppet 3.6.2 (PE 3.3.2)

robrwo gravatar imagerobrwo ( 2014-10-17 08:47:23 -0500 )edit

Also tried hiera-eyaml 2.0.0

robrwo gravatar imagerobrwo ( 2014-10-17 08:48:16 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-10-17 10:52:52 -0500

robrwo gravatar image

It turns out that there was an error in the hiera.yaml after all. It defined a data dir for yaml but not eyaml.

edit flag offensive delete link more

Comments

Puppet doesn't do a great job of reporting errors in malformed YAML files, unfortunately. It's probably a good idea to setup a pre-commit YAML validation hook in your GIT repository.

cbarbour gravatar imagecbarbour ( 2014-10-17 14:51:10 -0500 )edit

I already have pre-commit hooks tgo check YAML syntax. This wasn't malformed YAML, just a missing key.

robrwo gravatar imagerobrwo ( 2014-10-20 11:36:04 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-10-17 07:50:29 -0500

Seen: 642 times

Last updated: Oct 17 '14