Skip to content

使用较大的图片制作gif表情时会遇见Client error '413 Payload Too Large' #21

@PacifierMC

Description

@PacifierMC

使用的版本为meme-generator-rs v0.2.1 和 nonebot-plugin-memes-api v0.5.1
06-19 21:06:15 [ERROR] nonebot | Running AlconnaMatcher(type='', module=zhenxun.plugins.nonebot_plugin_memes_api.matchers.command, lineno=261) failed.
Traceback (most recent call last):
File "E:\nonebot\bot.py", line 28, in
nonebot.run()
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-xe22MBs--py3.10\lib\site-packages\nonebot_init_.py", line 337, in run
get_driver().run(*args, **kwargs)
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-xe22MBs--py3.10\lib\site-packages\nonebot\drivers\fastapi.py", line 187, in run
uvicorn.run(
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-xe22MBs--py3.10\lib\site-packages\uvicorn\main.py", line 579, in run
server.run()
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-xe22MBs--py3.10\lib\site-packages\uvicorn\server.py", line 66, in run
return asyncio.run(self.serve(sockets=sockets))
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 636, in run_until_complete
self.run_forever()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\windows_events.py", line 321, in run_forever
super().run_forever()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 603, in run_forever
self._run_once()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1909, in _run_once
handle._run()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-xe22MBs--py3.10\lib\site-packages\nonebot\utils.py", line 254, in run_coro_with_shield
return await coro
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-xe22MBs--py3.10\lib\site-packages\nonebot\message.py", line 506, in check_and_run_matcher
await _run_matcher(

File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-xe22MBs--py3.10\lib\site-packages\nonebot\message.py", line 458, in run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-xe22MBs--py3.10\lib\site-packages\nonebot\internal\matcher\matcher.py", line 926, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-xe22MBs--py3.10\lib\site-packages\nonebot\internal\matcher\matcher.py", line 863, in simple_run
await handler(
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-xe22MBs--py3.10\lib\site-packages\nonebot\dependencies_init
.py", line 113, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "E:\nonebot\zhenxun\plugins\nonebot_plugin_memes_api\matchers\command.py", line 462, in handler
await process(bot, event, state, matcher, session, meme, images, texts, options)
File "E:\nonebot\zhenxun\plugins\nonebot_plugin_memes_api\matchers\command.py", line 93, in process
result = await meme.generate(meme_images, texts, options)
File "E:\nonebot\zhenxun\plugins\nonebot_plugin_memes_api\api_init_.py", line 289, in generate
return await generate_meme(self.key, images, texts, options)
File "E:\nonebot\zhenxun\plugins\nonebot_plugin_memes_api\api_init_.py", line 263, in generate_meme
image_id = await upload_image(image.data)
File "E:\nonebot\zhenxun\plugins\nonebot_plugin_memes_api\api_init_.py", line 133, in upload_image
ImageResponse, await send_request("/image/upload", "POST", "JSON", json=payload)
File "E:\nonebot\zhenxun\plugins\nonebot_plugin_memes_api\api_init_.py", line 118, in send_request
resp.raise_for_status()
File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-xe22MBs--py3.10\lib\site-packages\httpx_models.py", line 749, in raise_for_status
raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '413 Payload Too Large' for url 'http://127.0.0.1:2233/image/upload'
For more information check: https://httpstatuses.com/413

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions