Can't send email when I deploy with Capistrano

29 views
Skip to first unread message

Jake Scruggs

unread,
Jun 22, 2009, 10:23:35 AM6/22/09
to Capistrano
But I can when I start the server myself...

My team has started a Rails 2.3.2 application and we're having a
problem sending email. When I deploy the application (to a macbook
pro, for now, with osx 10.5) then I get this error when the
application tries to send the user an email:

SocketError (getaddrinfo: Temporary failure in name resolution):
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/net/protocol.rb:206:in `initialize'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/net/protocol.rb:206:in `new'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/net/protocol.rb:206:in `old_open'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/timeout.rb:56:in `timeout'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/timeout.rb:76:in `timeout'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/net/protocol.rb:206:in `old_open'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/net/smtp.rb:393:in `do_start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/net/smtp.rb:378:in `start'
app/models/user.rb:85:in `send_forgot_password_token'
app/controllers/user_tokens_controller.rb:9:in `create'
haml (2.0.9) rails/./lib/sass/plugin/rails.rb:19:in `process'

Although occasionally I get this error instead:

ArgumentError (can't find user for 504):
/Library/Ruby/Site/1.8/rubygems.rb:723:in `getpwuid'
/Library/Ruby/Site/1.8/rubygems.rb:723:in `set_paths'
/Library/Ruby/Site/1.8/rubygems.rb:719:in `each'
/Library/Ruby/Site/1.8/rubygems.rb:719:in `set_paths'
/Library/Ruby/Site/1.8/rubygems.rb:526:in `path'
haml (2.0.9) lib/sass/plugin/rails.rb:19:in `process'


But here's the really weird thing -- If I stop the server that was
started by Capistrano and then restart it by ssh-ing into the box and
pasting the exact command that cap runs:

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby /
usr/bin/mongrel_rails start -e qa -c /Users/mx/apps/mx_qa/current -d -
p 3001

Everything works fine and emails are sent with no problem. The
problem only occurs when I deploy with cap.

Which is really weird because cap is logging in as the same user as I
am when I ssh.

any ideas?

Thanks for a cool piece of open source, btw,
-Jake Scruggs

Jake Scruggs

unread,
Jun 22, 2009, 9:23:50 PM6/22/09
to Capistrano
I forgot to mention we are using 
capistrano 2.5.5, capistrano-ext 1.2.1, and Ruby 1.8.6p114

-Jake
Reply all
Reply to author
Forward
0 new messages