Can you please add "print response.__repr__()" to line /usr/share/electrum-server/transports/stratum_tcp.py, line 30?
It is now:
data = json.dumps(response) + "\n"
Should be:
print response.__repr__()
data = json.dumps(response) + "\n"
This will give us some info what information is server trying to serialize...