supertokens-python
supertokens-python copied to clipboard
Receive "No SuperTokens core available to query"
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.
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:
- Firewall
- Ports where SuperToken runs
- DNS
- Connection problems
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).
That's interesting @andreipopovici . Do you have a demo app we could get access to, to try and see why this is happening?
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.
Thanks. Would be very helpful to get a demo app here. Will wait for it
@rishabhpoddar Here you go. Instructions are in the README: https://github.com/andreipopovici/st-python-reproduce
Thanks @andreipopovici. Will try it and get back to you. Please give us a few days.