How can I trace "comparison of String with Array failed" error to actual values?

350 views
Skip to first unread message

Stephan

unread,
Sep 10, 2014, 6:46:10 AM9/10/14
to puppet...@googlegroups.com
Hi All,

I'm getting the following error:

Error: Got an uncaught exception of type ArgumentError: comparison of String with Array failed
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/property/list.rb:38:in `sort'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/property/list.rb:38:in `dearrayify'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/property/list.rb:48:in `should'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/type/user.rb:365:in `block (2 levels) in <module:Puppet>'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/type.rb:1962:in `instance_eval'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/type.rb:1962:in `block in autorequire'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/type.rb:1940:in `block in eachautorequire'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/type.rb:1939:in `each'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/type.rb:1939:in `eachautorequire'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/type.rb:1957:in `autorequire'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/graph/relationship_graph.rb:168:in `block in build_autorequire_dependencies'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/graph/relationship_graph.rb:167:in `each'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/graph/relationship_graph.rb:167:in `build_autorequire_dependencies'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/graph/relationship_graph.rb:25:in `populate_from'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/resource/catalog.rb:195:in `relationship_graph'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/transaction.rb:141:in `relationship_graph'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/transaction.rb:55:in `evaluate'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/resource/catalog.rb:167:in `block in apply'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/util/log.rb:149:in `with_destination'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/transaction/report.rb:112:in `as_logging_destination'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/resource/catalog.rb:166:in `apply'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/configurer.rb:117:in `block in apply_catalog'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/util.rb:161:in `block in benchmark'
/opt/freeware/lib/ruby/2.0.0/benchmark.rb:296:in `realtime'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/util.rb:160:in `benchmark'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/configurer.rb:116:in `apply_catalog'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/configurer.rb:191:in `run'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/agent.rb:47:in `block (4 levels) in run'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/agent/locker.rb:20:in `lock'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/agent.rb:47:in `block (3 levels) in run'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/agent.rb:117:in `with_client'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/agent.rb:44:in `block (2 levels) in run'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/agent.rb:82:in `run_in_fork'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/agent.rb:43:in `block in run'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/application.rb:179:in `call'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/application.rb:179:in `controlled_run'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/agent.rb:41:in `run'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/application/agent.rb:355:in `onetime'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/application/agent.rb:321:in `run_command'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/application.rb:371:in `block (2 levels) in run'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/application.rb:477:in `plugin_hook'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/application.rb:371:in `block in run'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/util.rb:479:in `exit_on_fail'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/application.rb:371:in `run'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/util/command_line.rb:137:in `run'
/opt/freeware/lib/ruby/vendor_ruby/2.0.0/puppet/util/command_line.rb:91:in `execute'
/opt/freeware/bin/puppet:8:in `<main>'

I'm seeing this error only when I try to realize a virtual defined resource:

User::Config <| title == "joedoe" |>

The other weird thing is I see this error only on AIX. On Linux it does exactly what I expect it to do. I'm using puppet 3.6.2

How can I trace this error a bit better? I would like to see which actual string it tries to compare against which array, just to get a better idea of the issue. So, in general, how can I do that? I've tried running the agent with --debug and --trace, but that didn't get me much closer.

Thanks in advance
Stephan


Kylo Ginsberg

unread,
Sep 10, 2014, 4:21:52 PM9/10/14
to puppet...@googlegroups.com
Stephan,

Not sure if this is related or not, but the AIX user provider has some quirks which we'd like to resolve for puppet 4.0. You might take a look at:


And see if that sheds any light. 

Best,
Kylo

--
Kylo Ginsberg

Join us at PuppetConf 2014, September 20-24 in San Francisco - www.puppetconf.com 

Felix Frank

unread,
Sep 10, 2014, 5:00:42 PM9/10/14
to puppet...@googlegroups.com
On 09/10/2014 12:46 PM, Stephan wrote:
>
> The other weird thing is I see this error only on AIX. On Linux it
> does exactly what I expect it to do. I'm using puppet 3.6.2

Can you perhaps try another (older) Ruby version on AIX?

It's still weird, but this might narrow down the possible causes.

Björn

unread,
Jul 30, 2015, 9:03:51 AM7/30/15
to Puppet Users, Felix...@alumni.tu-berlin.de

I got the same issue with puppet 4 against a centos machine and I don't know ho to determine the failing module.

Debug: /Stage[main]/Sysupdates::Yum/File_line[set proxy for yum]: Adding autorequire relationship with File[yum.conf]
Debug: /Stage[main]/Sysupdates::Yum/File_line[disable http caching for yum]: Adding autorequire relationship with File[yum.conf]
Debug: /Stage[main]/Yum/File[yum.conf]: Adding autorequire relationship with User[root]
Debug: /Stage[main]/Ntp/File[ntp.conf]: Adding autorequire relationship with User[root]
Debug: /Stage[main]/Rsyslog/File[/etc/rsyslog.d/ims.conf]: Adding autorequire relationship with User[root]
Debug: /Stage[main]/Puppet_agent/File[/etc/default/puppet]: Adding autorequire relationship with User[root]
Debug: /Stage[main]/Puppet_agent/File[/etc/puppet/puppet.conf]: Adding autorequire relationship with File[/etc/puppet]
Debug: /Stage[main]/Puppet_agent/File[/etc/puppet/puppet.conf]: Adding autorequire relationship with User[root]
Debug: /Stage[main]/Puppet_agent/File[/usr/local/bin/start_puppet]: Adding autorequire relationship with User[root]
Debug: /Stage[main]/Puppet_agent/Cron[start puppet if not started]: Adding autorequire relationship with User[root]
Debug: /Stage[main]/Puppet_agent/Cron[clean clientbucket]: Adding autorequire relationship with User[root]
Debug: Storing state
Debug: Stored state in 0.03 seconds
Error: Failed to apply catalog: comparison of Array with String failed
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/property/list.rb:38:in `sort'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/property/list.rb:38:in `
dearrayify'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/property/list.rb:48:in `should'

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/user.rb:401:in `block (2 levels) in <module:Puppet>'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:2053:in `
instance_eval'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:2053:in `block in autorelation'

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:1992:in `block in eachautorequire'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:1991:in `
each'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:1991:in `eachautorequire'

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:2048:in `autorelation'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:2078:in `
autorequire'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:169:in `block (2 levels) in build_autorelation_dependencies'

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:168:in `each'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:168:in `
block in build_autorelation_dependencies'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:167:in `each'

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:167:in `build_autorelation_dependencies'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:25:in `
populate_from'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:202:in `relationship_graph'

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:171:in `relationship_graph'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:82:in `
evaluate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:178:in `block in apply'

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/log.rb:153:in `with_destination'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/report.rb:107:in `
as_logging_destination'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:177:in `apply'

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:119:in `block in apply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:129:in `
block in benchmark'
/opt/puppetlabs/puppet/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:128:in `benchmark'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:118:in `
apply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:228:in `run_internal'

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:134:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:64:in `
override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:223:in `override'

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:133:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:48:in `
block (4 levels) in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent/locker
.rb:20:in `lock'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:48:in `block (3 levels) in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:98:in `
with_client'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:45:in `block (2 levels) in run'

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:65:in `run_in_fork'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:44:in `
block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:179:in `call'

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:179:in `controlled_run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:42:in `
run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/agent.rb:351:in `onetime'

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/agent.rb:328:in `run_command'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:344:in `
block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:446:in `exit_on_fail'

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:344:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:128:in `
run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in `execute'

/opt/puppetlabs/puppet/bin/puppet:5:in `<main>'
Debug: Using cached connection for https://puppet:8140
Debug: Caching connection for https://puppet:8140
Debug: Closing connection for https://puppet:8140



 

Stephan Eckweiler

unread,
Jul 30, 2015, 5:28:49 PM7/30/15
to puppet...@googlegroups.com, Felix...@alumni.tu-berlin.de
IIRC I fixed this by consequently making all variables involved
arrays, even if they just had one member.
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Puppet Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/puppet-users/aK18gFX_SuI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> puppet-users...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/c7a16504-9bfe-4f1d-bad8-39b4a36dac29%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

Björn

unread,
Oct 22, 2015, 8:07:01 AM10/22/15
to Puppet Users, Felix...@alumni.tu-berlin.de
So I have to check every file in every module for variables and transform them to an array? :(
Reply all
Reply to author
Forward
0 new messages