Hiera - can't convert Array into String error

399 views
Skip to first unread message

Michael Knox

unread,
Jun 13, 2012, 8:40:09 AM6/13/12
to puppet...@googlegroups.com
Hi,
I've been moving from extlookup to hiera, and it's generally gone fairly smoothly, but I've run into a problem with one of our defines ...

I get this error:
err: Could not retrieve catalog from remote server: Error 400 on SERVER: can't convert Array into String at ...

The define uses an exec to install Perl CPAN modules and sets log output based on a hiera lookup.
exec{"cpan_load_${title}":
< cut …>
logoutput => hiera('cpan_logoutput'),
}

If I remove that line, everything runs through fine.

The yaml for hiera:
---
cpan_logoutput: true

Any ideas on what could be triggering this error?


Wolf Noble

unread,
Jun 13, 2012, 11:06:15 AM6/13/12
to <puppet-users@googlegroups.com>
I had some issues with using boolean logic with data being fed to me by hiera. I went for a slightly hacky option of:

might help you, might be a BadIdea(™)

(untested)


class foo::params{
bool_to_be_tempname = hiera('some_TorF_key_as_a_string')
case bool_to_be_tempname {
[tT][rR][uU][eE]: {
bool_to_be = true
}
default: {
bool_to_be = false
> --
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
>


________________________________

This message may contain confidential or privileged information. If you are not the intended recipient, please advise us immediately and delete this message. See http://www.datapipe.com/legal/email_disclaimer/ for further information on confidentiality and the risks of non-secure electronic communication. If you cannot access these links, please notify us by reply message and we will send the contents to you.

Michael Knox

unread,
Jun 14, 2012, 1:51:45 AM6/14/12
to puppet...@googlegroups.com
Thanks,
It appears to be something internal to the hiera function, so I'll have to go digging in there to find out what's going on.

Cheers

Kelsey Hightower

unread,
Jun 25, 2012, 9:48:39 AM6/25/12
to puppet...@googlegroups.com
On Thursday, June 14, 2012 1:51:45 AM UTC-4, Mike wrote:
Thanks,
It appears to be something internal to the hiera function, so I'll have to go digging in there to find out what's going on.

Cheers 

Are you in position to **test** the 1.0rc branches of hiera and hiera-puppet?
 
>> To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
>> For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
>>
>
>
> ________________________________
>
> This message may contain confidential or privileged information. If you are not the intended recipient, please advise us immediately and delete this message. See http://www.datapipe.com/legal/email_disclaimer/ for further information on confidentiality and the risks of non-secure electronic communication. If you cannot access these links, please notify us by reply message and we will send the contents to you.
>
> --
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.

Michael Knox

unread,
Jun 26, 2012, 1:14:17 AM6/26/12
to puppet...@googlegroups.com
On 25/06/2012, at 11:48 PM, Kelsey Hightower wrote:

On Thursday, June 14, 2012 1:51:45 AM UTC-4, Mike wrote:
Thanks,
It appears to be something internal to the hiera function, so I'll have to go digging in there to find out what's going on.

Cheers 

Are you in position to **test** the 1.0rc branches of hiera and hiera-puppet?
Just tried them, unfortunately I got exactly the same error….
err: Could not retrieve catalog from remote server: Error 400 on SERVER: can't convert Array into String at 

--trace on the client (using puppet agent) hasn't given me anything useful.

I can extract the data using on the server using hiera, so it would seem to be something in the puppet functions. Hopefully I'll be able to spend some time and look at the functions in a bit more detail soon.

To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/2GdyZeaN6DoJ.

To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages