jina-ai / discoart

🪩 Create Disco Diffusion artworks in one line
Other
3.84k stars 249 forks source link

Message too large using websocket #119

Open KnoBuddy opened 2 years ago

KnoBuddy commented 2 years ago

I am getting this message when requesting the result from the DiscoArt service over websocket protocol. It was working until i increased the image size to 768x768.


  File "C:\Users\kyle\discoart\result.py", line 5, in <module>
    img = c.post('/result', parameters={'name_docarray': 'discobot'})
  File "C:\Users\kyle\anaconda3\envs\discoart\lib\site-packages\jina\clients\mixin.py", line 185, in post
    return run_async(
  File "C:\Users\kyle\anaconda3\envs\discoart\lib\site-packages\jina\helper.py", line 1323, in run_async
    return asyncio.run(func(*args, **kwargs))
  File "C:\Users\kyle\anaconda3\envs\discoart\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Users\kyle\anaconda3\envs\discoart\lib\asyncio\base_events.py", line 646, in run_until_complete
    return future.result()
  File "C:\Users\kyle\anaconda3\envs\discoart\lib\site-packages\jina\clients\mixin.py", line 176, in _get_results
    async for resp in c._get_results(*args, **kwargs):
  File "C:\Users\kyle\anaconda3\envs\discoart\lib\site-packages\jina\clients\base\websocket.py", line 188, in _get_results
    await receive_task
  File "C:\Users\kyle\anaconda3\envs\discoart\lib\site-packages\jina\clients\base\websocket.py", line 127, in _receive
    async for response in iolet.recv_message():
  File "C:\Users\kyle\anaconda3\envs\discoart\lib\site-packages\jina\clients\base\helper.py", line 202, in recv_message
    yield DataRequest(response.data)
  File "C:\Users\kyle\anaconda3\envs\discoart\lib\site-packages\jina\types\request\data.py", line 127, in __init__
    raise BadRequestType(
jina.excepts.BadRequestType: fail to construct a <class 'jina.types.request.data.DataRequest'> object from Message size 97259659 exceeds limit 4194304```
hanxiao commented 2 years ago

Thanks for reporting, looks like an upstream Jina issue, will transfer to Jina repo

KnoBuddy commented 2 years ago

Thanks for reporting, looks like an upstream Jina issue, will transfer to Jina repo

It was actually because I was not changing the name_docarray for each run as I assumed they were overwritten. Changing the name solves the issue, however is there any documentation on how to delete old docarrays from the client side, is that an implementation already within Jina I'm missing, or will I have to make my own implementation?

Thanks in advance for your help.

hanxiao commented 2 years ago

It was actually because I was not changing the name_docarray for each run as I assumed they were overwritten

it should be overwritten, anyway if changing the name solves the problem then it is not Jina's problem, moving ticket back to discoart