https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • [SOLVED] Self hosted supabase realtime server isnt working as it should.
    j

    jameswong

    12/28/2022, 8:14 AM
    ![image](

    https://user-images.githubusercontent.com/87692325/209778636-884a830a-a1df-49c9-a92a-4968ea77fba9.png▾

    ) As you can see, we joined the room, but there was no real-time event received from the client. I don't know what's the problem now. Auth and other services work perfectly fine. I even tried with the hosted supabase and its works as well. I am using caddy to do the reverse proxy etc. Caddyfile
    Copy code
    https://example.com {
            reverse_proxy /rest/v1/* localhost:8000
            reverse_proxy /auth/v1/* localhost:8000
            reverse_proxy /realtime/v1/* localhost:8000
            reverse_proxy /storage/v1/* localhost:8000
            reverse_proxy /pg/v1/* localhost:8000
            reverse_proxy * localhost:3000
    
            basicauth / {
                    name $yourhashedpassword
            }
    
            header {
                    Content-Security-Policy "upgrade-insecure-requests"
            }
    
            log {
                    output file /var/log/access.log {
                            roll_size 1gb
                            roll_keep 5
                            roll_keep_for 720h
                    }
            }
    }
    docker-compose.yml
    Copy code
    realtime:
        container_name: supabase-realtime
        image: supabase/realtime:v0.25.1
        depends_on:
          db: # Disable this if you are using an external Postgres database
            condition: service_healthy
        restart: unless-stopped
        environment:
          DB_HOST: ${POSTGRES_HOST}
          DB_PORT: ${POSTGRES_PORT}
          DB_NAME: ${POSTGRES_DB}
          DB_USER: supabase_admin
          DB_PASSWORD: ${POSTGRES_PASSWORD}
          DB_SSL: "false"
          PORT: 4000
          JWT_SECRET: ${JWT_SECRET}
          REPLICATION_MODE: RLS
          REPLICATION_POLL_INTERVAL: 100
          SECURE_CHANNELS: "true"
          SLOT_NAME: supabase_realtime_rls
          TEMPORARY_SLOT: "true"
        command: >
          bash -c "./prod/rel/realtime/bin/realtime eval Realtime.Release.migrate
          && ./prod/rel/realtime/bin/realtime start"
    Any help would be appreciated ~
    b
    • 2
    • 7
  • enterprise search with postgres
    p

    psteinroe

    12/28/2022, 8:51 AM
    hey! does anyone have resources / experience with building an enterprise search? i really do not want to use an external system. my current ideas evolve around building a view, but I am concerned about performance. just getting started, hence looking for inspiration.
    s
    • 2
    • 1
  • How can i extend the supabase gotrue client
    c

    Captain

    12/28/2022, 9:24 AM
    i would like to type the metadata i save about a user when registering. how can i best extend this?
  • SOLVED Postgres failing to authenticate other services (DB not working out of the box)
    m

    madjar

    12/28/2022, 9:47 AM
    I am going to elaborate in the thread, open up for more info
    • 1
    • 15
  • one to one relation
    j

    Jesuscc9

    12/28/2022, 9:52 AM
    I know how to create relations in supabase, using foreign keys, but the returned data is an array, for example,
    Copy code
    javascript
      user: {
        inventory: [{...etc}]
      }
    is there any way, to instead of receiving an array, just receive an object? because you know that user can only have an inventory
    u
    s
    c
    • 4
    • 12
  • Cannot link to remote project. db major_version mismatch
    s

    Saeed

    12/28/2022, 10:11 AM
    Hi, I have create a new project on supabase, I did supabase init on my local, but when I supabase link I get this error:
    Copy code
    Error: Remote database Postgres version 15 is incompatible with db.major_version 14. If you are setting up a fresh Supabase CLI project, try changing db.major_version in supabase/config.toml to 15.
    I also tried to change that to 15. but I get this:
    Copy code
    Error: Failed reading config: Invalid db.major_version: 15.
    Try rerunning the command with --debug to troubleshoot the error.
    v
    s
    b
    • 4
    • 3
  • Nuxt 3 Supabase authentication with Magic Link on deployed version (Amplify, Netlify, Vercel)
    m

    Maxoouuu

    12/28/2022, 10:36 AM
    Hello, i'm trying to setup auth on my nuxt 3 application but it works only on localhost. Do you have an idea ? Here is my configuration on supabase :
    s
    • 2
    • 15
  • Get list of tables
    d

    davismarques

    12/28/2022, 11:26 AM
    Apologies if this has been answered elsewhere (checked docs, GitHub, Google, etc.) I'm wondering if there is some means of getting the list of tables using the JS SDK?
    g
    • 2
    • 2
  • [SOLVED] Error polling replication on Realtime
    w

    wykonos

    12/28/2022, 11:30 AM
    I'm getting that error in realtime logs. It was working fine but stopped out with latest 2.2.2 update(I guess?) but not sure is it related with new version. Any ideas to how to fix that?
    • 1
    • 2
  • data security
    g

    glatocha

    12/28/2022, 11:41 AM
    Hi, so after the news of leaking data from WhatApp, Facebook and LinkedIn recently I am wondering what is my legal responsibility if for some reasons Supa will be hacked and my Auth.Users will leak out? I only store emails for login (no credit cards etc.) but as a general question. Can I as a programmer be sued for the leak?
  • Is it possible to authenticate (oAuth) using identity token?
    u

    0xAsimetriq

    12/28/2022, 12:15 PM
    Hey guys, I'm trying to integrate supabase with apple sign in within react-native project. I'm using https://docs.expo.dev/versions/latest/sdk/apple-authentication to handle native apple sign in flow and upon authenticating it returns an identity token that is usually used to authenticate user with services like firebase / 0Auth etc. I am having trouble figuring out how to achieve same flow with supabase, it seems as if it is not possible right now? After some research I stumbled upon this article https://dev.to/dancurtis/how-to-use-supabase-apple-oauth-in-react-native-4c4h which kind of acheives it, but there are few issues 1. It seems they are using older version of supabase client i.e. I don't see some methods outline there on current client 2. This is not supporting native apple sign in flow, rather uses webview which is not ideal.
    r
    • 2
    • 2
  • How to redirect on the server when using resetPasswordForEmail?
    m

    moroshko

    12/28/2022, 12:41 PM
    I'm using Next 13 and following this guide: https://supabase.com/docs/guides/auth/auth-helpers/nextjs-server-components and sending a password reset email using
    await browserSupabaseClient.auth.resetPasswordForEmail(email, { redirectTo: "/choose-password" })
    . When the user clicks the link in the email, they are redirected to
    /
    and after that a redirect to
    /choose-password
    happens. The reset link contains
    &redirect_to=mysite.com
    , not
    &redirect_to=mysite.com/choose-password
    as I expected. Why the redirect happens only on the client side? Is it possible to redirect on the server?
    s
    • 2
    • 7
  • [SOLVED]Can not PATCH object in Postgres using Python requests module
    s

    silentworks

    12/28/2022, 12:52 PM
    @lake_mattiato deleting posts without stating how it was solved isn't helpful to anyone. Please don't do this again.
    l
    • 2
    • 8
  • Auth error when inviting user
    c

    Criminelis

    12/28/2022, 1:23 PM
    I'm trying to self-host Supabase but I'm unable to get the mailing functionality to work. The SMTP settings are correct (they work when I use them on a hosted project on supabase.com). The container running the Auth service only displays the following error message: "Error sending invite email". I'm using the following docker compose: https://github.com/supabase/supabase/blob/master/docker/docker-compose.yml I'm using NGINX as in the following tutorial: https://www.linode.com/docs/guides/installing-supabase/ Full error (I have removed the sensitive information (mail/ip):
    Copy code
    INF component=api method=POST msg=request started path=/invite referer= remote_addr=xxx timestamp=2022-12-28T13:07:31Z
    ERR auth_event={"action":"user_invited","actor_id":"00000000-0000-0000-0000-000000000000","actor_username":"service_role","log_type":"team","traits":{"user_email":"test@example.com","user_id":"769ea869-bf4c-4212-a400-8de688bd472c"}} component=api error=Error sending invite email: dial tcp 185.107.232.248:587: i/o timeout method=POST msg=500: Error inviting user path=/invite referer= remote_addr=xxx timestamp=2022-12-28T13:07:31Z
    INF auth_event={"action":"user_invited","actor_id":"00000000-0000-0000-0000-000000000000","actor_username":"service_role","log_type":"team","traits":{"user_email":"test@example.com","user_id":"769ea869-bf4c-4212-a400-8de688bd472c"}} component=api duration=10098168232 method=POST msg=request completed path=/invite referer= remote_addr=xxx status=500 timestamp=2022-12-28T13:07:31Z
    s
    • 2
    • 1
  • How to maintain multiple stages of development in one project
    m

    MaheshtheDev

    12/28/2022, 1:30 PM
    I have a product, i need database for staging area, local area, production area. I can't use same db since the data that was inserted from local will reflect in production env too. How can i implement multiple environments db in supabase?
    b
    u
    • 3
    • 13
  • Supabase dashboard unable to connect to database
    s

    sunech

    12/28/2022, 2:48 PM
    My database is working fine when I access it from my application, but the Dashboard can't connect to it. Anyone experienced anything similar? Project overview says: "There was an issue loading the usage details of your project" Clicking databases returns: "Error: [500] failed to get pg.tables: connect ECONNREFUSED :5432" DB is in us-east-1
    s
    • 2
    • 7
  • Execution Error error returned from database function get_random_uuid() does not exist
    d

    dp

    12/28/2022, 3:53 PM
    I'm trying to use the
    get_random_uuid()
    function but I'm getting this error:
    Copy code
    Execution Error: error returned from database: function get_random_uuid() does not exist
    Do I need to change some settings or otherwise modify my database to enable this functionality? The Supabase UI shows I already have
    UUID-OSSP
    enabled.
    • 1
    • 1
  • Keeps sending out GET requests when fetching based on foreign key relation
    t

    Taqi

    12/28/2022, 4:05 PM
    I can't fix this piece of code, and it is generating thousands of request per minute. Does anyone know how to resolve this? I'm looking to receive the 'profiles.first_name' based on the 'messages.sender_id'
    g
    s
    +3
    • 6
    • 9
  • For anyone using Prisma with Supabase, how is it?
    v

    Vik

    12/28/2022, 5:40 PM
    I've been thinking about integrating Prisma into my project before I start my private beta testing. I was curious on what others experience is setting up and using it. Is it worth it for the most part? Are there performance benefits that come from this as well?
    n
    • 2
    • 2
  • How long are OTP and password reset links valid?
    s

    Sue

    12/28/2022, 6:47 PM
    Is there a setting or a standard amount of time that these links are valid? Or are they valid until clicked? Thanks!
    g
    • 2
    • 2
  • Any way to create a policy that accesses the users.raw_user_meta_data?
    n

    Noah

    12/28/2022, 6:59 PM
    Need to validate that the right user can insert based on their metadata. is this possible in a policy?
    g
    • 2
    • 5
  • Example code of send password reset email in SvelteKit?
    s

    Smardrengr

    12/28/2022, 8:08 PM
    Can anyone point me to a link to one, preferably using the Supabase Auth Helpers?
    s
    • 2
    • 1
  • supabase.auth.getSession() returns null with invite links
    h

    hensou

    12/28/2022, 8:11 PM
    Hi, I have a NextJs project and I'm trying to use
    getSession
    to get the session from an url invite with the following code:
    Copy code
    typescript
    const getSessionFromUrl = async () => {
          const { data, error } = await supabase.auth.getSession()
          console.debug('getSessionfromUrl-data', data)
          if (error) {
            console.error('error', error)
            toast({ status: 'error', title: 'Error', description: 'description' })
            return
          }
          const { session: newSession } = data
          setSession(newSession)
          console.debug('session', newSession)} //<-- this is always null
    It does not throw any error, but the session is always null for some reason that I can't figure out. And it was working before I've updated supabase with
    supabase stop && supabase start
    Do you have any clue to what I'm missing here?
    g
    • 2
    • 3
  • the parent resource is not found
    z

    zeyad

    12/28/2022, 9:02 PM
    when uploading an image to storage i get the error "the parent resource is not found", i looked in the logs and the error returned seems to be a postgres error
    Copy code
    json
    {
      "code": "23503",
      "details": "Key is not present in table \"users\".",
      "hint": null,
      "message": "insert or update on table \"objects\" violates foreign key constraint \"objects_owner_fkey\""
    }
    g
    • 2
    • 6
  • Getting supabase-auth-token manually
    c

    Crownie

    12/28/2022, 9:32 PM
    see image {cookie}
    supabase-auth-token
    this seems to be the key on how supabase get the session/user on the nextjs api server (please confirm if anyone knows)
    Copy code
    js
    export default async function handler(req: NextApiRequest, res: NextApiResponse) {
      const supabase = createServerSupabaseClient<DatabaseTypes>({ req, res });
    }
    ------------------------ When I do client side axios calls The
    supabase-auth-token
    is already in there When I do server side axios calls (getServerSideProps) The
    supabase-auth-token
    is not in there, note: (
    axios {withCredentials:true}
    ) doesn't work ---------------------------- is there a way to get the
    supabase-auth-token
    on serverSideProps?
    • 1
    • 2
  • Setup the auth-ui component... but not doing anything
    j

    joshtwist

    12/29/2022, 1:07 AM
    I have setup the auth-ui component and have it working on http://localhost:3000. However, when I click sign-in, nothing happens. I can see that a JWT token is returned from supabase but that's it. Some other details * I am using the useUser hook from auth-helpers and am rendering the
    {user?.id}
    - the page does not re-render though * I have added
    http://localhost:3000
    as a redirect URL (not sure if this is necessary) * I have tried adding
    redirectUrl
    property to redirect back to localhost, nada. What am I doing wrong? Simplified code below ``` import { Auth, ThemeMinimal, ThemeSupa } from "@supabase/auth-ui-react"; import { createClient, Provider, Session } from "@supabase/supabase-js"; import { useEffect, useMemo, useState } from "react"; import { useSupabaseClient, useUser } from "@supabase/auth-helpers-react"; export default function Home() { // can't use env variables, so using the non-hook client const supabase = useMemo(() => { return createClient(SUPABASE_URL, SUPABASE_KEY); }, [SUPABASE_KEY, SUPABASE_URL]); const user = useUser(); return ( <> user '{user?.id}' <-- never renders <Auth magicLink socialLayout="vertical" supabaseClient={supabase} appearance={{ theme: ThemeSupa, }} providers={enabledProviders} /> ); }
    • 1
    • 2
  • Import from CSV into an array...
    s

    smantha42

    12/29/2022, 1:25 AM
    Hi - I've tried this several different ways, and keep getting into errors when importing a CSV with a column of type
    text[]
    . The CSV column has data in the form:  
    Copy code
    ["c5bbf0a8-b2cc-48dc-84de-a5b34da139d6","40bd7511-a272-4a55-88c0-c31d95b77db1","e6e8ddc0-0f43-4737-83e2-002b635d38e7","457b1c81-1851-46e9-a429-1e1ea044aa35","40bd7511-a272-4a55-88c0-c31d95b77db1"]
    Which if I were to manually enter into supabase Table Editor it works... but when it's in the CSV file, Supabase isn't able to ingest it. It reports the following error:
    Copy code
    Table HivesDeux has been created but we ran into an error while inserting rows: Failed to run sql query: malformed array literal: "["12c0dec1-611f-450f-8ae7-0ee3a7374c36","16be4036-1e8b-45b2-bc69-9d660944aecf"]"
    I've tried: 1. Wrapping the array elements in { } 2. Prefixing the [] with ARRAY 3. Replaced the " in CSV with ' I really don't want to manually enter multiple records using Table Editor. Appreciate any help...
  • Flutter supabase upload progress
    p

    pckimlong

    12/29/2022, 4:44 AM
    How can I implement upload progress like showing percentage when upload file to supabase?
  • Edge function out of memory
    m

    Martin INDIE MAKERS

    12/29/2022, 5:52 AM
    Hello i try to make a zip of 30 pic of 512x512 in my function from storage and up'osd the zip back to storage. the picture weighs 1mb each max. i do run out of memory i don't understand why
    u
    j
    g
    • 4
    • 9
  • Update a row and I'm getting a 204 on the patch but the data doesn't update
    u

    6ary

    12/29/2022, 6:28 AM
    This is related to row level security (enabled) and
    insert
    works fine. As the title says
    update
    does not. How can I have a policy for
    update
    that updates the row when a users table
    user_id
    matches the
    user_id
    in the request.
    Copy code
    curl -X "PATCH" "https://rvqaevlgtedzufmzxqur.supabase.co/rest/v1/users?user_id=eq.some_id" \
         -H 'Content-Type: application/json; charset=utf-8' \
         -H 'apikey': 'key' \
         -d $'{
            "is_subscribed": "false"
          }'
    How would I translate this to a policy?
    g
    s
    w
    • 4
    • 15
1...818283...230Latest