Issue #2010 has been updated by masterzen.
immerda wrote:'
> Hi
>
> > Only a some clients had the problem. And these who haven't been updated to
> > the latest version and still running 0.24.5 didn't have the problem. But
> > also not every client who have been updated had the problem. Quite strange.
>
> and it now even appears on clients which haven't yet been updated.
>
> so I would say it's a more general issue.
The issue is strange, it can be:
* either a parameter that doesn't have a resource_id (why?)
or
* a parameter which references a resource we don't know for this run
The request we use for finding parameters is the following one:
<pre>
SELECT v.id, v.value, v.line, v.resource_id, v.param_name_id, n.name FROM
param_values as v INNER JOIN resources r ON v.resource_id=r.id INNER JOIN
param_names as n ON v.param_name_id=n.id WHERE r.host_id=<HOSTID>
</pre>
(replace HOSTID with the database id of the failing host).
Since there is an inner join with the resource id we shouldn't be able to
return a parameter which doesn't have a resource id (except if your database is
somewhat corrupted and you have some NULLs resources id).
Another possibility is that there is a discrepency between the resources
returned directly from rails and what is returned from the direct SQL request
(ie there is caching in the middle here).
To see if caching is an issue, if you restart your master, you shouldn't see
the failure for the previously failing host, until some changes happen.
A temporary solution to prevent the crash can be to replace both failing
functions in host.rb with the following code:
<pre>
def find_resources_parameters(resources)
params = Puppet::Rails::ParamValue.find_all_params_from_host(self)
# assign each loaded parameters/tags to the resource it belongs to
params.each do |param|
resources[param['resource_id']].add_param_to_hash(param) if
resources.include?(param['resource_id'])
end
end
def find_resources_tags(resources)
tags = Puppet::Rails::ResourceTag.find_all_tags_from_host(self)
tags.each do |tag|
resources[tag['resource_id']].add_tag_to_hash(tag) if
resources.include?(tag['resource_id'])
end
end
</pre>
That won't explain the issue, but at least you won't have a failing storeconfig.
----------------------------------------
Bug #2010: puppetmaster fails to store config, trying to hash a param which is
nil
/issues/2010
Author: immerda
Status: Accepted
Priority: Normal
Assigned to: andrew
Category:
Target version: 0.24.8
Complexity: Unknown
Affected version: 0.24.7
Keywords:
running the master on the latest head of 0.24.x gives the following error for
_every_ client:
<pre>
notice: Searched for resources in 0.25 seconds
/usr/lib/ruby/site_ruby/1.8/puppet/rails/host.rb:153:in
`find_resources_parameters_tags'
/usr/lib/ruby/site_ruby/1.8/puppet/rails/host.rb:125:in `setresources'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/core_ext/benchmark.rb:8:in
`realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/rails/host.rb:124:in `setresources'
/usr/lib/ruby/site_ruby/1.8/puppet/rails/host.rb:52:in `store'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/core_ext/benchmark.rb:8:in
`realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/rails/host.rb:51:in `store'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in
`transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:129:in
`transaction'
/usr/lib/ruby/site_ruby/1.8/puppet/rails/host.rb:32:in `store'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:448:in
`store_to_active_record'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in
`transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:129:in
`transaction'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:447:in
`store_to_active_record'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:180:in `benchmark'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/core_ext/benchmark.rb:8:in
`realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:179:in `benchmark'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:446:in
`store_to_active_record'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:439:in `store'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:99:in `compile'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/interpreter.rb:29:in `compile'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:68:in
`compile'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:180:in `benchmark'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/core_ext/benchmark.rb:8:in
`realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:179:in `benchmark'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:66:in
`compile'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:21:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/indirection.rb:210:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector.rb:49:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/network/handler/master.rb:65:in `getconfig'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `to_proc'
/usr/lib/ruby/site_ruby/1.8/puppet/network/xmlrpc/processor.rb:52:in `call'
/usr/lib/ruby/site_ruby/1.8/puppet/network/xmlrpc/processor.rb:52:in
`protect_service'
/usr/lib/ruby/site_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/site_ruby/1.8/puppet/network/xmlrpc/processor.rb:44:in `process'
/usr/lib/ruby/site_ruby/1.8/puppet/network/xmlrpc/webrick_servlet.rb:68:in
`service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:293:in `start'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:144:in `newthread'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:143:in `initialize'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:143:in `new'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:143:in `newthread'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:291:in `start'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:290:in `each'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:290:in `start'
/usr/sbin/puppetmasterd:285
err: Could not store configs: undefined method `add_param_to_hash' for
nil:NilClass
notice: Compiled catalog for puppet.foobar.com in 20.64 seconds
</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://reductivelabs.com/redmine/my/account
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---