supertokens-python icon indicating copy to clipboard operation
supertokens-python copied to clipboard

Receive "No SuperTokens core available to query"

Open alexprice12 opened this issue 3 years ago • 7 comments

message.txt

Stack trace attached in message.txt

This error happens infrequently but daily. It has happened as long as a ~5 seconds for multiple requests. I'd like the sdk to either retry or at least show a much better error.

alexprice12 avatar Oct 03 '22 01:10 alexprice12

This error is caused by your SuperToken not being available to your Python application or your Python application not being able to connect.

A classic bug, which happened to me, is that I was trying to contact supertoken on localhost from my container, while supertoken was running in another container. Check the ConnectionURI variable in your configuration. I attach an example (from go, but it may give you the necessary hints).

Other possible errors to check:

  1. Firewall
  2. Ports where SuperToken runs
  3. DNS
  4. Connection problems

carbon

dev-ago avatar Oct 26 '23 13:10 dev-ago

I can consistently reproduce this on the very first request to FastAPI. All subsequent requests work. There must be an initialization issue somewhere.

I haven't tested in production, only locally (but pointing to the correct core container address, since all requests except the very first work).

andreipopovici avatar Mar 20 '24 16:03 andreipopovici

That's interesting @andreipopovici . Do you have a demo app we could get access to, to try and see why this is happening?

rishabhpoddar avatar Mar 20 '24 16:03 rishabhpoddar

I do not, but I'll set one up shortly. I use FastAPI in a Docker container with uvicorn hot-reloading during dev, and after any change and subsequent server reload, the very first request that uses the ST SDK fails with this error.

andreipopovici avatar Mar 20 '24 16:03 andreipopovici

Thanks. Would be very helpful to get a demo app here. Will wait for it

rishabhpoddar avatar Mar 20 '24 17:03 rishabhpoddar

@rishabhpoddar Here you go. Instructions are in the README: https://github.com/andreipopovici/st-python-reproduce

andreipopovici avatar Mar 20 '24 18:03 andreipopovici

Thanks @andreipopovici. Will try it and get back to you. Please give us a few days.

rishabhpoddar avatar Mar 20 '24 18:03 rishabhpoddar