spesmilo / electrum-server

Electrum server
MIT License
300 stars 387 forks source link

TypeError while joining irc #153

Open reinefjord opened 8 years ago

reinefjord commented 8 years ago

The server produces an exception while trying to join irc:

Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/site-packages/electrumserver/ircthread.py", line 164, in run
    c = client.server().connect('irc.freenode.net', 6697, self.nick, self.password, ircname=self.ircname, connect_factory=ssl_factory)
  File "/usr/lib/python2.7/site-packages/irc/functools.py", line 35, in wrapper
    return method(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/irc/client.py", line 498, in connect
    self.socket = self.connect_factory(self.server_address)
  File "/usr/lib/python2.7/site-packages/irc/connection.py", line 55, in connect
    sock.bind(self.bind_address)
  File "/usr/lib/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
TypeError: getsockaddrarg: AF_INET address must be tuple, not NoneType
EagleTM commented 8 years ago

Which version of the python IRC module are you running? The current code works fine here with 14.0, maybe you have an earlier version which doesn't default to bind_address=None

Can you also try to set irc_bind_ip = in your electrum.conf for the server and see if that helps here?

In case earlier versions of the IRC module don't handle the None type we could work around by conditionally avoiding bind_address if bind_address is empty in ircthread.py: ssl_factory = irc.connection.Factory(wrapper=ssl.wrap_socket, bind_address=bind_address)

reinefjord commented 8 years ago

I'm using python irc version 11.0.1. Setting irc_bind_ip works.

EagleTM commented 8 years ago

Commit got reverted, needs re-writing to be compatible with irc < v14