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

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:

Bug #10367

Empty yaml file cause hiera to fail

Added by Ken Barber over 4 years ago. Updated almost 4 years ago.

Status:Merged - Pending ReleaseStart date:10/28/2011
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:hiera-puppet
Target version:-
Keywords: Affected Hiera Version:
Branch:https://github.com/puppetlabs/hiera-puppet/pull/31

We've Moved!

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


Description

(moved from github – originally raised by bleonsfl)

I had an issue where I kept getting the following error message when running puppet:

err: Could not retrieve catalog from remote server: Error 400 on SERVER: undefined method `empty?' for nil:NilClass at

Turned out that I had a yaml file which was empty, actually only the header “—–” was present. This seems to make hiera fail.

History

#1 Updated by Hunter Haugen over 4 years ago

  • Status changed from Accepted to Code Insufficient

This is basically fixed in https://github.com/puppetlabs/hiera/pull/21, but there is another aspect of this bug.

If {} or [] are passed as default values for hashes or arrays then the .empty? in hiera-puppet functions hiera_hash() hiera_array() or hiera_include() will be triggered. This should actually be checking for .nil? or something.

#2 Updated by Kelsey Hightower almost 4 years ago

  • Category set to hiera-puppet
  • Status changed from Code Insufficient to Merged - Pending Release
  • Branch set to https://github.com/puppetlabs/hiera-puppet/pull/31

Hunter,

The issue you’ve reported should also be fixed here: https://github.com/puppetlabs/hiera-puppet/pull/31

Also available in: Atom PDF