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:

  1. Setup Supabase (version: “3.8”) selfhosted as specified in the docs
  2. Point a domain using cloudflare (in my case flexible SSL, I coudn’t get full working) to your server
  3. Edit the .env so that all 8000 ports are pointing to 80 instead
  4. (Re)start Supabase
  5. 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)
  6. 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

image

System information

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)

Most upvoted comments

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.

  1. docker compose down
  2. edit .env, fix urls
  3. docker compose up -d

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

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!

That worked for me as well. Good catch!

I meet the same error as yours @RFlintstone , when I add user in dashboard, it turns out this error , did you solve it? I completely followed the doc.

I couldn’t solve the issue as it looks like it’s an issue with https. If you access the dashboard over http it should work normally. (But for production you should obviously use https so this is still an issue that needs to be fixed)

I used http://123.456.789.1011:8000/project/default/auth/users, but still failed.💔 (Chrome, Windows10)

I see you opened a new issue. Please let me know if/when you have the solution. Http is nothing but a temporary one.

I fixed the error, pls see #20985. 😀