# Backgroundrb - Connection closed

**URL:** <https://www.ruby-forum.com/t/backgroundrb-connection-closed/98835>\
**Category:** Rails\
**Created:** [July 18, 2006, 3:34pm UTC](https://www.ruby-forum.com/t/backgroundrb-connection-closed/98835 "2006-07-18T15:34:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrkohrea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4491bb/32.png) [@mrkohrea](https://www.ruby-forum.com/u/mrkohrea)\
**Post date:** [July 18, 2006, 3:34pm UTC](https://www.ruby-forum.com/t/backgroundrb-connection-closed/98835/1 "2006-07-18T15:34:12Z")

</div>

Hello,

maybe someone can help with backgroundrb. I’ve written an application,  
which  
makes use of backgroundrb. Everything works fine on my development  
machine, but  
it crashes on my production server.

Something seems to be wrong with backgroundrb, but I don’t know the  
cause. All I  
get is the error message attached below, which is extracted from the  
production.log.

I appreciate any help on this matter.

Greetings

Michael K.

## — errror message

DRb::DRbConnError (connection closed):  
/usr/local/lib/ruby/1.8/drb/drb.rb:567:in `load' /usr/local/lib/ruby/1.8/drb/drb.rb:629:in`recv\_reply’  
/usr/local/lib/ruby/1.8/drb/drb.rb:918:in `recv_reply' /usr/local/lib/ruby/1.8/drb/drb.rb:1192:in`send\_message’  
/usr/local/lib/ruby/1.8/drb/drb.rb:1083:in `method_missing' /usr/local/lib/ruby/1.8/drb/drb.rb:1167:in`open’  
/usr/local/lib/ruby/1.8/drb/drb.rb:1082:in `method_missing' /usr/local/lib/ruby/1.8/drb/drb.rb:1100:in`with\_friend’  
/usr/local/lib/ruby/1.8/drb/drb.rb:1081:in `method_missing' /app/controllers/search_controller.rb:100:in`start\_source\_processing’  
/app/controllers/search\_controller.rb:99:in  
`start_source_processing' /app/controllers/search_controller.rb:20:in`simple’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action\_controller/base.rb:910:in  
`perform\_action\_without\_filters’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action\_controller/filters.rb:368:in  
`perform\_action\_without\_benchmark’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action\_controller/benchmarking.rb:69:in  
`perform_action_without_rescue' /usr/local/lib/ruby/1.8/benchmark.rb:293:in`measure’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action\_controller/benchmarking.rb:69:in  
`perform\_action\_without\_rescue’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action\_controller/rescue.rb:82:in  
`perform\_action’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action\_controller/base.rb:381:in  
`process\_without\_filters’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action\_controller/filters.rb:377:in  
`process\_without\_session\_management\_support’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action\_controller/session\_management.rb:117:in  
`process' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/dispatcher.rb:38:in`dispatch’

/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/lib/mongrel/rails.rb:66:in  
`process' /usr/local/lib/ruby/1.8/thread.rb:135:in`synchronize’

/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/lib/mongrel/rails.rb:64:in  
`process' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/lib/mongrel.rb:425:in`process\_client’  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/lib/mongrel.rb:424:in  
`process_client' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/lib/mongrel.rb:495:in`run’  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/lib/mongrel.rb:494:in  
`run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/lib/mongrel.rb:483:in`run’  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/lib/mongrel.rb:774:in  
`run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/lib/mongrel.rb:772:in`run’  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/bin/mongrel\_rails:97:in  
`run’

/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/lib/mongrel/command.rb:163:in  
`run’  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/bin/mongrel\_rails:194  
/usr/local/bin/mongrel\_rails:18

---

<div class="post-metadata">

**Author:** ![mrkohrea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4491bb/32.png) [@mrkohrea](https://www.ruby-forum.com/u/mrkohrea)\
**Post date:** [July 18, 2006, 7:17pm UTC](https://www.ruby-forum.com/t/backgroundrb-connection-closed/98835/2 "2006-07-18T19:17:41Z")

</div>

Hey Michael-

```
SO this works in development mode but not in production? That sounds

```

like a configuration issue to me. Can you go over your config file  
and make sure it is doing what you thihnk it should be doing? You  
need to make sure to set the environment to production in the config  
file as it defaults to development.

-Ezra

---

<div class="post-metadata">

**Author:** ![mrkohrea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4491bb/32.png) [@mrkohrea](https://www.ruby-forum.com/u/mrkohrea)\
**Post date:** [July 18, 2006, 9:06pm UTC](https://www.ruby-forum.com/t/backgroundrb-connection-closed/98835/3 "2006-07-18T21:06:12Z")

</div>

Hello Ezra,

that’s what I’d suppose too. But everything is set properly. Of course  
I’ve set  
the environment to production in config/backgroundrb.yml.

I’m sort of stunned. I really don’t know, what else I can do.

Greetings

Michael K.

---

<div class="post-metadata">

**Author:** ![mrkohrea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4491bb/32.png) [@mrkohrea](https://www.ruby-forum.com/u/mrkohrea)\
**Post date:** [July 19, 2006, 12:27am UTC](https://www.ruby-forum.com/t/backgroundrb-connection-closed/98835/4 "2006-07-19T00:27:49Z")

</div>

Michael-

```
Are you running this on OSX? I have seen a few issues with reverse

```

dns not working correctly on OSX for drb connections that return that  
same connection closed error. Try replacing the host in the config  
file with 127.0.0.1 instead of localhost. You will also need to do  
the saem to the acl list in the config. Try this and report back.

THanks  
-Ezra

---

<div class="post-metadata">

**Author:** ![mrkohrea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4491bb/32.png) [@mrkohrea](https://www.ruby-forum.com/u/mrkohrea)\
**Post date:** [June 5, 2007, 9:55am UTC](https://www.ruby-forum.com/t/backgroundrb-connection-closed/98835/5 "2007-06-05T09:55:48Z")

</div>

Hello1!  
I have the same error (connection closed)  
My config file is listed below:  
port: 2999  
load\_rails: true  
environment: test  
host: [xxx.xxx.com](http://xxx.xxx.com)  
database\_yml: config/database.yml  
protocol: druby  
acl:  
:deny: all  
:allow: [xxx.xxx.com](http://xxx.xxx.com)  
:order: deny, allow

when i replace :allow 127.0.0.1 then i have another kind of error:  
“connection closed by peer”.  
if i replace host: 127.0.0.1 i have error:  
" connection refused - connect(2)" (that error i encountered when run my  
test without backgroundrb server started)  
I do not know how i can escape from this…where error is - in the  
config or somewhere else…

I appreciate any help on this matter.

Thank you,  
Dmitry

---

<div class="post-metadata">

**Author:** ![mrkohrea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4491bb/32.png) [@mrkohrea](https://www.ruby-forum.com/u/mrkohrea)\
**Post date:** [July 19, 2006, 8:04am UTC](https://www.ruby-forum.com/t/backgroundrb-connection-closed/98835/6 "2006-07-19T08:04:28Z")

</div>

Dear Ezra,

I’ve swapped localhost with 127.0.0.1 and it’s working. Strange me,  
because I  
was sure that I had already tried that yesterday. Obviously not.

Anyway: It’s working now!

I am using FreeBSD(Release 6.0). Since OSX ist sort of BSDish, there  
could be a  
relation.

Anyway, backgroundrb is way cool and I can imagine tons of interesting  
uses for it.

Greetings and thank your very much for your patience and your help. And  
of  
course, thanks for backgroundrb!!!

Michael

---

<div class="post-metadata">

**Author:** ![mrkohrea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4491bb/32.png) [@mrkohrea](https://www.ruby-forum.com/u/mrkohrea)\
**Post date:** [June 7, 2007, 2:59pm UTC](https://www.ruby-forum.com/t/backgroundrb-connection-closed/98835/7 "2007-06-07T14:59:11Z")

</div>

ok, i got the solution. i put the url for the server, but needed the ip  
address.
