Can't connect to ZEO server on Solaris / Windows

Bug #1004513 reported by Thierry Florac
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
ZODB
Confirmed
Medium
Jim Fulton

Bug Description

Hi,

I'm using ZODB-3.10.5 with Python-2.7.3 on SunOS 5.10 for i386.

When trying to connect to a local ZEO server, I get an error:

>>> from ZEO import ClientStorage
>>> cs = ClientStorage.Storage(('localhost',8100), 'mystorage')
Exception in thread Connect([(2, ('localhost', 8100))]):
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/var/local/eggs/ZODB3-3.10.5-py2.7-solaris-2.10-i86pc.32bit.egg/ZEO/zrpc/client.py", line 390, in run
    success = self.try_connecting(attempt_timeout)
  File "/var/local/eggs/ZODB3-3.10.5-py2.7-solaris-2.10-i86pc.32bit.egg/ZEO/zrpc/client.py", line 414, in try_connecting
    wrappers = self._create_wrappers()
  File "/var/local/eggs/ZODB3-3.10.5-py2.7-solaris-2.10-i86pc.32bit.egg/ZEO/zrpc/client.py", line 456, in _create_wrappers
    for domain, addr in self._expand_addrlist():
  File "/var/local/eggs/ZODB3-3.10.5-py2.7-solaris-2.10-i86pc.32bit.egg/ZEO/zrpc/client.py", line 446, in _expand_addrlist
    ) in socket.getaddrinfo(host or 'localhost', port):
gaierror: [Errno 9] service name not available for the specified socket type

Actually, it seems that changing line 446 of ZEO/zrpc/client.py to:

   ) in socket.getaddrinfo(host or 'localhost', port, socket.AF_INET, socket.SOCK_STREAM):

solves the problem (at least on Solaris; I didn't checked on other platforms).

Regards,
Thierry

Revision history for this message
Thierry Florac (tflorac) wrote :

Little mistake...
Of course, the correct syntax in my example is "cs = ClientStorage.ClientStorage(('localhost',8100), 'mystorage')"

Regards,
Thierry

Revision history for this message
Tres Seaver (tseaver) wrote :

The attached patch against the 3.10 branch implements the change
Thierry described. All tests continue to pass

I can't think of an easy way to test it, given that we'd have to
stub out the guts of the socket module.

Changed in zodb:
assignee: nobody → Jim Fulton (jim-zope)
importance: Undecided → Medium
status: New → Confirmed
Lubomir Kostov (lkostov)
summary: - Can't connect to ZEO server on Solaris
+ Can't connect to ZEO server on Solaris / Windows
Revision history for this message
Lubomir Kostov (lkostov) wrote :

I have the same problem (can't connect to ZEO Server) using ZODB/ZEO 4.0 with Python 2.7.6 on Windows.

The proposed solution (changing line 446 of ZEO/zrpc/client.py) works for me, so why not incorporate the patch into the 4.0 release too?

- socket.getaddrinfo(host or 'localhost', port)
+ socket.getaddrinfo(host or 'localhost', port, 0, socket.SOCK_STREAM)

Revision history for this message
Jim Fulton (jim-zope) wrote :

Let's move the discussion here:

https://github.com/zopefoundation/ZEO/issues/8

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.