-
-
Notifications
You must be signed in to change notification settings - Fork 925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SMTP IOError: Network is unreachable on windows #4050
Comments
Perhaps you can try a newer build? JRuby 9.1.0.0 updated stdlib to Ruby 2.3 level, which might have fixed something. Do you have an unusual network configuration on that system? This is an odd thing to fail only on Windows. |
Apologies for the delay. I tried with jruby 9.1.2.0 (2.3.0) and get the same issue. There is nothing unusual about the network config as it works perfectly fine with MRI. $ jruby -v $ irb |
I don't have Windows handy at the moment...can you pass |
this may be obvious, but since you didn't metntion.. did you check your firewall and virus scanner config that they allow java to open smtp sessions? those would normally be blocked. |
I'll try to repro on Windows now that I have my VM working again. |
I was unable to reproduce on my Windows 7 VM :-(
We're willing to help you sort out the problem, but at the moment I have no way to reproduce what you're seeing. |
So it looks like an environment issues on my side then. I tried adding exceptions to the windows firewall for java (all tcp connections were already allowed) but that did not help. I'll keep digging around. |
@ranjithdharmaraj We'll close this for now. If you're able to determine it's a JRuby issue, feel free to reopen. |
@headius @mprins This was an IPv6 issue. I had to set the IPv4 (-J-Djava.net.preferIPv4Stack) option to true and it worked. Just thought will update the issue as it might be of help. Thanks for your help. $ jruby --dev -rnet/smtp -e "smtp = Net::SMTP.new('xxx.xxx.xxx.xxx', 25); smtp.start; puts smtp" $ jruby -J-Djava.net.preferIPv4Stack=true --dev -rnet/smtp -e "smtp = Net::SMTP.new('xxx.xxx.xxx.xxx', 25); smtp.start; puts smtp" |
@ranjithdharmaraj Thank you for the follow up! I'm glad to hear it was something simple and not JRuby's fault. I've added a FAQ about this: https://github.com/jruby/jruby/wiki/FAQs#networking |
Environment
JRuby 9.0.4.0 on windows 7:
$ jruby -v
jruby 9.0.4.0 (2.2.2) 2015-11-12 b9fb7aa Java HotSpot(TM) 64-Bit Server VM 25.91-b15 on 1.8.0_91-b15 +jit [Windows 7-amd64]
$ java -version
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)
$ rails -v
Rails 4.2.6
Expected Behavior
$ ruby -v
ruby 2.2.4p230 (2015-12-16 revision 53155) [x64-mingw32]
$ irb
irb(main):001:0> RUBY_DESCRIPTION
=> "ruby 2.2.4p230 (2015-12-16 revision 53155) [x64-mingw32]"
irb(main):002:0> require 'net/smtp'
=> true
irb(main):003:0> smtp = Net::SMTP.new("xx.xxx.xxx.xxx", 25)
=> #<Net::SMTP xx.xxx.xxx.xxx:25 started=false>
irb(main):004:0> smtp.start
=> #<Net::SMTP xx.xxx.xxx.xxx started=true>
irb(main):005:0> RUBY_PLATFORM
=> "x64-mingw32"
irb(main):006:0>
Actual Behavior
irb(main):002:0> require 'net/smtp'
=> true
irb(main):003:0> smtp = Net::SMTP.new("xx.xxx.xxx.xxx", 25)
=> #<Net::SMTP xx.xxx.xxx.xxx:25 started=false>
irb(main):004:0> smtp.start
IOError: Network is unreachable: no further information
from org/jruby/ext/socket/RubyTCPSocket.java:138:in
initialize' from org/jruby/RubyIO.java:1123:in
open'from C:/Rubies/jruby-9.0.4.0/lib/ruby/stdlib/net/smtp.rb:541:in
tcp_socket' from C:/Rubies/jruby-9.0.4.0/lib/ruby/stdlib/net/smtp.rb:551:in
block in do_start'from org/jruby/ext/timeout/Timeout.java:147:in
timeout' from C:/Rubies/jruby-9.0.4.0/lib/ruby/stdlib/net/smtp.rb:550:in
do_start'from C:/Rubies/jruby-9.0.4.0/lib/ruby/stdlib/net/smtp.rb:526:in
start' from (irb):4:in
'from org/jruby/RubyKernel.java:978:in
eval' from org/jruby/RubyKernel.java:1291:in
loop'from org/jruby/RubyKernel.java:1098:in
catch' from org/jruby/RubyKernel.java:1098:in
catch'from C:/Rubies/jruby-9.0.4.0/lib/ruby/gems/shared/gems/railties-4.2.6/lib/rails/commands/console.rb:110:in
start' from C:/Rubies/jruby-9.0.4.0/lib/ruby/gems/shared/gems/railties-4.2.6/lib/rails/commands/console.rb:9:in
start'from C:/Rubies/jruby-9.0.4.0/lib/ruby/gems/shared/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:68:in
console' from C:/Rubies/jruby-9.0.4.0/lib/ruby/gems/shared/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in
run_command!'from C:/Rubies/jruby-9.0.4.0/lib/ruby/gems/shared/gems/railties-4.2.6/lib/rails/commands.rb:17:in
<top>' from org/jruby/RubyKernel.java:939:in
require'from bin/rails:4:in `'irb(main):005:0>
The text was updated successfully, but these errors were encountered: