Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.6.7
    • Fix Version/s: JRuby 1.7.0.pre1
    • Labels:
      None
    • Environment:
      Java 6; Tomcat 6; Windows 2003 R2
    • Number of attachments :
      0

      Description

      Upon trying to send an email through Rails Mailer, the following error occurs:

      SocketError (initialize: name or service not known):
        org/jruby/ext/socket/RubyTCPSocket.java:123:in `initialize'
        org/jruby/RubyIO.java:876:in `new'
        org/jruby/ext/socket/RubyTCPSocket.java:147:in `open'
        file:/lib/jruby-stdlib-1.6.7.2.jar!/META-INF/jruby.home/lib/ruby/1.8/net/smtp.rb:551:in `do_start'
        org/jruby/ext/Timeout.java:100:in `timeout'
        file:/lib/jruby-stdlib-1.6.7.2.jar!/META-INF/jruby.home/lib/ruby/1.8/net/smtp.rb:551:in `do_start'
        file:/lib/jruby-stdlib-1.6.7.2.jar!/META-INF/jruby.home/lib/ruby/1.8/net/smtp.rb:525:in `start'
        gems/gems/actionmailer-2.3.14/lib/action_mailer/base.rb:715:in `perform_delivery_smtp'
        org/jruby/RubyKernel.java:2080:in `send'
        gems/gems/actionmailer-2.3.14/lib/action_mailer/base.rb:556:in `deliver!'
        gems/gems/actionmailer-2.3.14/lib/action_mailer/base.rb:428:in `method_missing'
        app/controllers/account_controller.rb:36:in `forgot'
        org/jruby/RubyProc.java:270:in `call'
        org/jruby/RubyProc.java:220:in `call'
        gems/gems/actionpack-2.3.14/lib/action_controller/mime_responds.rb:135:in `custom'
        org/jruby/RubyProc.java:270:in `call'
        org/jruby/RubyProc.java:220:in `call'
        gems/gems/actionpack-2.3.14/lib/action_controller/mime_responds.rb:179:in `respond'
        org/jruby/RubyArray.java:1615:in `each'
        gems/gems/actionpack-2.3.14/lib/action_controller/mime_responds.rb:173:in `respond'
        gems/gems/actionpack-2.3.14/lib/action_controller/mime_responds.rb:107:in `respond_to'
        app/controllers/account_controller.rb:27:in `forgot'
        org/jruby/RubyKernel.java:2076:in `send'
        gems/gems/actionpack-2.3.14/lib/action_controller/base.rb:1333:in `perform_action'
        gems/gems/actionpack-2.3.14/lib/action_controller/filters.rb:617:in `call_filters'
        gems/gems/actionpack-2.3.14/lib/action_controller/filters.rb:610:in `perform_action_with_filters'
        gems/gems/actionpack-2.3.14/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark'
        gems/gems/actionpack-2.3.14/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark'
        gems/gems/actionpack-2.3.14/lib/action_controller/rescue.rb:160:in `perform_action_with_rescue'
        gems/gems/actionpack-2.3.14/lib/action_controller/flash.rb:151:in `perform_action_with_flash'
        org/jruby/RubyKernel.java:2076:in `send'
        gems/gems/actionpack-2.3.14/lib/action_controller/base.rb:532:in `process'
        gems/gems/actionpack-2.3.14/lib/action_controller/filters.rb:606:in `process_with_filters'
        gems/gems/actionpack-2.3.14/lib/action_controller/base.rb:391:in `process'
        gems/gems/actionpack-2.3.14/lib/action_controller/base.rb:386:in `call'
        gems/gems/actionpack-2.3.14/lib/action_controller/routing/route_set.rb:438:in `call'
        gems/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:87:in `dispatch'
        gems/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:121:in `_call'
        gems/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack'
        org/jruby/RubyProc.java:270:in `call'
        org/jruby/RubyProc.java:220:in `call'
        gems/gems/activerecord-2.3.14/lib/active_record/query_cache.rb:29:in `call'
        gems/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
        gems/gems/activerecord-2.3.14/lib/active_record/query_cache.rbin `cache'
        gems/gems/activerecord-2.3.14/lib/active_record/query_cache.rb:28:in `call'
        gems/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
        gems/gems/actionpack-2.3.14/lib/action_controller/string_coercion.rb:25:in `call'
        gems/gems/actionpack-2.3.14/lib/action_controller/params_parser.rb:15:in `call'
        gems/gems/actionpack-2.3.14/lib/action_controller/session/cookie_store.rb:99:in `call'
        gems/gems/actionpack-2.3.14/lib/action_controller/failsafe.rb:26:in `call'
        gems/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:106:in `call'
        file:/lib/gems-gems-jruby-rack-1.1.6-lib-jruby-rack-1.1.6.jar!/rack/adapter/rails.rb:34:in `serve_rails'
        file:/lib/gems-gems-jruby-rack-1.1.6-lib-jruby-rack-1.1.6.jar!/rack/adapter/rails.rb:39:in `call'
        file:/lib/gems-gems-jruby-rack-1.1.6-lib-jruby-rack-1.1.6.jar!/rack/handler/servlet.rb:21:in `call'
      

        Activity

        Hide
        Rafael Revi added a comment -

        Rails Version 2.3.14

        Show
        Rafael Revi added a comment - Rails Version 2.3.14
        Hide
        Charles Oliver Nutter added a comment -

        Not much for me to reproduce here. Can you add some logging before that line in smtp.rb and get the values of @address and @port? My guess is that @port is a service name and we're not properly translating that to a numeric port number, but I don't know how to trigger this.

        Show
        Charles Oliver Nutter added a comment - Not much for me to reproduce here. Can you add some logging before that line in smtp.rb and get the values of @address and @port? My guess is that @port is a service name and we're not properly translating that to a numeric port number, but I don't know how to trigger this.
        Hide
        Rafael Revi added a comment -

        Hey Charles,

        I would be more than glad to reproduce and provide more logging. So I added extra logging before line 551 like so:

        551: logging "Connection to be opened: #

        {@address}:#{@port}"
        552: s = timeout(@open_timeout) { TCPSocket.open(@address, @port) }
        553: logging "Connection opened: #{@address}

        :#

        {@port}

        "

        Where does logging print out to? I modified the app's config.log_level to debug in config/environments/production.rb but still am not seeing the logging from smtp.rb.

        Thanks for helping.

        Show
        Rafael Revi added a comment - Hey Charles, I would be more than glad to reproduce and provide more logging. So I added extra logging before line 551 like so: 551: logging "Connection to be opened: # {@address}:#{@port}" 552: s = timeout(@open_timeout) { TCPSocket.open(@address, @port) } 553: logging "Connection opened: #{@address} :# {@port} " Where does logging print out to? I modified the app's config.log_level to debug in config/environments/production.rb but still am not seeing the logging from smtp.rb. Thanks for helping.
        Hide
        Charles Oliver Nutter added a comment -

        I'm afraid I don't know the answer to that question You might also try $stderr.puts to try to force output to show up in the application's console or console logs.

        Show
        Charles Oliver Nutter added a comment - I'm afraid I don't know the answer to that question You might also try $stderr.puts to try to force output to show up in the application's console or console logs.
        Hide
        Rafael Revi added a comment -

        using $stderr.puts i got: Connection to be opened: smtp.bizmail.yahoo.com:25 in tomcat stdout.log

        Show
        Rafael Revi added a comment - using $stderr.puts i got: Connection to be opened: smtp.bizmail.yahoo.com:25 in tomcat stdout.log
        Hide
        Charles Oliver Nutter added a comment -

        I'm going to call this resolved in 1.7.0.pre1. Reopen if that's not the case.

        I suspect that the port (25) is being passed in as a String and 1.6.7 isn't properly converting it to a real port number. 1.7.0 had a complete cleanup and rewrite of the socket subsystem in JRuby, and it's much more consistent now.

        Show
        Charles Oliver Nutter added a comment - I'm going to call this resolved in 1.7.0.pre1. Reopen if that's not the case. I suspect that the port (25) is being passed in as a String and 1.6.7 isn't properly converting it to a real port number. 1.7.0 had a complete cleanup and rewrite of the socket subsystem in JRuby, and it's much more consistent now.

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Rafael Revi
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: