I managed to get this working without using begin and rescue in that block, 
since mongodb collection find_update is not throwing any exception when its 
not find any data for the server. 

but am using JSON formatted registration and due to this mongo discovery 
with facts filter is not working. sorry am not mongdb expert and if someone 
would help me to change the 
code 
https://github.com/puppetlabs/mcollective-plugins/blob/master/agent/registration-mongodb/discovery/mongo.rb
 
to parse the JSON formatted data from mongodb that would be helpful for me. 


Regards
Ravi

On Sunday, March 26, 2017 at 12:22:55 AM UTC+5:30, [email protected] wrote:
>
> Hi,
>
> I configured monogdb registration and when the registration receive 
> messages getting below error,
>
> D, [2017-03-25T13:34:45.379511 #21619] DEBUG -- : registration.rb:100:in 
> `handlemsg' Updated data for host server61273.domain.com with id  in 
> 0.0200910568237305s
> E, [2017-03-25T13:34:45.379731 #21619] ERROR -- : agents.rb:138:in 
> `dispatch' Execution of registration failed: undefined method `[]' for 
> nil:NilClass
> E, [2017-03-25T13:34:45.379887 #21619] ERROR -- : agents.rb:139:in 
> `dispatch' /usr/libexec/mcollective/mcollective/agent/registration.rb:95:in 
> `handlemsg'
>                 /usr/lib/ruby/site_ruby/1.8/mcollective/agents.rb:126:in 
> `dispatch'
>                 /usr/lib/ruby/1.8/timeout.rb:67:in `timeout'
>                 /usr/lib/ruby/site_ruby/1.8/mcollective/agents.rb:125:in 
> `dispatch'
>                 /usr/lib/ruby/site_ruby/1.8/mcollective/agents.rb:121:in 
> `initialize'
>                 /usr/lib/ruby/site_ruby/1.8/mcollective/agents.rb:121:in 
> `new'
>                 /usr/lib/ruby/site_ruby/1.8/mcollective/agents.rb:121:in 
> `dispatch'
>                 /usr/lib/ruby/site_ruby/1.8/mcollective/runner.rb:205:in 
> `agentmsg'
>                 /usr/lib/ruby/site_ruby/1.8/mcollective/runner.rb:178:in 
> `receiver_thread'
>                 /usr/lib/ruby/site_ruby/1.8/mcollective/runner.rb:174:in 
> `loop'
>                 /usr/lib/ruby/site_ruby/1.8/mcollective/runner.rb:174:in 
> `receiver_thread'
>                 /usr/lib/ruby/site_ruby/1.8/mcollective/runner.rb:139:in 
> `start_receiver_thread'
>                 /usr/lib/ruby/site_ruby/1.8/mcollective/runner.rb:139:in 
> `initialize'
>                 /usr/lib/ruby/site_ruby/1.8/mcollective/runner.rb:139:in 
> `new'
>                 /usr/lib/ruby/site_ruby/1.8/mcollective/runner.rb:139:in 
> `start_receiver_thread'
>                 /usr/lib/ruby/site_ruby/1.8/mcollective/runner.rb:71:in 
> `main_loop'
>                 
> /usr/lib/ruby/site_ruby/1.8/mcollective/unix_daemon.rb:30:in 
> `daemonize_runner'
>                 
> /usr/lib/ruby/site_ruby/1.8/mcollective/unix_daemon.rb:13:in `daemonize'
>                 
> /usr/lib/ruby/site_ruby/1.8/mcollective/unix_daemon.rb:5:in `fork'
>                 
> /usr/lib/ruby/site_ruby/1.8/mcollective/unix_daemon.rb:5:in `daemonize'
>                 
> /usr/lib/ruby/site_ruby/1.8/mcollective/unix_daemon.rb:20:in 
> `daemonize_runner'
>                 /usr/sbin/mcollectived:62
>
> I configured registration agent as mentioned on 
> https://github.com/ripienaar/mcollective-plugins/blob/master/agent/registration-mongodb/agent/registration.rb
>  
> . 
>
> Here are the version am using,
>
> MongoDB server version: 3.4.2
> Gem mongo version : mongo
> ruby version : 1.8.7
>
> Any help please..
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"mcollective-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to