Issue with HIERA?

132 views
Skip to first unread message

Brian S

unread,
Nov 25, 2016, 10:20:32 AM11/25/16
to SIMP Q&A Forum
Hello-

I am getting the following error and I assume it is due to a hiera configuration?  I am just now learning hiera, so any help would be appreciated.

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, undefined method `empty?' for nil:NilClass at /etc/puppetlabs/code/environments/production/manifests/site.pp:28:1 on node

From some initial research it looks like it could be either with permissions or with the .yaml files having tabs instead of spaces. The code was working fine a few days ago but now it no longer is.  I reverted back to an earlier snapshot on the VM and it still has the error.  I know it was working at the time of the snapshot.  I have also removed the one custom file i added in the hieradata/hostgroups section and still receive the error.  Looking at the file site.pp, line 28 contains "hiera_include('classes')".  

Where should I be looking to help resolve this error?

Thanks-
Brian

Trevor Vaughan

unread,
Nov 25, 2016, 11:14:35 AM11/25/16
to Brian S, SIMP Q&A Forum
Hi Brian,

That is almost certainly malformed YAML somewhere in your hiera stack.

It may have been broken prior to your snapshot since the Puppet Server won't reload your *new* Hiera YAML files unless it is restarted.

Hop into your hieradata directory and try this:

for x in `find . -name "*.yaml"`; do echo $x; ruby -r yaml -e "begin; YAML.parse_file('$x'); rescue StandardError => e; puts e.to_s; end"; done

Thanks,

Trevor

--
You received this message because you are subscribed to the Google Groups "SIMP Q&A Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simp+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simp/79c90b05-ffbe-4f05-8055-3acd3548026e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Trevor Vaughan
Vice President, Onyx Point, Inc

-- This account not approved for unencrypted proprietary information --
Message has been deleted
Message has been deleted

Brian S

unread,
Nov 25, 2016, 1:24:53 PM11/25/16
to SIMP Q&A Forum
Trevor-

This is the output from running the command; does this mean there is a potential error with the simp_def.yaml file? Line 24 is the use_fips line, which i have set to false.

./RedHat/6.yaml
./compliance_profiles/disa_stig_el7.yaml
./compliance_profiles/nist_800_53_rev4.yaml
./hostgroups/default.yaml
./hosts/puppet.(domain).yaml
./default.yaml
./simp_classes.yaml
./simp_def.yaml
(./simp_def.yaml): did not find expected key while parsing a block mapping at line 24 column 1


-Brian

Trevor Vaughan

unread,
Nov 25, 2016, 4:44:15 PM11/25/16
to Brian S, SIMP Q&A Forum
Yes, that is the issue.

The YAML in that file is invalid and needs to be corrected. You may have dropped the colon, or mis-aligned the keys somehow. Tabs vs spaces, etc...

Thanks,

Trevor

On Fri, Nov 25, 2016 at 12:58 PM, Brian S <brians...@gmail.com> wrote:
Tevor-

This is the output from running the command; does this mean there is a potential error with the simp_def.yaml file?  Line 24 is the use_fips line, which i have set to false.

./RedHat/6.yaml
./compliance_profiles/disa_stig_el7.yaml
./compliance_profiles/nist_800_53_rev4.yaml
./hostgroups/default.yaml
./hosts/puppet.hq.dragos.services.yaml
./default.yaml
./simp_classes.yaml
./simp_def.yaml
(./simp_def.yaml): did not find expected key while parsing a block mapping at line 24 column 1


-Brian

On Friday, November 25, 2016 at 11:14:35 AM UTC-5, Trevor Vaughan wrote:
Hi Brian,

That is almost certainly malformed YAML somewhere in your hiera stack.

It may have been broken prior to your snapshot since the Puppet Server won't reload your *new* Hiera YAML files unless it is restarted.

Hop into your hieradata directory and try this:

for x in `find . -name "*.yaml"`; do echo $x; ruby -r yaml -e "begin; YAML.parse_file('$x'); rescue StandardError => e; puts e.to_s; end"; done

Thanks,

Trevor
On Fri, Nov 25, 2016 at 10:20 AM, Brian S <brians...@gmail.com> wrote:
Hello-

I am getting the following error and I assume it is due to a hiera configuration?  I am just now learning hiera, so any help would be appreciated.

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, undefined method `empty?' for nil:NilClass at /etc/puppetlabs/code/environments/production/manifests/site.pp:28:1 on node

From some initial research it looks like it could be either with permissions or with the .yaml files having tabs instead of spaces. The code was working fine a few days ago but now it no longer is.  I reverted back to an earlier snapshot on the VM and it still has the error.  I know it was working at the time of the snapshot.  I have also removed the one custom file i added in the hieradata/hostgroups section and still receive the error.  Looking at the file site.pp, line 28 contains "hiera_include('classes')".  

Where should I be looking to help resolve this error?

Thanks-
Brian

--
You received this message because you are subscribed to the Google Groups "SIMP Q&A Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simp+uns...@googlegroups.com.



--
Trevor Vaughan
Vice President, Onyx Point, Inc

-- This account not approved for unencrypted proprietary information --

--
You received this message because you are subscribed to the Google Groups "SIMP Q&A Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simp+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Brian S

unread,
Nov 25, 2016, 4:50:21 PM11/25/16
to SIMP Q&A Forum
Great, thanks for the confirmation. I assume I accidentally hit a key at some point while I had it open with VI.

If I reran simp config would that regenerate this primary file? Or is there another recommended way, besides going through each line manually?

-Brian

Trevor Vaughan

unread,
Nov 26, 2016, 10:43:45 AM11/26/16
to Brian S, SIMP Q&A Forum
Hi Brian,

You could rerun 'simp config', but I would just take a look at the file and that line should have something wrong with it.

Try opening it in vi and running :set list to see the whitespace characters and or running :retab.

If you want to fire it my way, I can take a look real quick as well.

Trevor

--
You received this message because you are subscribed to the Google Groups "SIMP Q&A Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simp+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Brian S

unread,
Nov 26, 2016, 5:08:07 PM11/26/16
to SIMP Q&A Forum, brians...@gmail.com
Thanks for the offer.  I found out the line that was causing the issue by going through and commenting out each line one at a time last night.  I forgot I had setup the NTP servers line after the initial simp config.  I did not delete the [] when I added in the ntp server and this was causing the error.  Once I corrected this puppet ran successfully.

-Brian


On Saturday, November 26, 2016 at 10:43:45 AM UTC-5, Trevor Vaughan wrote:
Hi Brian,

You could rerun 'simp config', but I would just take a look at the file and that line should have something wrong with it.

Try opening it in vi and running :set list to see the whitespace characters and or running :retab.

If you want to fire it my way, I can take a look real quick as well.

Trevor
On Fri, Nov 25, 2016 at 4:50 PM, Brian S <brians...@gmail.com> wrote:
Great, thanks for the confirmation. I assume I accidentally hit a key at some point while I had it open with VI.

If I reran simp config would that regenerate this primary file?  Or is there another recommended way, besides going through each line manually?

-Brian

--
You received this message because you are subscribed to the Google Groups "SIMP Q&A Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simp+uns...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages