Hey. I am attempting to run a self-managed instance of SuperTokens. It is connected to the CloudSQL ...
a
Hey. I am attempting to run a self-managed instance of SuperTokens. It is connected to the CloudSQL instance. To improve on my testing time etc, I decided to compose my backend container & the supertokens core together via docker-compose. My data is stored on a Google CloudSQL instance. Additionally, my express backend is run on port 3000, and the
supertokens-postgres
is run on port 3567. All of this is run on the same network. When I try to send a POST request to
/auth/signin
, I receive a
status 500
. Additionally, in my logs I receive the following error
Copy code
TypeError: fetch failed
2023-12-22 06:26:56     at Object.fetch (node:internal/deps/undici/undici:11730:11)
2023-12-22 06:26:56     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2023-12-22 06:26:56     at async sendRequestHelper._a (/usr/src/node_modules/supertokens-node/lib/build/querier.js:51:36)
2023-12-22 06:26:56     at async Querier.sendRequestHelper (/usr/src/node_modules/supertokens-node/lib/build/querier.js:326:32)
2023-12-22 06:26:56     at async Querier.getAPIVersion (/usr/src/node_modules/supertokens-node/lib/build/querier.js:41:38)
2023-12-22 06:26:56     at async sendRequestHelper._a (/usr/src/node_modules/supertokens-node/lib/build/querier.js:85:38)
2023-12-22 06:26:56     at async Querier.sendRequestHelper (/usr/src/node_modules/supertokens-node/lib/build/querier.js:326:32)
2023-12-22 06:26:56     at async Querier.sendPostRequest (/usr/src/node_modules/supertokens-node/lib/build/querier.js:81:40)
2023-12-22 06:26:56     at async Object.signIn (/usr/src/node_modules/supertokens-node/lib/build/recipe/emailpassword/recipeImplementation.js:58:30)
2023-12-22 06:26:56     at async Object.signInPOST (/usr/src/node_modules/supertokens-node/lib/build/recipe/emailpassword/api/implementation.js:450:28)
The
localhost:3567/hello
is reachable and responsive. The other endpoints on my backend are also responsive. Could someone help me with this error please?
r
hey @advait
whats the connection uri you have provided to the node process?
a
Would this be inside the
supertokens.init
? The connection uri here is
http://localhost:3567
Also, to add - 1. The backend is able to successfully signup & signin, if I am running the backend outside a docker container, but I have the self-hosted instance running. 2. This error occurs only if I run both my backend and supertokens core on docker (inside the same network, using compose)
r
since you are docker compose, you need to give the service name as the connection uri. Like
http://supertokens:3567
a
got it - let me try this!
Unfortunately, I am facing the same error.
r
can i see the docker compose file?
a
Should I share it here?
r
see if you have all the parts in your own, and that the connection uri is correctly configured (should be the service name)
a
I did copy the compose from this link - but let me confirm once and get back.
r
are you running the backend process with the backend sdk as part of the docker compose as well?
a
Yes
r
right.
then the service name should work
a
Maybe, my
supertokens.init
is not configured properly?
Seems like there was an issue with image build that was causing this error after I changed the connectionURI - rebuilding the image seems to have solved it!
6 Views