Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChunkEncodingError #376

Closed
tontech opened this issue Dec 20, 2022 · 3 comments
Closed

ChunkEncodingError #376

tontech opened this issue Dec 20, 2022 · 3 comments

Comments

@tontech
Copy link

tontech commented Dec 20, 2022

Describe the bug

Got chunkencoding error when the calling post_partition_find with limit 200
To Reproduce

calling post_partition_find when database got bigger
Expected behavior

Screenshots

response = self.send(request, **kwargs)
File "/home/tonio/tm/thepack/fastapi/main/virtualenv/lib/python3.9/site-packages/ibm_cloud_sdk_core/base_service.py", line 308, in send
response = self.http_client.request(**request,
File "/home/tonio/tm/thepack/fastapi/main/virtualenv/lib/python3.9/site-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "/home/tonio/tm/thepack/fastapi/main/virtualenv/lib/python3.9/site-packages/requests/sessions.py", line 745, in send
r.content
File "/home/tonio/tm/thepack/fastapi/main/virtualenv/lib/python3.9/site-packages/requests/models.py", line 899, in content
self._content = b"".join(self.iter_content(CONTENT_CHUNK_SIZE)) or b""
File "/home/tonio/tm/thepack/fastapi/main/virtualenv/lib/python3.9/site-packages/requests/models.py", line 818, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read))

Must gather (please complete the following information):

  • SDK Version [e.g. 1.2.1]
  • Python Version [e.g. Python 3.7]
  • Name of service that you're trying to use (if applicable)
  • Name of operation that you're trying to invoke (if applicable)
    Python3.9
    ibmcloudant 0.3.1

Additional context

@eiri
Copy link
Member

eiri commented Dec 21, 2022

It seems that you've got an empty response from the server. You can try to tweak automatic retries option if that's an intermittent issue or tune timeouts to alleviate that.

For troubleshooting try to access the end-point POST /{db}/_partition/{partition_key}/_find with curl with your query to see what is the response you are getting from your server. A guess would be that since you've mentioned your database has grown your are facing a timeout on not optimized index. Try to run POST /{db}/_partition/{partition_id}/_explain and see if you can improve your query.

@rnewson
Copy link

rnewson commented Jan 5, 2023

We've submitted a pull request upstream to provide a better error message in this case: urllib3/urllib3#2860

@ricellis
Copy link
Member

ricellis commented Feb 6, 2023

Closing as stale, let us know if you have more problems with this.

@ricellis ricellis closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants