[Pkg-puppet-devel] Bug#513314: comparison of Fixnum with String failed

Jayen Ashar jayen at science.unsw.edu.au
Wed Jan 28 23:42:13 UTC 2009


I got a trace, by altering interpreter.rb to puts to a file on error:

/usr/lib/ruby/1.8/puppet/parser/ast/comparison_operator.rb:23:in `<='
/usr/lib/ruby/1.8/puppet/parser/ast/comparison_operator.rb:23:in `send'
/usr/lib/ruby/1.8/puppet/parser/ast/comparison_operator.rb:23:in `evaluate'
/usr/lib/ruby/1.8/puppet/parser/ast.rb:54:in `safeevaluate'
/usr/lib/ruby/1.8/puppet/parser/ast/ifstatement.rb:16:in `evaluate'
/usr/lib/ruby/1.8/puppet/parser/ast.rb:54:in `safeevaluate'
/usr/lib/ruby/1.8/puppet/parser/ast/astarray.rb:35:in `evaluate'
/usr/lib/ruby/1.8/puppet/parser/ast/astarray.rb:34:in `collect'
/usr/lib/ruby/1.8/puppet/parser/ast/astarray.rb:34:in `evaluate'
/usr/lib/ruby/1.8/puppet/parser/ast.rb:54:in `safeevaluate'
/usr/lib/ruby/1.8/puppet/parser/ast/hostclass.rb:74:in `evaluate_code'
/usr/lib/ruby/1.8/puppet/parser/resource.rb:61:in `evaluate'
/usr/lib/ruby/1.8/puppet/parser/compiler.rb:145:in `evaluate_classes'
/usr/lib/ruby/1.8/puppet/parser/compiler.rb:136:in `each'
/usr/lib/ruby/1.8/puppet/parser/compiler.rb:136:in `evaluate_classes'
/usr/lib/ruby/1.8/puppet/parser/functions/include.rb:6:in `function_include'
/usr/lib/ruby/1.8/puppet/parser/ast/function.rb:14:in `send'
/usr/lib/ruby/1.8/puppet/parser/ast/function.rb:14:in `evaluate'
/usr/lib/ruby/1.8/puppet/parser/ast.rb:54:in `safeevaluate'
/usr/lib/ruby/1.8/puppet/parser/ast/astarray.rb:35:in `evaluate'
/usr/lib/ruby/1.8/puppet/parser/ast/astarray.rb:34:in `collect'
/usr/lib/ruby/1.8/puppet/parser/ast/astarray.rb:34:in `evaluate'
/usr/lib/ruby/1.8/puppet/parser/ast.rb:54:in `safeevaluate'
/usr/lib/ruby/1.8/puppet/parser/ast/hostclass.rb:74:in `evaluate_code'
/usr/lib/ruby/1.8/puppet/parser/resource.rb:61:in `evaluate'
/usr/lib/ruby/1.8/puppet/parser/compiler.rb:272:in `evaluate_definitions'
/usr/lib/ruby/1.8/puppet/parser/compiler.rb:270:in `each'
/usr/lib/ruby/1.8/puppet/parser/compiler.rb:270:in `evaluate_definitions'
/usr/lib/ruby/1.8/puppet/util/errors.rb:25:in `exceptwrap'
/usr/lib/ruby/1.8/puppet/parser/compiler.rb:267:in `evaluate_definitions'
/usr/lib/ruby/1.8/puppet/parser/compiler.rb:295:in `evaluate_generators'
/usr/lib/ruby/1.8/puppet/parser/compiler.rb:290:in `loop'
/usr/lib/ruby/1.8/puppet/parser/compiler.rb:290:in `evaluate_generators'
/usr/lib/ruby/1.8/puppet/parser/compiler.rb:92:in `compile'
/usr/lib/ruby/1.8/puppet/parser/interpreter.rb:29:in `compile'
/usr/lib/ruby/1.8/puppet/indirector/catalog/compiler.rb:68:in `compile'
/usr/lib/ruby/1.8/puppet/util.rb:212:in `benchmark'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/1.8/benchmark.rb:307:in `realtime'
/usr/lib/ruby/1.8/puppet/util.rb:211:in `benchmark'
/usr/lib/ruby/1.8/puppet/indirector/catalog/compiler.rb:66:in `compile'
/usr/lib/ruby/1.8/puppet/indirector/catalog/compiler.rb:21:in `find'
/usr/lib/ruby/1.8/puppet/indirector/indirection.rb:210:in `find'
/usr/lib/ruby/1.8/puppet/indirector.rb:49:in `find'
/usr/lib/ruby/1.8/puppet/network/handler/master.rb:65:in `getconfig'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `to_proc'
/usr/lib/ruby/1.8/puppet/network/xmlrpc/processor.rb:52:in `call'
/usr/lib/ruby/1.8/puppet/network/xmlrpc/processor.rb:52:in `protect_service'
/usr/lib/ruby/1.8/puppet/network/xmlrpc/processor.rb:85:in `setup_processor'
/usr/lib/ruby/1.8/xmlrpc/server.rb:336:in `call'
/usr/lib/ruby/1.8/xmlrpc/server.rb:336:in `dispatch'
/usr/lib/ruby/1.8/xmlrpc/server.rb:323:in `each'
/usr/lib/ruby/1.8/xmlrpc/server.rb:323:in `dispatch'
/usr/lib/ruby/1.8/xmlrpc/server.rb:366:in `call_method'
/usr/lib/ruby/1.8/xmlrpc/server.rb:378:in `handle'
/usr/lib/ruby/1.8/puppet/network/xmlrpc/processor.rb:44:in `process'
/usr/lib/ruby/1.8/puppet/network/http_server/mongrel.rb:111:in `process'
/usr/lib/ruby/1.8/mongrel/http_response.rb:65:in `start'
/usr/lib/ruby/1.8/puppet/network/http_server/mongrel.rb:108:in `process'
/usr/lib/ruby/1.8/mongrel.rb:159:in `process_client'
/usr/lib/ruby/1.8/mongrel.rb:158:in `each'
/usr/lib/ruby/1.8/mongrel.rb:158:in `process_client'
/usr/lib/ruby/1.8/mongrel.rb:285:in `run'
/usr/lib/ruby/1.8/mongrel.rb:285:in `initialize'
/usr/lib/ruby/1.8/mongrel.rb:285:in `new'
/usr/lib/ruby/1.8/mongrel.rb:285:in `run'


Jayen Ashar wrote:
> I tried adding "trace = true" to the main and puppetmasterd sections of 
> puppet.conf, and also tried changing defaults.rb, so trace would be 
> true.  This didn't change any output.
> 
> --Jayen
> 
> Jayen Ashar wrote:
>> can you help me out with enabling --trace?  I tried adding it to 
>> puppetd's command line and /etc/default/puppetmaster's DAEMON_OPTS, 
>> but didn't get anything.  adding -d and -v gave me stuff, but nothing 
>> related to this error.
>>
>> --Jayen
>>
>> Matthew Palmer wrote:
>>> On Wed, Jan 28, 2009 at 02:32:30PM +1100, Jayen Ashar wrote:
>>>> Package: puppetmaster
>>>> Version: 0.24.6-1
>>>> Severity: normal
>>>>
>>>> the puppet classifer spits out this as part of its yaml:
>>>> ---
>>>> classes:
>>>>   - debian_etch
>>>> parameters:
>>>>   stage: 0
>>>>
>>>> the manifest contains:
>>>>   if $stage <= 0 {
>>>>
>>>> the error message i get is:
>>>> err: Could not retrieve catalog: comparison of Fixnum with String 
>>>> failed at /etc/puppet/manifests/classes/debian_etch.pp:16 on node 
>>>> matht403.maths.unsw.edu.au
>>>>
>>>> I also tried '$stage <= "0"', but got the same error.  Any way I can
>>>> force both to be Fixnums?  Or both to be Strings?
>>>
>>> Run with --trace to get a backtrace of the problem, then you can 
>>> possibly
>>> use either .to_i or .to_s at the appropriate line in the code to cast 
>>> the
>>> value to whatever you want for your comparison.  Based on this and your
>>> other bug, I'd say that there's some really frightening stuff, 
>>> type-wise,
>>> going on in the code related to inequality operators.
>>>
>>> - Matt
>>
> 

-- 
Jayen Ashar 	
Technical Officer	
Computing Center
School of Mathematics and Statistics
M029, Red Center
The University of New South Wales SYDNEY NSW 2052
Ph: + 61 (2) 93857016
Fax: + 61 (2) 93857192
CRICOS provider code: 00098G





More information about the Pkg-puppet-devel mailing list