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

httpx.ReadTimeout: The read operation timed out #510

Open
ishaqmahsud opened this issue Jul 28, 2023 · 3 comments
Open

httpx.ReadTimeout: The read operation timed out #510

ishaqmahsud opened this issue Jul 28, 2023 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@ishaqmahsud
Copy link

ishaqmahsud commented Jul 28, 2023

Describe the bug
to call vector search on 73k records supabase (python) failed due timeout error. please put option developer can increase or decrease timeout according situation. otherwise python library not worthful.

To Reproduce
the error can be produce to make embedding to search in huge records about 73k.

Expected behavior
i need to increate the timeout for the rpc method so it can easily with failed.
in JavaScript its working where it can takes 25 to 30 secs in python it failed.

Screenshots
Traceback (most recent call last):
File "F:\fielder\textkernelfunc\Lib\site-packages\httpx_transports\default.py", line 60, in map_httpcore_exceptions
yield
File "F:\fielder\textkernelfunc\Lib\site-packages\httpx_transports\default.py", line 218, in handle_request
resp = self._pool.handle_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\fielder\textkernelfunc\Lib\site-packages\httpcore_sync\connection_pool.py", line 253, in handle_request
raise exc
File "F:\fielder\textkernelfunc\Lib\site-packages\httpcore_sync\connection_pool.py", line 237, in handle_request
response = connection.handle_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\fielder\textkernelfunc\Lib\site-packages\httpcore_sync\connection.py", line 90, in handle_request
return self._connection.handle_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\fielder\textkernelfunc\Lib\site-packages\httpcore_sync\http11.py", line 112, in handle_request
raise exc
File "F:\fielder\textkernelfunc\Lib\site-packages\httpcore_sync\http11.py", line 91, in handle_request
) = self._receive_response_headers(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\fielder\textkernelfunc\Lib\site-packages\httpcore_sync\http11.py", line 155, in _receive_response_headers
event = self._receive_event(timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\fielder\textkernelfunc\Lib\site-packages\httpcore_sync\http11.py", line 191, in _receive_event
data = self._network_stream.read(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\fielder\textkernelfunc\Lib\site-packages\httpcore\backends\sync.py", line 26, in read
with map_exceptions(exc_map):
File "C:\Users\ishaq\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 155, in exit
self.gen.throw(typ, value, traceback)
File "F:\fielder\textkernelfunc\Lib\site-packages\httpcore_exceptions.py", line 14, in map_exceptions
raise to_exc(exc)
httpcore.ReadTimeout: The read operation timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "F:\fielder\textkernelfunc\dbhelper.py", line 249, in
rs = asyncio.run(job.getTopJobsByCV(tk_res['documentText']))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ishaq\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Users\ishaq\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ishaq\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "F:\fielder\textkernelfunc\dbhelper.py", line 239, in getTopJobsByCV
response = self.connection.rpc('match_jobs', rpc_params).execute()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\fielder\textkernelfunc\Lib\site-packages\postgrest_sync\request_builder.py", line 55, in execute
r = self.session.request(
^^^^^^^^^^^^^^^^^^^^^
File "F:\fielder\textkernelfunc\Lib\site-packages\httpx_client.py", line 821, in request
return self.send(request, auth=auth, follow_redirects=follow_redirects)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\fielder\textkernelfunc\Lib\site-packages\httpx_client.py", line 908, in send
response = self._send_handling_auth(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\fielder\textkernelfunc\Lib\site-packages\httpx_client.py", line 936, in _send_handling_auth
response = self._send_handling_redirects(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\fielder\textkernelfunc\Lib\site-packages\httpx_client.py", line 973, in _send_handling_redirects
response = self._send_single_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\fielder\textkernelfunc\Lib\site-packages\httpx_client.py", line 1009, in _send_single_request
response = transport.handle_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\fielder\textkernelfunc\Lib\site-packages\httpx_transports\default.py", line 217, in handle_request
with map_httpcore_exceptions():
File "C:\Users\ishaq\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 155, in exit
self.gen.throw(typ, value, traceback)
File "F:\fielder\textkernelfunc\Lib\site-packages\httpx_transports\default.py", line 77, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ReadTimeout: The read operation timed out

Desktop (please complete the following information):

  • windows 10
    -vs code
  • python 3.11
@macrochel
Copy link

from supabase import create_client, Client
from supabase.lib.client_options import ClientOptions

client_options = ClientOptions(postgrest_client_timeout=None)
supabase: Client = create_client(url, key, options=client_options)

@J0 J0 added the documentation Improvements or additions to documentation label Sep 15, 2023
@m3hari
Copy link

m3hari commented Nov 24, 2023

+1
Supabse starts throwing this error out of nowhere; we don't have any change. Maybe the size of the table is affecting

@git-shogg
Copy link

from supabase import create_client, Client
from supabase.lib.client_options import ClientOptions

client_options = ClientOptions(postgrest_client_timeout=None)
supabase: Client = create_client(url, key, options=client_options)

For the above workaround I am receiving the error below:
TypeError: ClientOptions.__init__() got an unexpected keyword argument 'DEFAULT_POSTGREST_CLIENT_TIMEOUT'

Any ideas on this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

5 participants