The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #14712

Hiera parsing fails when using ruby 1.9.x

Added by Sergio Galvan almost 2 years ago. Updated about 1 year ago.

Status:Merged - Pending ReleaseStart date:05/27/2012
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-
Keywords: Affected Hiera Version:0.3.0
Branch:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


Description

An example base on the work environment (production,stage) works fine when using ruby 1.8.7, on the other hand using 1.9.X reports some issues. I’m using rvm to manage ruby versions. When I used 1.9.2-p318, 1.9.3-p125, and 1.9.3-p194 the next error crops up:

$ hiera  -c hiera.yaml db env=stage
$ Failed to start Hiera: Psych::SyntaxError: (hiera.yaml): couldn't parse YAML at line 2 column 6

My hiera.yaml looks like:

:hierarchy:
- %{env}
- common
:backends:
- yaml
:yaml:
:datadir: '/etc/puppet/hieradata'

When removing %{env} (line 2) it always returns nil

$ hiera  -c hiera.yaml  db
WARN: 2012-05-27 21:05:01 +0000: Failed to load noop logger: LoadError: cannot load such file -- hiera/noop_logger
nil

It’s pretty strange that the same example works fine using ruby 1.8.7-head. My apologies if this is not a bug and is something regarding rvm.

/Sergio

History

#1 Updated by Kelsey Hightower almost 2 years ago

  • Status changed from Unreviewed to Merged - Pending Release

Ruby 1.9.x support was added in the upcoming Hiera 1.0.0 release, which is currently in RC. https://github.com/puppetlabs/hiera#installation

#2 Updated by Patrick Hemmer about 1 year ago

Ran across this issue myself after upgrading to ruby 1.9.3. The solution was to put quotes around the values. It’s apparently the percent sign which is causing the yaml parser in 1.9.3 to croak.

Also available in: Atom PDF