Ask Your Question
0

How do I fix "Error 400 on SERVER: (<unknown>): did not find expected key while parsing a block mapping at"?

asked 2013-10-16 03:49:45 -0500

gertvdijk gravatar image

When using Puppet with a Hiera data source I get this error:

Error 400 on SERVER: (<unknown>): did not find expected key while parsing a block mapping at line 19 column 3

As the file is <unknown> I have no clue where my error is - it only indicates a line number and column. The only thing I know is that I altered a lot of data in my Hiera yaml data.

How do I fix this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-10-16 03:52:31 -0500

gertvdijk gravatar image

updated 2013-10-16 03:52:44 -0500

The issue appears to be that I wasn't quoting a variable substitution in a YAML map. E.g. this is wrong:

myclass::mymap:
  firstkey: firstvalue
  mykey: %{::myvariable}.domain.tld
  myotherkey: othervalue

While it should be

myclass::mymap:
  firstkey: firstvalue
  mykey: "%{::myvariable}.domain.tld"
  myotherkey: othervalue

It appeared that the f of firstkey was on line 19 column 3. So, be aware that the error does not always indicate the right line.

edit flag offensive delete link more

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: 2013-10-16 03:49:45 -0500

Seen: 2,346 times

Last updated: Oct 16 '13