chrisrude / oobabot

A Discord bot which talks to Large Language Model AIs running on oobabooga's text-generation-webui
MIT License
101 stars 34 forks source link

set_options raise StableDiffusionClientError #42

Closed FellowChello closed 1 year ago

FellowChello commented 1 year ago

Hey, I finally completed a SD Webui install on my server and everything works as intended for the web. But, for some reason the bot is having issues with API: Traceback (most recent call last): File "C:\TCHT\oobabooga_windows\installer_files\env\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\TCHT\oobabooga_windows\installer_files\env\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\TCHT\oobabooga_windows\installer_files\env\Scripts\oobabot.exe__main__.py", line 7, in File "C:\TCHT\oobabooga_windows\installer_files\env\lib\site-packages\oobabot\oobabot.py", line 87, in main verify_client( File "C:\TCHT\oobabooga_windows\installer_files\env\lib\site-packages\oobabot\oobabot.py", line 35, in verify_client asyncio.run(try_setup(client)) File "C:\TCHT\oobabooga_windows\installer_files\env\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\TCHT\oobabooga_windows\installer_files\env\lib\asyncio\base_events.py", line 649, in run_until_complete return future.result() File "C:\TCHT\oobabooga_windows\installer_files\env\lib\site-packages\oobabot\oobabot.py", line 30, in try_setup await client.setup() File "C:\TCHT\oobabooga_windows\installer_files\env\lib\site-packages\oobabot\sd_client.py", line 273, in setup await self.set_options() File "C:\TCHT\oobabooga_windows\installer_files\env\lib\site-packages\oobabot\sd_client.py", line 135, in set_options raise StableDiffusionClientError(response) oobabot.sd_client.StableDiffusionClientError: <ClientResponse(http://192.168.100.85:7860/sdapi/v1/options) [500 Internal Server Error]> <CIMultiDictProxy('Date': 'Mon, 05 Jun 2023 01:58:06 GMT', 'Server': 'uvicorn', 'Content-Length': '172', 'Content-Type': 'application/json')>

I checked the server side and I see this:

image

chrisrude commented 1 year ago

Thanks for the bug report! I'm curious what version of oobabot you're running.

The reason I ask is that from the specific error message, it seems to be referencing code that's probably several weeks old now. If that's the case would you be up for upgrading and seeing if the problem persists? It may will still happen, but it will be easier for me to help track it down if it's from more recent code.

You might want to check out the release notes when upgrading: https://github.com/chrisrude/oobabot/tree/main/docs

Let me know if you're still seeing it!

FellowChello commented 1 year ago

I pulled the current version, now it connects but seems to error out on receiving the image:

←[33m2023-06-05 18:55:01,312←[0m DEBUG ←[36mStable Diffusion: Image request (nsfw: False): a dog in samurai armor←[0m ←[33m2023-06-05 18:55:07,931←[0m DEBUG ←[36mResponse to HelloI'mFellow done! tokens: 15, time: 6.42s, latency: 6.42s, rate: 2.34 tok/s←[0m Task exception was never retrieved future: <Task finished name='Task-38' coro=<ImageGenerator._generate_image() done, defined at C:\TCHT\oobabooga_windows\installer_files\env\lib\site-packages\oobabot\image_generator.py:194> exception=ServerTimeoutError('Timeout on reading data from socket')> Traceback (most recent call last): File "C:\TCHT\oobabooga_windows\installer_files\env\lib\site-packages\oobabot\image_generator.py", line 204, in _generate_image file = await image_task_to_file(image_task, image_prompt) File "C:\TCHT\oobabooga_windows\installer_files\env\lib\site-packages\oobabot\image_generator.py", line 16, in image_task_to_file await image_task File "C:\TCHT\oobabooga_windows\installer_files\env\lib\site-packages\oobabot\sd_client.py", line 234, in do_post_with_retry return await do_post() File "C:\TCHT\oobabooga_windows\installer_files\env\lib\site-packages\oobabot\sd_client.py", line 212, in do_post async with self.get_session().post( File "C:\TCHT\oobabooga_windows\installer_files\env\lib\site-packages\aiohttp\client.py", line 1141, in aenter self._resp = await self._coro File "C:\TCHT\oobabooga_windows\installer_files\env\lib\site-packages\aiohttp\client.py", line 560, in _request await resp.start(conn) File "C:\TCHT\oobabooga_windows\installer_files\env\lib\site-packages\aiohttp\client_reqrep.py", line 899, in start message, payload = await protocol.read() # type: ignore[union-attr] File "C:\TCHT\oobabooga_windows\installer_files\env\lib\site-packages\aiohttp\streams.py", line 616, in read await self._waiter aiohttp.client_exceptions.ServerTimeoutError: Timeout on reading data from socket ←[33m2023-06-05 18:55:55,020←[0m DEBUG ←[36mConsidering unsolicited message in channel 901309170249257017 after 54 seconds, with chance 120%.←[0m ←[33m2023-06-05 18:55:55,287←[0m DEBUG ←[36mFound image prompt: ?←[0m ←[33m2023-06-05 18:55:55,287←[0m DEBUG ←[36mRequest from HelloI'mFellow←[0m ←[33m2023-06-05 18:55:55,287←[0m DEBUG ←[36mStable Diffusion: Image request (nsfw: False): ?←[0m ←[33m2023-06-05 18:56:01,756←[0m DEBUG ←[36mRepetition count for channel 901309170249257017 is 1←[0m ←[33m2023-06-05 18:56:01,756←[0m WARNING ←[33mRepetition found, will throttle history for channel 901309170249257017 in next request←[0m ←[33m2023-06-05 18:56:01,756←[0m DEBUG ←[36mResponse to HelloI'mFellow done! tokens: 15, time: 6.20s, latency: 6.20s, rate: 2.42 tok/s←[0m Task exception was never retrieved future: <Task finished name='Task-52' coro=<ImageGenerator._generate_image() done, defined at C:\TCHT\oobabooga_windows\installer_files\env\lib\site-packages\oobabot\image_generator.py:194> exception=ServerTimeoutError('Timeout on reading data from socket')> Traceback (most recent call last): File "C:\TCHT\oobabooga_windows\installer_files\env\lib\site-packages\oobabot\image_generator.py", line 204, in _generate_image file = await image_task_to_file(image_task, image_prompt) File "C:\TCHT\oobabooga_windows\installer_files\env\lib\site-packages\oobabot\image_generator.py", line 16, in image_task_to_file await image_task File "C:\TCHT\oobabooga_windows\installer_files\env\lib\site-packages\oobabot\sd_client.py", line 234, in do_post_with_retry return await do_post() File "C:\TCHT\oobabooga_windows\installer_files\env\lib\site-packages\oobabot\sd_client.py", line 212, in do_post async with self.get_session().post( File "C:\TCHT\oobabooga_windows\installer_files\env\lib\site-packages\aiohttp\client.py", line 1141, in aenter self._resp = await self._coro File "C:\TCHT\oobabooga_windows\installer_files\env\lib\site-packages\aiohttp\client.py", line 560, in _request await resp.start(conn) File "C:\TCHT\oobabooga_windows\installer_files\env\lib\site-packages\aiohttp\client_reqrep.py", line 899, in start message, payload = await protocol.read() # type: ignore[union-attr] File "C:\TCHT\oobabooga_windows\installer_files\env\lib\site-packages\aiohttp\streams.py", line 616, in read await self._waiter aiohttp.client_exceptions.ServerTimeoutError: Timeout on reading data from socket ←[33m2023-06-05 18:56:09,592←[0m DEBUG ←[36mConsidering unsolicited message in channel 901309170249257017 after 69 seconds, with chance 70%.←[0m


I see that on the server the image was generated: image

chrisrude commented 1 year ago

What version is installed?

I'm asking since the log above was not generated from a recent version... from the line numbers, it would have to have been from v0.1.6 or earlier.

Versions that old had a bug where it would only wait 5 seconds for image generation before throwing this error, which is exactly what is happening in the logs you posted.

This was later fixed in this commit. I'm fairly optimistic that upgrading will solve the problem you're seeing. https://github.com/chrisrude/oobabot/commit/8b815362065f6370d7468783ea056cff0aaca440

FellowChello commented 1 year ago

Ahh man is there a good way to update the oobabot? I did a pull in a new location and launched it again from that location and looks like the 5 second limit is still there. I will try to update the SD file.

Just confirmed that the http_client.py file has sock_read=None However it does time out after 5 seconds. I may need to wipe out everything and start from fresh?


I think i found the one reference to 5 seconds that was still left. Thank you for all the help!

it now looks like re-try is having issues :D but ill see if I can just re-install everything. thank you