Repository navigation
Error: Response payload is not completed #574
Description
Activity
- addedAzurefor issues relating to the Azure OpenAI servicefor issues relating to the Azure OpenAI service
on Sep 6, 2023 Looks like this is a regression of a bug on openai servers: openai-php/laravel#36 and #399
@zzc0430 Did you fix this? I am running into the same issue on langchain using 3.5-turbo-16k where I have long input prompts of about 10-12k tokens, and see this error. I am not using streaming.
@zzc0430 Did you fix this? I am running into the same issue on langchain using 3.5-turbo-16k where I have long input prompts of about 10-12k tokens, and see this error. I am not using streaming.
@ShantanuNair Not yet, it looks like a server-side issue.
@zzc0430 What about this - aio-libs/aiohttp#4581 (comment) ?
I have a feeling this is potentially not the issue, but the issue is actually from session setting in the openai client.I may have narrowed it down, but could use your help debugging - What version of openai do you have installed with langchain when you run into this issue? Try upgrading and see if it's fixed?
@zzc0430 What about this - aio-libs/aiohttp#4581 (comment) ? I have a feeling this is potentially not the issue, but the issue is actually from session setting in the openai client.
I may have narrowed it down, but could use your help debugging - What version of openai do you have installed with langchain when you run into this issue? Try upgrading and see if it's fixed?
@ShantanuNair The version I'm using is 0.27.2, and I will try to update to 0.28.0, but it seems that this bug cannot be consistently reproduced.
@zzc0430 Let's do our best to find a root cause, if you do figure out a way to reproduce it let's work on it. I am trying to make sure I never see this again. Do you also see 502 errors Cloudflare bad_gateway much? My environment is modal.com Please let me know if this is at all similar for you, we may be able to narrow it down.
@zzc0430 Let's do our best to find a root cause, if you do figure out a way to reproduce it let's work on it. I am trying to make sure I never see this again. Do you also see 502 errors Cloudflare bad_gateway much? My environment is modal.com Please let me know if this is at all similar for you, we may be able to narrow it down.
Similarly, I've also encountered 502 errors.
Reacted by Shantanu Nair@zzc0430 Appreciate it!! I might be able to narrow this down. Can you provide a few details so I can check what we have in common?
- What environment are you running chains on? Local like macOS? Some compute provider like AWS Lambda/EC2 or Modal like in my case?
- Do you have the default retries (max_retries default is 6) or retries set for your chain? In that case, does your retry complete after a 502? In my case all further retries for that chain fails until my compute hits its timeout.
- Does the above mentioned retry run after the time it's supposed to? Mine says retry in 4/8s etc but ends up hanging for 6-7 minutes before running the retry! This could be related to your OP issue. I'm investigating potential causes in langchain lib and the openai-python client.
Really appreciate if you could help me out with these details.
Getting this on the latest openai-python version
Getting this on the latest openai-python version
@ShantanuNair Thanks, which commit fixed this issue?
@zzc0430 I meant to say it is still occurring on the latest version.
Reacted by zzcCan you try the beta of our upcoming v1.0.0 and let us know if the issue persists?
This should be fixed in v1.
- addedfixed in v1Issues addressed by the v1 betaIssues addressed by the v1 beta
on Nov 10, 2023 - added a commit that references this issue
on Mar 27, 2025 - added a commit that references this issue
on Apr 27, 2025
Describe the bug
When using the
acreateinterface and attempting to utilize streaming output, I encountered "aiohttp.client_exceptions.ClientPayloadError: Response payload is not completed"To Reproduce
Code snippets
OS
Linux
Python version
Python v3.9
Library version
openai-python v0.27.2