504 error when using supabase auth

Getting 504 error when trying to confirm email with supabase auth. I'm able to signup a user anon, but trying to get the email confirmation setup in order to more securely sign in users. I'm using deep link but right now I can't even get the email to send without a 504 error. I'm attempting to test this on my iOS simulator, since I don't believe I can test this locally in Expo Go. Very stuck right now any assistance is appreciated! I've tried changing the site url to com.supabase, and my url link to practicepro:// (which is what my console.logs show is the correct URL), and it made no difference Disabled RLS policies as well and no difference either I attached the log from the 504 error in API Gateway
17 Replies
garyaustin
garyaustin20h ago
Check the auth logs and see if there is an email provider error. 504 is timeout. Also try sending an email from the dashboard.
Jonathan
JonathanOP20h ago
"{\"auth_event\":{\"action\":\"user_confirmation_requested\",\"actor_id\":\"d7cf44af-74b6-4839-abe2-0fb02be37d96\",\"actor_username\":\"jonathan.waddell10@gmail.com\",\"actor_via_sso\":false,\"log_type\":\"user\",\"traits\":{\"provider\":\"email\"}},\"component\":\"api\",\"error\":\"context deadline exceeded\",\"level\":\"error\",\"method\":\"POST\",\"msg\":\"504: Processing this request timed out, please retry after a moment.\",\"path\":\"/signup\",\"referer\":\"practicepro://auth/callback\",\"remote_addr\":\"207.229.149.24\",\"request_id\":\"9734e50bc4f03ef3-ORD\",\"time\":\"2025-08-22T19:50:09Z\"}"
"{\"auth_event\":{\"action\":\"user_confirmation_requested\",\"actor_id\":\"d7cf44af-74b6-4839-abe2-0fb02be37d96\",\"actor_username\":\"jonathan.waddell10@gmail.com\",\"actor_via_sso\":false,\"log_type\":\"user\",\"traits\":{\"provider\":\"email\"}},\"component\":\"api\",\"error\":\"context deadline exceeded\",\"level\":\"error\",\"method\":\"POST\",\"msg\":\"504: Processing this request timed out, please retry after a moment.\",\"path\":\"/signup\",\"referer\":\"practicepro://auth/callback\",\"remote_addr\":\"207.229.149.24\",\"request_id\":\"9734e50bc4f03ef3-ORD\",\"time\":\"2025-08-22T19:50:09Z\"}"
Heres the event message how do I send email from the dashboard? I tried googling but couldn't find anything about that
garyaustin
garyaustin20h ago
Go to authentication tab and create user. Send Invitation. So either your SMTP is timing out (that might be in the detail) or the DB did (but I would expect a 500 DB error. Are you using any auth hooks?
Jonathan
JonathanOP20h ago
I attempted to send a magic link for the new user and it says this
Failed to send magic link: upstream request timeout
Failed to send magic link: upstream request timeout
This was from the supabase dashboard
garyaustin
garyaustin20h ago
So it is not your app then. What provider are you using?
Jonathan
JonathanOP20h ago
provider? It's a react native expo app if that's what you mean, supabase is my backend/database
garyaustin
garyaustin20h ago
SMTP email provider? Are you using a custom one?
Jonathan
JonathanOP20h ago
I'm sorry I'm not sure how to find this out, I'm new to mobile app development and supabase auth i followed the supabase auth tutorial to set authentication up in my app
garyaustin
garyaustin20h ago
I
No description
garyaustin
garyaustin20h ago
So if you can provide the auth log detail message. Also see if there is an error in the Postgres log at same time. You did not say if you have an auth hook you wrote and enabled.
Jonathan
JonathanOP20h ago
SMTP email provider is custom, i have a free plan as well (maybe that's the issue?)
{
"host": "db-nugqfaokqrotfakpjqnk",
"component": "api",
"_SYSTEMD_CGROUP": null,
"grant_type": null,
"request_id": "9734e50bc4f03ef3-ORD",
"mail_from": null,
"message": null,
"_SOURCE_REALTIME_TIMESTAMP": null,
"PRIORITY": null,
"_AUDIT_LOGINUID": null,
"panic": null,
"metering": null,
"UNIT": null,
"event": null,
"SYSLOG_FACILITY": null,
"msg": "504: Processing this request timed out, please retry after a moment.",
"mail_type": null,
"EXECUTABLE": null,
"user_id": null,
"_CMDLINE": null,
"action": null,
"auth_event": [
{
"action": "user_confirmation_requested",
"actor_id": "d7cf44af-74b6-4839-abe2-0fb02be37d96",
"actor_name": null,
"actor_username": "jonathan.waddell10@gmail.com",
"actor_via_sso": false,
"log_type": "user",
"traits": [
{
"channel": null,
"identity_id": null,
"provider": "email",
"provider_id": null,
"provider_type": null,
"user_email": null,
"user_id": null,
"user_phone": null
}
]
}
],
"level": "error",
"_PID": null,
"path": "/signup",
"duration": null,
"_COMM": null,
"sso_provider_id": null,
"header": null,
"_MACHINE_ID": null,
"web3_domain": null,
"login_method": null,
"_STREAM_ID": null,
"source_type": null,
"_LINE_BREAK": null,
"web3_address": null,
"_EXE": null,
"_AUDIT_SESSION": null,
{
"host": "db-nugqfaokqrotfakpjqnk",
"component": "api",
"_SYSTEMD_CGROUP": null,
"grant_type": null,
"request_id": "9734e50bc4f03ef3-ORD",
"mail_from": null,
"message": null,
"_SOURCE_REALTIME_TIMESTAMP": null,
"PRIORITY": null,
"_AUDIT_LOGINUID": null,
"panic": null,
"metering": null,
"UNIT": null,
"event": null,
"SYSLOG_FACILITY": null,
"msg": "504: Processing this request timed out, please retry after a moment.",
"mail_type": null,
"EXECUTABLE": null,
"user_id": null,
"_CMDLINE": null,
"action": null,
"auth_event": [
{
"action": "user_confirmation_requested",
"actor_id": "d7cf44af-74b6-4839-abe2-0fb02be37d96",
"actor_name": null,
"actor_username": "jonathan.waddell10@gmail.com",
"actor_via_sso": false,
"log_type": "user",
"traits": [
{
"channel": null,
"identity_id": null,
"provider": "email",
"provider_id": null,
"provider_type": null,
"user_email": null,
"user_id": null,
"user_phone": null
}
]
}
],
"level": "error",
"_PID": null,
"path": "/signup",
"duration": null,
"_COMM": null,
"sso_provider_id": null,
"header": null,
"_MACHINE_ID": null,
"web3_domain": null,
"login_method": null,
"_STREAM_ID": null,
"source_type": null,
"_LINE_BREAK": null,
"web3_address": null,
"_EXE": null,
"_AUDIT_SESSION": null,
"_TRANSPORT": null,
"x_forwarded_proto": null,
"time": null,
"mail_to": null,
"_GID": null,
"stack": null,
"x_forwarded_host": null,
"saml_entity_id": null,
"status": null,
"_UID": null,
"valid_until": null,
"web3_uri": null,
"method": "POST",
"CODE_FILE": null,
"remote_addr": "207.229.149.24",
"provider": null,
"_SYSTEMD_UNIT": null,
"issuer": null,
"error": "context deadline exceeded",
"client_id": null,
"MESSAGE_ID": null,
"url": null,
"referer": "practicepro://auth/callback",
"_SYSTEMD_INVOCATION_ID": null,
"CODE_FUNC": null,
"_BOOT_ID": null,
"INVOCATION_ID": null,
"__MONOTONIC_TIMESTAMP": null,
"web3_chain": null,
"timestamp": null,
"__REALTIME_TIMESTAMP": null,
"immediate_login_after_signup": null,
"CODE_LINE": null,
"_SYSTEMD_SLICE": null,
"count": null,
"instance_id": null,
"args": [],
"SYSLOG_IDENTIFIER": null,
"metadata": [],
"auth_audit_event": [],
"_CAP_EFFECTIVE": null,
"factor_id": null,
"_SELINUX_CONTEXT": null,
"expires_in": null,
"version": null,
"project": null
}
]

Collapse
"_TRANSPORT": null,
"x_forwarded_proto": null,
"time": null,
"mail_to": null,
"_GID": null,
"stack": null,
"x_forwarded_host": null,
"saml_entity_id": null,
"status": null,
"_UID": null,
"valid_until": null,
"web3_uri": null,
"method": "POST",
"CODE_FILE": null,
"remote_addr": "207.229.149.24",
"provider": null,
"_SYSTEMD_UNIT": null,
"issuer": null,
"error": "context deadline exceeded",
"client_id": null,
"MESSAGE_ID": null,
"url": null,
"referer": "practicepro://auth/callback",
"_SYSTEMD_INVOCATION_ID": null,
"CODE_FUNC": null,
"_BOOT_ID": null,
"INVOCATION_ID": null,
"__MONOTONIC_TIMESTAMP": null,
"web3_chain": null,
"timestamp": null,
"__REALTIME_TIMESTAMP": null,
"immediate_login_after_signup": null,
"CODE_LINE": null,
"_SYSTEMD_SLICE": null,
"count": null,
"instance_id": null,
"args": [],
"SYSLOG_IDENTIFIER": null,
"metadata": [],
"auth_audit_event": [],
"_CAP_EFFECTIVE": null,
"factor_id": null,
"_SELINUX_CONTEXT": null,
"expires_in": null,
"version": null,
"project": null
}
]

Collapse
this is the auth log no error from Postgres log I'm not sure if I have an auth hook (so probably don't..), first time I'm hearing about it
garyaustin
garyaustin20h ago
I believe your email provider is timing out or not responding. You could switch back to the built in one and do the invite from the dashboard to see.
Jonathan
JonathanOP20h ago
oh wow, I disabled custom SMTP and it worked I'll go and investigate why the custom one times out then, thanks for your time if you have any other suggestions from your experience let me know, I'm off to go research this though!
tomaspozo
tomaspozo17h ago
Just out of curiosity. Which custom provider are you using?
Jonathan
JonathanOP2h ago
I’m using resend now, I didn’t know I had to use a specific provider prior to this
garyaustin
garyaustin2h ago
You don't have to use a specific one. I use Brevo.
tomaspozo
tomaspozo2h ago
You don’t. I wanted to check which one was not working to test and understand the error.

Did you find this page helpful?