Skip to content

setting timeout parameter does not change timeout #376

New issue

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

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

Already on GitHub? # to your account

Closed
mohnish7 opened this issue Feb 15, 2023 · 19 comments
Closed

setting timeout parameter does not change timeout #376

mohnish7 opened this issue Feb 15, 2023 · 19 comments

Comments

@mohnish7
Copy link
Contributor

Describe the bug
Despite setting a timeout parameter in clientOptions, the query still times out in 5 seconds

To Reproduce

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

client_options = ClientOptions(timeout=60)
supabase = create_client(SUPABASE_URL, SUPABASE_ANON_KEY, options=client_options)

Expected behavior
The function should now time out after 60 seconds

Screenshots
If applicable, add screenshots to help explain your problem.
Screen Shot 2023-02-15 at 2 04 18 PM

Additional context
I am running Supabase version 1.0.0

@J0
Copy link
Contributor

J0 commented Feb 17, 2023

Hey @mohnish7,

The timeout param currently isn't being passed through - a fix was made but hasn't been published. I'll release it sometime this weekend - feel free to bump if you need it sooner

@dschnabel
Copy link

As per my comment the fix didn't seem to work for me. Does it work for others?

@J0
Copy link
Contributor

J0 commented Feb 17, 2023

Hey @dschnabel,

Just seeing this- it’s currently being passed to the postgrest client which may be why the fix doesn’t work out on # calls. I’ll see if I can pass it into the Auth client as well.

@mohnish7
Copy link
Contributor Author

Hey @J0 were you able to successfully release this fix last weekend?

@mohnish7
Copy link
Contributor Author

mohnish7 commented Mar 3, 2023

Hey @J0 following up again!

@J0
Copy link
Contributor

J0 commented Mar 4, 2023

Hey @mohnish7,

Thanks for the tag, so sorry didn't realize I missed this - wasn't able to get around to it but it's on my todo list for this week

@rotemCyberillium
Copy link

Hey @J0

I'm dealing with the the same problem..

@enjalot
Copy link

enjalot commented Apr 25, 2023

I'm also dealing with this issue

@jon-qualifai
Copy link

Hey @J0 Seeing the same issue with calling Supabase from Python and seeing timeouts. Any luck with this issue?

@kernelguardian
Copy link

This might work
opts = ClientOptions().replace(postgrest_client_timeout=60) supabase: Client = create_client(url, key, options=opts)

@J0
Copy link
Contributor

J0 commented Sep 1, 2023

Hey team,
Apologies just setting this again. Thanks for bumping - I'll re-look into the issue after work. Can I confirm the issue is on the postgrest-py client for all of y'all

@kernelguardian
Copy link

Hey @J0 I am not sure. The feature seems to be working fine for setting client options, maybe update the documentation if it's the intended way of setting client options. Thanks

@devstein
Copy link

devstein commented Oct 5, 2023

@kernelguardian Can you share a working code snippet? We are also running into this issue

@J0
Copy link
Contributor

J0 commented Oct 6, 2023

Hey all,

We've updated the documentation around options - https://supabase.com/docs/reference/python/initializing?example=with-timeout-option

It should work now. Do y'all mind trying again and then letting us know if there are still issues?

Thanks

@kernelguardian
Copy link

@J0 haven't touched that project in a while, will update once I get a chance.
@devstein check the previous comment -> #376 (comment)

@devstein
Copy link

devstein commented Oct 8, 2023

@J0 @kernelguardian Thanks appears to be working for us now

@Satoshilab21
Copy link

Satoshilab21 commented Oct 20, 2023

Does anyone know if this error relates to this?

APIError: {'code': '57014', 'details': None, 'hint': None, 'message': 'canceling statement due to statement timeout'}

When I apply the Client Options the "read timeout error" no longer occurs, but I now receive the above error.

I am executing the following line in python, where col1 is just a long column of numbers (~5.5M)

supabase.table('data').select('col1').order('col1', desc=True).limit(1).execute()

I am looking to get the max value of the column.
I am running Supabase version 1.2.0

@jtewright
Copy link

FYI: #487 (comment)

@silentworks
Copy link
Contributor

The docs has been updated on the website to show the correct way of doing timeouts. https://supabase.com/docs/reference/python/initializing

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests