Weird Mongrel error: Not starting

Hi list,
I have a problem with Mongrel which is really bugging me. I would really
appreciate any help that anyone can provide to help me in solving this
problem.

  1. My setup:

Apache front_end with mod_proxy_balancer in front of 4 mongrel/rails
instances of my application.
Rails 1.2.5
Ruby 1.8.6
Mongrel 1.1.1

  1. I noticed that the CPU consumption on my server was 100% being
    consumed
    by ruby so I stopped the ruby processes and rebooted the server.

  2. After the reboot mongrel_rails fails to load for one particular
    application though I have other applications running on the same server
    without any issues. This is the error that I get:

** Starting Mongrel listening at 0.0.0.0:3013
** Starting Rails with development environment…
/usr/lib/ruby/gems/1.8/gems/mongrel-
1.1.1/bin/…/lib/mongrel/tcphack.rb:12:in
initialize_without_backlog': Cannot assign requested address - bind(2) (Errno::EADDRNOTAVAIL) from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/tcphack.rb:12:ininitialize’
from /usr/lib/ruby/1.8/drb/drb.rb:865:in open' from /usr/lib/ruby/1.8/drb/drb.rb:865:inopen_server’
from /usr/lib/ruby/1.8/drb/drb.rb:759:in open_server' from /usr/lib/ruby/1.8/drb/drb.rb:757:ineach’
from /usr/lib/ruby/1.8/drb/drb.rb:757:in open_server' from /usr/lib/ruby/1.8/drb/drb.rb:1339:ininitialize’
from /usr/lib/ruby/1.8/drb/drb.rb:1627:in new' ... 31 levels... from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/../lib/mongrel/command.rb:212:inrun’
from
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/mongrel_rails:281
from /usr/bin/mongrel_rails:16:in `load’
from /usr/bin/mongrel_rails:16

  1. I tried everything that I know of to resolve the issue but no luck:

    • Did a netstat to check if the port was in use by any other
      process: No
      processes were holding onto that port
    • Checked ifconfig configuration to see if the NICs have been
      changed in
      anyway: No changes had been made to the NICs.
  2. To isolate the issue, I checked out the same version of the
    application
    from svn and deployed on the server. Still no luck.

  3. Checked out the same version of the application from svn and deployed
    on
    another server with success. Hmm same code different boxes and it is
    working
    says to me that there is something wrong with the configuration on the
    other
    server which is not playing ball with my code.

FYI: I have backgroundrb in vendor/plugins which starts up fine.

Any help in the right direction would be appreciated.

Thanks
Nii Amon.

Nii Amon Dsane escribió:

Hi list,

Hi Nii,

  1. After the reboot mongrel_rails fails to load for one particular
    application though I have other applications running on the same
    server without any issues. This is the error that I get:

** Starting Mongrel listening at 0.0.0.0:3013 http://0.0.0.0:3013

In your config/mongrel_cluster.yml try setting address parameter to
127.0.0.1 and explain results.

Regards

Hi Rafael,

Thanks for the quick response.

I am not using mongrel_cluster yet. I am just starting each
mongrel_rails instance manually. The command I use is below:

/usr/bin/mongrel_rails start -c /srv/rails/appname -P
/srv/rails/appname/log/mongrel.pid -l /srv/rails/appname/log/mongrel.log
-e production -d -p 3013.

I cd to RAILS_ROOT and then issue that command as root and then the
error appears.

Thanks
Nii Amon

Rafael García wrote:

Nii Amon Dsane escribió:

Hi list,

Hi Nii,

  1. After the reboot mongrel_rails fails to load for one particular
    application though I have other applications running on the same
    server without any issues. This is the error that I get:

** Starting Mongrel listening at 0.0.0.0:3013 http://0.0.0.0:3013

In your config/mongrel_cluster.yml try setting address parameter to
127.0.0.1 and explain results.

Regards

Try adding -a option:

/usr/bin/mongrel_rails start -c /srv/rails/appname -P
/srv/rails/appname/log/mongrel.pid -l /srv/rails/appname/log/mongrel.log
-e production -d -p 3013 -a 127.0.0.1

Only for check if run.

Nii amon Dsane escribió:

Hi Rafael,

I tried it with the -a switch and still the same error. I tried it
against all the IPs that ifconfig reported but it still failed.

Thanks
Nii Amon

Rafael García wrote:

Try adding -a option:

/usr/bin/mongrel_rails start -c /srv/rails/appname -P
/srv/rails/appname/log/mongrel.pid -l /srv/rails/appname/log/mongrel.log
-e production -d -p 3013 -a 127.0.0.1

Only for check if run.

Nii amon Dsane escribió: