kfix / SleepProxyServer

mDNS (Bonjour) Sleep Proxy Server (python 2 implementation) for Mac OSX "Wake on Demand"
BSD 2-Clause "Simplified" License
31 stars 9 forks source link

Error with logging of SPS registration datagrams #5

Open jeremiahrex opened 5 years ago

jeremiahrex commented 5 years ago

When executing lines 177 and 208 of dnsserve.py the following error occurs:

Traceback (most recent call last):
  File "src/gevent/greenlet.py", line 766, in gevent._greenlet.Greenlet.run
  File "/home/jerry/.local/lib/python2.7/site-packages/gevent/baseserver.py", line 26, in _handle_and_close_when_done
    return handle(*args_tuple)
  File "/home/jerry/.local/lib/python2.7/site-packages/sleepproxy/dnsserve.py", line 187, in handle
    self._answer(raddress, message)
  File "/home/jerry/.local/lib/python2.7/site-packages/sleepproxy/dnsserve.py", line 208, in _answer
    logging.debug('RESPONSE--\n\n%s\n\n%s\n\n--RESPONSE END' % (response,response.options))
  File "/home/jerry/.local/lib/python2.7/site-packages/dns/message.py", line 122, in __str__
    return self.to_text()
  File "/home/jerry/.local/lib/python2.7/site-packages/dns/message.py", line 147, in to_text
    s.write(u'option %s\n' % opt.to_text())
AttributeError: 'UpdateLeaseOption' object has no attribute 'to_text'
2019-05-12T21:17:46Z <Greenlet at 0xb6af70b8L: _handle_and_close_when_done(<bound method SleepProxyServer.handle of <SleepPro, <bound method SleepProxyServer.do_close of <SleepP, ('Vc(\x00\x00\x00\x00\x00\x00\r\x00\x01\x0bmacbook)> failed with AttributeError

Running lubuntu 16.04.6 LTS on a Macmini G4.

kfix commented 5 years ago

I've run this on ARM and x86 but not PPC, and haven't been using it at all for some time. So no surprise that gevent internals have changed. I should have locked the versions down from when things did work.

Thanks for the report, but you might be in a better position to fix it then myself at the moment.

jeremiahrex commented 5 years ago

I suspect it's probably more due to the library versions moving on rather than the architecture. Do you know the versions you were using???