[Backgroundrb-devel] Unexpected NameError when invoking task on worker

tanda raho tandaraho at gmail.com
Thu Jun 5 23:00:12 EDT 2008


Hi, I'm brand new to BackgrounDRb and trying to figure out the setup.

I cloned the git repository today as listed on the BackgrounDRb website.

Starting out with a very basic worker, but BackgroundDRb is crashing
on a NameError. Any help to resolve this issue would be greatly
appreciated! Thank you in advance!!

I am also attaching a text file with the output below since it might
be easier to see it in that format.

config/backgroundrb.yml
:backgroundrb:
  :ip: 0.0.0.0
  :port: 11009
  :environment: development
  :log: foreground


lib/workers/basic_worker.rb
class BasicWorker < BackgrounDRb::MetaWorker
  set_worker_name :basic_worker
  def create(args = nil)
    # this method is called, when worker is loaded for the first time
  end

  def keep_count
      count = 1
  end
end


Then I am starting BackgrounDRb and using the console to invoke the
worker, but run into this problem, and not sure what is going on:

[d96440a6 at d96440a6 ~/testapp]$ script/backgroundrb start
[d96440a6 at d96440a6 ~/testapp]$ ruby script/console
Loading development environment (Rails 2.0.2)
>> MiddleMan
=> #<BackgrounDRb::WorkerProxy:0x8675b6c @mutex=#<Mutex:0x8675b44>>
>> worker = MiddleMan.worker(:basic_worker)
=> #<BackgrounDRb::RailsWorkerProxy:0x995f78c @job_key=nil,
@middle_man=#<BackgrounDRb::WorkerProxy:0x8675b6c
@mutex=#<Mutex:0x8675b44>>, @worker_name=:basic_worker>
>> worker.keep_count
=> nil
>> /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:266:in `load_missing_constant': uninitialized constant Packet::BinParser (NameError)
        from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:453:in
`const_missing'
        from /home/d96440a6/testapp/vendor/plugins/backgroundrb/server/lib/master_worker.rb:170:in
`post_init'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_connection.rb:21:in
`invoke_init'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:302:in
`decorate_handler'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:76:in
`accept_connection'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:202:in
`handle_external_messages'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:178:in
`handle_read_event'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:174:in
`each'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:174:in
`handle_read_event'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:130:in
`start_reactor'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:124:in
`loop'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:124:in
`start_reactor'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:21:in
`run'
        from /home/d96440a6/testapp/vendor/plugins/backgroundrb/server/lib/master_worker.rb:188:in
`initialize'
        from script/backgroundrb:42:in `new'
        from script/backgroundrb:42
/opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_nbio.rb:25:in
`read_data': Packet::DisconnectError (Packet::DisconnectError)
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_worker.rb:46:in
`handle_internal_messages'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:176:in
`handle_read_event'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:174:in
`each'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:174:in
`handle_read_event'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:130:in
`start_reactor'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:124:in
`loop'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:124:in
`start_reactor'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_worker.rb:20:in
`start_worker'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:133:in
`fork_and_load'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:96:in
`load_workers'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:91:in
`each'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:91:in
`load_workers'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:20:in
`run'
        from /home/d96440a6/testapp/vendor/plugins/backgroundrb/server/lib/master_worker.rb:188:in
`initialize'
        from script/backgroundrb:42:in `new'
        from script/backgroundrb:42
/opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_nbio.rb:25:in
`read_data': Packet::DisconnectError (Packet::DisconnectError)
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_worker.rb:46:in
`handle_internal_messages'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:176:in
`handle_read_event'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:174:in
`each'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:174:in
`handle_read_event'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:130:in
`start_reactor'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:124:in
`loop'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:124:in
`start_reactor'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_worker.rb:20:in
`start_worker'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:133:in
`fork_and_load'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:96:in
`load_workers'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:91:in
`each'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:91:in
`load_workers'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:20:in
`run'
        from /home/d96440a6/testapp/vendor/plugins/backgroundrb/server/lib/master_worker.rb:188:in
`initialize'
        from script/backgroundrb:42:in `new'
        from script/backgroundrb:42
/opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_nbio.rb:25:in
`read_data': Packet::DisconnectError (Packet::DisconnectError)
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_worker.rb:46:in
`handle_internal_messages'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:176:in
`handle_read_event'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:174:in
`each'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:174:in
`handle_read_event'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:130:in
`start_reactor'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:124:in
`loop'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:124:in
`start_reactor'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_worker.rb:20:in
`start_worker'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:133:in
`fork_and_load'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:108:in
`start_worker'
        from /home/d96440a6/testapp/vendor/plugins/backgroundrb/server/lib/master_worker.rb:191:in
`initialize'
        from /opt/local/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:19:in
`run'
        from /home/d96440a6/testapp/vendor/plugins/backgroundrb/server/lib/master_worker.rb:188:in
`initialize'
        from script/backgroundrb:42:in `new'
        from script/backgroundrb:42
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: output.txt
URL: <http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20080605/8dfeab53/attachment.txt>


More information about the Backgroundrb-devel mailing list