Issue #19955 has been updated by Charlie Sharpsteen.
Another common example: consider the following Hiera data, which passes the
Syck parser used by ruby 1.8.x but chokes the Psych parser used by 1.9.x
(variable interpolation needs to be quoted):
<pre>
# /var/lib/hiera/defaults.yaml
---
hiera_test::message: %{settings::modulepath} is the master modulepath
</pre>
And associated puppet class:
<pre>
class hiera_test ($message = 'hello' ){
notify { $message: }
}
</pre>
Trying to apply the class throws a very obscure error message:
<pre>
# puppet apply -e 'include hiera_test'
Error: Could not run: (<unknown>): found character that cannot start any token
while scanning for the next token at line 2 column 22
</pre>
There is no indication that the failure occurred in the Hiera data.
----------------------------------------
Bug #19955: Misleading error when Hiera databindings fail
https://projects.puppetlabs.com/issues/19955#change-97968
* Author: Dolf Schimmel
* Status: Accepted
* Priority: Normal
* Assignee:
* Category: databinding
* Target version: 3.x
* Affected Puppet version:
* Keywords: error
* Branch:
----------------------------------------
Hi,
I just put created a hiera.yaml file with some invalid contents (`echo foobar >
/etc/puppet/hiera.yaml`). When doing a puppet run, I'm confronted with the
following error:
<pre>
Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
can't convert String into Hash at
/etc/puppet/environments/production/manifests/cluster/core/nodes.pp:4 on node
puppet01.dev.example.net
</pre>
The contents of the nodes.pp file is:
<pre>
node 'puppet01.dev.node.net' inherits basenode {
$manage_puppet = false
include "cluster::core::puppetmaster::pupppet"
include basenode::general
}
</pre>
Clearly the config file is not parsed, which is alright in this case. The error
is quite misleading though, as it suggests some error had occurred in my
manifest, while it was caused (and fixed afterwards) in hiera.yaml.
Proposed fix would be to change the error into something meaningful. Last week
I had the same error causing me to debug for several hours, only to do a
vagrant destroy.
<pre>
root@puppet01:/etc/puppet# puppet --version
3.1.1
root@puppet01:/etc/puppet# uname -a
Linux puppet01.dev.example.net 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10
20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
</pre>
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.