aiorpc icon indicating copy to clipboard operation
aiorpc copied to clipboard

Logs Filled with 'Timeout when _send_error 'NoneType' object has no attr...'

Open TorKallon opened this issue 6 years ago • 6 comments

I have been trying this library out, and it seems perfect for what we need.

However, whenever a client calls any function on the servers the logs are filled with the following error:

ERROR:aiorpc.aiorpc.server:Exception object of type 'NoneType' has no len() raised when _parse_request None
2018-05-23 15:26:14,108 aiorpc.aiorpc.server ERROR    Timeout when _send_error 'NoneType' object has no attribute '__call__' to ('127.0.0.1', 62243)
ERROR:aiorpc.aiorpc.server:Timeout when _send_error 'NoneType' object has no attribute '__call__' to ('127.0.0.1', 62243)

I get many of those entries every second.

Any idea what's wrong?

TorKallon avatar May 23 '18 22:05 TorKallon

Could you please try to change https://github.com/choleraehyq/aiorpc/blob/master/aiorpc/log.py#L10 to set log level to DEBUG to print more logs?

choleraehyq avatar May 24 '18 10:05 choleraehyq

Or can you upload a example for me to reproduce this error?

choleraehyq avatar May 24 '18 10:05 choleraehyq

Can confirm, using examples in the readme. Here is the log with DEBUG level: https://pastebin.com/YXG8EqWd

Python 3.6.5 aiorpc 0.1.3 uvloop 0.9.1 msgpack-python 0.5.6

Shivelight avatar Jun 10 '18 05:06 Shivelight

Sorry for my late response. It seems there's something wrong with serialization or deserialization, as the first abnormal log is

2018-06-10 13:19:43,754 aiorpc.aiorpc.connection DEBUG    sending raw_req b'\x94\x01\xff\xb0Invalid protocol\xc0' to ('127.0.0.1', 37432)

But I cannot reproduce this error in my own environment.

choleraehyq avatar Jul 15 '18 10:07 choleraehyq

Part of the error messages seemed to be coming out of the flow handling in the server method where the iteration in the loop with a bad request received isn't skipped to start receiving a new request which could be possibly better formed. Put in a pull request #3 to improve the flow handling on erroneous request

kathiresan-jayabalan avatar Aug 22 '18 14:08 kathiresan-jayabalan

Hi! I've got same issue when making call from Django view function to server. Don't forget to close the loop on client after client.close()!!

def make_request(request):
    loop = uvloop.new_event_loop()
    asyncio.set_event_loop(loop)
    client = RPCClient('127.0.0.1', 6000, timeout=10)
    try:
        result = loop.run_until_complete(do(client))
    finally:
        client.close()
    loop.close()
    return HttpResponse(result)

RANUX avatar Feb 04 '20 10:02 RANUX