# Backgroundrb problem

**URL:** <https://www.ruby-forum.com/t/backgroundrb-problem/136971>\
**Category:** Rails\
**Created:** [May 7, 2008, 9:03pm UTC](https://www.ruby-forum.com/t/backgroundrb-problem/136971 "2008-05-07T21:03:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahead](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c77e96/32.png) [@ahead](https://www.ruby-forum.com/u/ahead)\
**Post date:** [May 7, 2008, 9:03pm UTC](https://www.ruby-forum.com/t/backgroundrb-problem/136971/1 "2008-05-07T21:03:02Z")

</div>

I have this worker:

class ImportWorker \< BackgrounDRb::MetaWorker  
set\_worker\_name :import\_worker  
def create(args = nil)  
end  
def process(value)  
logger.info("Hello from process, value is " + value)  
end  
end

When I try to start it and use a job\_key I get an error in the  
backgroundrb log file.

MiddleMan.worker(:import\_worker, ‘1’).process(‘foobar’)

000000092{  
: type:do\_work:job\_key"1:worker\_method:  
process:worker:import\_worker: data"foobar  
datafoobarjob\_key1typedo\_workworker\_methodprocessworkerimport\_worker  
You have a nil object when you didn’t expect it!  
The error occurred while evaluating nil.send\_request  
/Library/Ruby/Gems/1.8/gems/packet-0.1.5/lib/packet/packet\_master.rb:44:in  
`ask_worker' /Users/andersw/Railsapps/tre-gui-prototype_import/vendor/plugins/backgroundrb/server/lib/master_worker.rb:104:in`process\_work’

If I don’t use job\_key it seems to work.

Has anybody else seen this? I’m using backgroundrb from svn trunk and  
rails 1.2.6 on Mac OSX.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![ahead](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c77e96/32.png) [@ahead](https://www.ruby-forum.com/u/ahead)\
**Post date:** [May 19, 2008, 7:40am UTC](https://www.ruby-forum.com/t/backgroundrb-problem/136971/2 "2008-05-19T07:40:42Z")

</div>

Abigail,

I often get this error when I do stuff like shut down and restart my  
Backgroundrb server while Rails is running. I have not conclusively  
determined whether it matters if you start backgroundrb or the Rails  
server first (don’t think it does), but if I stop both my Rails server  
and backgroundrb, then restart them both, this error goes away.

I think it might also happen after you get an exception in  
backgroundrb (especially in development mode), though that is  
speculation, I haven’t gotten it in enough reproducible states to say  
for sure. What I can say is that if I stop and restart both my bdrb  
and my rails server, the error goes away.

Bill  
[http://www.williambharding.com/blog](http://www.williambharding.com/blog)

On May 7, 12:03 pm, Abigail Headroom \<rails-mailing-l…@andreas-
