supabase: Failed to fetch error after trying to add a user
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
I found an issue but GaryAustin1 reccomended me to create a new issue as ‘failed to fetch’ is a very generic error. https://github.com/supabase/supabase/issues/12334#issuecomment-1902661754
Describe the bug
When trying to add a user directly, with or without auto confirm, it gives an “Failed to create user: An error has occurred: Failed to fetch” error
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Setup Supabase (version: “3.8”) selfhosted as specified in the docs
- Point a domain using cloudflare (in my case flexible SSL, I coudn’t get full working) to your server
- Edit the .env so that all 8000 ports are pointing to 80 instead
- (Re)start Supabase
- Go to “Authentication” > “Users” > “Add User” > “Create New User” > Fill and submit the form (Autoconfirm doesn’t matter, same thing with and without it being checked)
- See “Failed to create user: An error has occurred: Failed to fetch” in the top right corner
Expected behavior
I expected to see a new user in the list
Screenshots
System information
- OS: Ubuntu Server 20.04
- Browser (if applies): Brave v1.61.120
- Version of supabase-js: as far as I can see in the docker compose file, version 3.7. Last commit at time of Supabase setup is https://github.com/supabase/supabase/commit/2cef1f3fdd0591517e78720d3782b7cc84c3eaa5
- Version of Node.js: [e.g. 10.10.0] according to docker exec (supabase-studio): v18.19.0
Additional context
According to the auth log it should have succeeded:
[
{
"auth_event": [
{
"action": "user_invited",
"actor_id": "00000000-0000-0000-0000-000000000000",
"actor_username": "service_role",
"actor_via_sso": false,
"log_type": "team",
"traits": [
{
"user_email": "asd@email.com",
"user_id": "4e49bb03-a616-427a-8b3c-************"
}
]
}
],
"component": "api",
"duration": 106657585,
"level": "info",
"method": "POST",
"msg": "request completed",
"path": "/invite",
"referer": "http://db.mydomain.net:3000",
"remote_addr": "172.25.*.*",
"status": 500,
"time": "2024-01-21T16:52:51Z",
"timestamp": "2024-01-21T16:52:51Z"
}
]
I’m also getting the following error two times:
[
{
"component": "api",
"level": "warning",
"msg": "DEPRECATION NOTICE: GOTRUE_JWT_DEFAULT_GROUP_NAME not supported by Supabase's GoTrue, will be removed soon",
"time": "2024-01-21T16:44:12Z",
"timestamp": "2024-01-21T16:44:12Z"
}
]
docker ps also shows supabase-studio as unhealthy. When executing docker logs on the container I just get the standard Next.js output:
▲ Next.js 13.5.6
- Local: http://b093b6db8f1b:3000
- Network: http://172.25.*.*:3000
✓ Ready in 1892ms
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (2 by maintainers)
I was experiencing the same on local dev. Changed all instances of localhost to 127.0.0.1 in my config.toml and now working fine!
Hi! Same issue. Running on VPS.
After properly configuring .env (SUPABASE_PUBLIC_URL,SITE_URL,API_EXTERNAL_URL) it start working. I changed localhost etc to the IP of the VPS and its ok now.
I’ve run into the same problem recently. Didn’t have a problem until yesterday, basically, i restarted the instance (and downloaded the new docker images for Supabase, can’t say if that changed anything) and this one functionality is now a problem. I can use the “send invitation” alternative, but i’m having a bad time in deciphering what is wrong, if it is my config or something like that…
I did set a foreign key to the
auth.users(id) field, but i’ve also tried using a complete empty database, resetting the docker volumes, even deleting the images and downloading them again. Problems persists. Also tried to user other browser (saw some people who had this problem only in Firefox, but not Brave, e.g.)To be more precise, i am having a “Content Security Policy: The page’s settings blocked the loading of a resource” problem in the console. No response whatsoever. Maybe the Supabase Studio config was changed in the new image? Idk
I will probably create another issue on this though, seems to be a very unique problem.
PS: i am using a local instance.
Just saw issue #21476 with same problem. Guess i won’t need to create a new one then
That worked for me as well. Good catch!
I fixed the error, pls see #20985. 😀