# Errno::EBADF (Bad file descriptor - connect(2))

**URL:** <https://www.ruby-forum.com/t/errno-ebadf-bad-file-descriptor-connect-2/145573>\
**Category:** Rails\
**Created:** [August 11, 2008, 5:55pm UTC](https://www.ruby-forum.com/t/errno-ebadf-bad-file-descriptor-connect-2/145573 "2008-08-11T17:55:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shankar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9a28c/32.png) [@shankar](https://www.ruby-forum.com/u/shankar)\
**Post date:** [August 11, 2008, 5:55pm UTC](https://www.ruby-forum.com/t/errno-ebadf-bad-file-descriptor-connect-2/145573/1 "2008-08-11T17:55:56Z")

</div>

Hi,

I am getting this error when the Action mailer tries to send a mail-  
all  
the other sections seem to be working fine. Surprisingly, the same  
code  
used to work fine for almost a year

Please find the error stack that I am receiving, any help would be  
great  
!

~titan

Errno::EBADF (Bad file descriptor - connect(2)):  
c:/ruby/lib/ruby/1.8/net/protocol.rb:206:in `initialize' c:/ruby/lib/ruby/1.8/net/protocol.rb:206:in`old\_open’  
c:/ruby/lib/ruby/1.8/timeout.rb:56:in `timeout' c:/ruby/lib/ruby/1.8/timeout.rb:76:in`timeout’  
c:/ruby/lib/ruby/1.8/net/protocol.rb:206:in `old_open' c:/ruby/lib/ruby/1.8/net/smtp.rb:393:in`do\_start’  
c:/ruby/lib/ruby/1.8/net/smtp.rb:378:in `start' c:/ruby/lib/ruby/1.8/net/smtp.rb:316:in`start’  
c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.2.5/lib/  
action\_mailer/base.rb:511:in  
`perform_delivery_smtp' c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.2.5/lib/ action_mailer/base.rb:397:in`deliver!’  
c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.2.5/lib/  
action\_mailer/base.rb:291:in  
`method_missing' /app/controllers/staffing_details_controller.rb:129:in`report’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/  
action\_controller/base.rb:941:in  
`perform_action_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/ action_controller/filters.rb:368:in`perform\_action\_without\_benchmark’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/  
action\_controller/benchmarking.rb:69:in  
`perform_action_without_rescue' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in`measure’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/  
action\_controller/benchmarking.rb:69:in  
`perform_action_without_rescue' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/ action_controller/rescue.rb:82:in`perform\_action’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/  
action\_controller/base.rb:408:in  
`process_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/ action_controller/filters.rb:377:in`process\_without\_session\_management\_support’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/  
action\_controller/session\_management.rb:117:in  
`process' c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:in`dispatch’  
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webrick\_server.rb:  
115:in  
`handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webrick_server.rb: 81:in`service’  
c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in`run’  
c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in`start\_thread’  
c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in`start’  
c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in`start’  
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webrick\_server.rb:  
67:in  
`dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/commands/servers/ webrick.rb:59 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in`require’  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/  
active\_support/dependencies.rb:147:in  
`require' c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/commands/server.rb: 30 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in`require’  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/  
active\_support/dependencies.rb:147:in  
`require’  
c:/rails/cookbook/script/server:7

Rendering  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action\_controller/  
templates/rescues/layout.rhtml  
(500 Internal Error)

---

<div class="post-metadata">

**Author:** ![shankar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9a28c/32.png) [@shankar](https://www.ruby-forum.com/u/shankar)\
**Post date:** [August 11, 2008, 6:54pm UTC](https://www.ruby-forum.com/t/errno-ebadf-bad-file-descriptor-connect-2/145573/2 "2008-08-11T18:54:00Z")

</div>

Hello all,

This seems to have been resolved. There was a problem with the mail  
server which trigerred the problem.

~Titan.
