Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > DRb Problems with Mac OS X 10.5.3

Reply
Thread Tools

DRb Problems with Mac OS X 10.5.3

 
 
Kurt Schrader
Guest
Posts: n/a
 
      05-28-2008
It looks like the Mac OS X 10.5.3 upgrade breaks DRb when it's trying to
open a TCPSocket.

Looking into it now, but be warned:

/opt/local/lib/ruby/1.8/drb/drb.rb:865:in `initialize': getaddrinfo:
nodename nor servname provided, or not known (SocketError)
from /opt/local/lib/ruby/1.8/drb/drb.rb:865:in `open'
from /opt/local/lib/ruby/1.8/drb/drb.rb:865:in `open_server'

-Kurt
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Eric Ly
Guest
Posts: n/a
 
      05-28-2008
I'm running into the same problem too having just upgraded. Is there a
solution?


Eric

Kurt Schrader wrote:
> It looks like the Mac OS X 10.5.3 upgrade breaks DRb when it's trying to
> open a TCPSocket.
>
> Looking into it now, but be warned:
>
> /opt/local/lib/ruby/1.8/drb/drb.rb:865:in `initialize': getaddrinfo:
> nodename nor servname provided, or not known (SocketError)
> from /opt/local/lib/ruby/1.8/drb/drb.rb:865:in `open'
> from /opt/local/lib/ruby/1.8/drb/drb.rb:865:in `open_server'
>
> -Kurt


--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Kurt Schrader
Guest
Posts: n/a
 
      05-29-2008
No solution yet, but it looks like something has changed in some
underlying networking library, as base socket handing methods seem to be
broken:

[kschrader@einstein:~]$ irb
>> require 'socket'

=> true
>> Socket.getaddrinfo(Socket.gethostname, 0, Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME)

SocketError: getaddrinfo: nodename nor servname provided, or not known
from (irb):2:in `getaddrinfo'
from (irb):2
>>



Eric Ly wrote:
> I'm running into the same problem too having just upgraded. Is there a
> solution?
>
>
> Eric
>
> Kurt Schrader wrote:
>> It looks like the Mac OS X 10.5.3 upgrade breaks DRb when it's trying to
>> open a TCPSocket.
>>
>> Looking into it now, but be warned:
>>
>> /opt/local/lib/ruby/1.8/drb/drb.rb:865:in `initialize': getaddrinfo:
>> nodename nor servname provided, or not known (SocketError)
>> from /opt/local/lib/ruby/1.8/drb/drb.rb:865:in `open'
>> from /opt/local/lib/ruby/1.8/drb/drb.rb:865:in `open_server'
>>
>> -Kurt


--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Jeff Sidlosky
Guest
Posts: n/a
 
      05-29-2008
Kurt Schrader wrote:
> No solution yet, but it looks like something has changed in some
> underlying networking library, as base socket handing methods seem to be
> broken:
>



Damn, I need a fix bad -- Either that or I'm re-installing my entire OS
X machine to get rid of 10.5.3.

I'll help anyway I can, but I'm not good with the underlyings.

Please let us know as soon as you find something.
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Andy Keep
Guest
Posts: n/a
 
      05-29-2008
I've not done too much Ruby socket programming, but it seems to be that
it doesn't like 0 as a service number, because it is interpreting it as
the real service 0, instead of the empty service... if you use nil
instead it works fine... you might be able to patch dRb to use that as a
work around.


irb(main):001:0> require 'socket'
=> true
irb(main):011:0> Socket.getaddrinfo(Socket.gethostname, 0,
Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME)
SocketError: getaddrinfo: nodename nor servname provided, or not known
from (irb):11:in `getaddrinfo'
from (irb):11
from :0
irb(main):012:0> Socket.getaddrinfo(Socket.gethostname, nil,
Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME)
=> [["AF_INET", 0, "192.168.1.95", "192.168.1.95", 2, 1, 6]]


Kurt Schrader wrote:
> No solution yet, but it looks like something has changed in some
> underlying networking library, as base socket handing methods seem to be
> broken:
>
> [kschrader@einstein:~]$ irb
>>> require 'socket'

> => true
>>> Socket.getaddrinfo(Socket.gethostname, 0, Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME)

> SocketError: getaddrinfo: nodename nor servname provided, or not known
> from (irb):2:in `getaddrinfo'
> from (irb):2
>>>

>
>
> Eric Ly wrote:
>> I'm running into the same problem too having just upgraded. Is there a
>> solution?
>>
>>
>> Eric
>>
>> Kurt Schrader wrote:
>>> It looks like the Mac OS X 10.5.3 upgrade breaks DRb when it's trying to
>>> open a TCPSocket.
>>>
>>> Looking into it now, but be warned:
>>>
>>> /opt/local/lib/ruby/1.8/drb/drb.rb:865:in `initialize': getaddrinfo:
>>> nodename nor servname provided, or not known (SocketError)
>>> from /opt/local/lib/ruby/1.8/drb/drb.rb:865:in `open'
>>> from /opt/local/lib/ruby/1.8/drb/drb.rb:865:in `open_server'
>>>
>>> -Kurt


--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Laurent Sansonetti
Guest
Posts: n/a
 
      05-29-2008
Thanks for the report, we are of course very sorry about that. Ruby
didn't change in Mac OS X 10.5.3, so we are currently investigating
possible regressions in the underlying frameworks. We will let you
know.

Following Andy's idea, what about the following as a temporary fix?
Seems to work for DRb servers with a port of 0 (which seems to be the
default). Apparently DRb servers which explicitly bind to a non 0 port
are not affected by this regression.

class DRb:RbTCPSocket
class << self
alias parse_uri_orig parse_uri
def parse_uri(*args)
ary = parse_uri_orig(*args)
ary[1] = nil if ary[1] == 0
ary
end
end
end

Laurent

On Wed, May 28, 2008 at 10:11 PM, Andy Keep <> wrote:
> I've not done too much Ruby socket programming, but it seems to be that
> it doesn't like 0 as a service number, because it is interpreting it as
> the real service 0, instead of the empty service... if you use nil
> instead it works fine... you might be able to patch dRb to use that as a
> work around.
>
>
> irb(main):001:0> require 'socket'
> => true
> irb(main):011:0> Socket.getaddrinfo(Socket.gethostname, 0,
> Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME)
> SocketError: getaddrinfo: nodename nor servname provided, or not known
> from (irb):11:in `getaddrinfo'
> from (irb):11
> from :0
> irb(main):012:0> Socket.getaddrinfo(Socket.gethostname, nil,
> Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME)
> => [["AF_INET", 0, "192.168.1.95", "192.168.1.95", 2, 1, 6]]
>
>
> Kurt Schrader wrote:
>> No solution yet, but it looks like something has changed in some
>> underlying networking library, as base socket handing methods seem to be
>> broken:
>>
>> [kschrader@einstein:~]$ irb
>>>> require 'socket'

>> => true
>>>> Socket.getaddrinfo(Socket.gethostname, 0, Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME)

>> SocketError: getaddrinfo: nodename nor servname provided, or not known
>> from (irb):2:in `getaddrinfo'
>> from (irb):2
>>>>

>>
>>
>> Eric Ly wrote:
>>> I'm running into the same problem too having just upgraded. Is there a
>>> solution?
>>>
>>>
>>> Eric
>>>
>>> Kurt Schrader wrote:
>>>> It looks like the Mac OS X 10.5.3 upgrade breaks DRb when it's trying to
>>>> open a TCPSocket.
>>>>
>>>> Looking into it now, but be warned:
>>>>
>>>> /opt/local/lib/ruby/1.8/drb/drb.rb:865:in `initialize': getaddrinfo:
>>>> nodename nor servname provided, or not known (SocketError)
>>>> from /opt/local/lib/ruby/1.8/drb/drb.rb:865:in `open'
>>>> from /opt/local/lib/ruby/1.8/drb/drb.rb:865:in `open_server'
>>>>
>>>> -Kurt

>
> --
> Posted via http://www.ruby-forum.com/.
>
>


 
Reply With Quote
 
Kurt Schrader
Guest
Posts: n/a
 
      05-29-2008
Laurent,

That seems to work for now. Thanks for looking into it.

-Kurt

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Jeff Sidlosky
Guest
Posts: n/a
 
      05-29-2008
Laurent Sansonetti wrote:
> class DRb:RbTCPSocket
> class << self
> alias parse_uri_orig parse_uri
> def parse_uri(*args)
> ary = parse_uri_orig(*args)
> ary[1] = nil if ary[1] == 0
> ary
> end
> end
> end


Where does this wonderful piece of code go?
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Blaz Rubi
Guest
Posts: n/a
 
      05-29-2008
I put this just before "Rails::Initializer.run(:set_load_path)" in
config/boot.rb

=======
# HACK
require 'drb'
class DRb:RbTCPSocket
class << self
alias parse_uri_orig parse_uri
def parse_uri(*args)
ary = parse_uri_orig(*args)
ary[1] = nil if ary[1] == 0
ary
end
end
end
=======
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Lorgio Jimenez
Guest
Posts: n/a
 
      05-29-2008
Blaz Rubi wrote:
> I put this just before "Rails::Initializer.run(:set_load_path)" in
> config/boot.rb
>
> =======
> # HACK
> require 'drb'
> class DRb:RbTCPSocket
> class << self
> alias parse_uri_orig parse_uri
> def parse_uri(*args)
> ary = parse_uri_orig(*args)
> ary[1] = nil if ary[1] == 0
> ary
> end
> end
> end
> =======


Anyone else get errors from inserting this code?

if you place it in the LINE before
"Rails::Initializer.run(:set_load_path)" I got a syntax error

script/server:2:in `require': ./script/../config/boot.rb:41: class
definition in method body (SyntaxError)
from script/server:2

which makes sense.


if you place it outside of the Boot Class you get a SystemStackError

/script/../config/boot.rb:43:in `parse_uri_orig': stack level too deep
(SystemStackError)
from ./script/../config/boot.rb:43:in `parse_uri_orig'
from /Users/lorgio/Sites/gawkk/config/boot.rb:43:in `parse_uri'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/drb/drb.rb:874:in
`uri_option'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/drb/drb.rb:780:in
`uri_option'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/drb/drb.rb:778:in
`each'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/drb/drb.rb:778:in
`uri_option'
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/drb/drb.rb:1044:in
`initialize'
from
/Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session/drb_store.rb:8:in
`new'
... 51 levels...
from /Library/Ruby/Gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'
from script/server:3


Anyone get this working?
Am I placing this in the wrong place? or is there something I missed?
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DRB: can't run subshell in drb server? Ittay Dror Ruby 1 10-21-2008 11:28 AM
DRb connection error with more than 250+ DRb services J. Wook Ruby 16 05-16-2007 11:32 AM
make test-all fails in test/drb on Mac OS X G B-) Ruby 1 02-15-2006 07:56 AM
More DRb; SSL & DRB & errors Kirk Haines Ruby 0 07-01-2005 06:29 PM
DRb / dRuby - freezes on DRb::DRbUndumped - any ideas? Miles Keaton Ruby 3 03-30-2005 03:37 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57