https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • Migration Errors while setting up supabase
    p

    Ph!l

    08/28/2022, 7:32 PM
    Hey guys, im pretty new to self hosting & docker.. I have adjusted everything in the .env and docker-compose file as described in the docs (except Email Auth section but shouldn't matter in this case) and commented out the db stuff as I wanted to use an external database as recommended. When I then started the compose file I got some errors... apparently something is going wrong with the migration. I did a little research but just didn't find anything that really helps me in my current situation. I am unsure what other info you guys might need to help me. The two config files are the same as the examples on github except for changed data. So if you need to know anything else, just let me know :)

    https://i.imgur.com/MthfZGc.png▾

  • Has anyone here had a use case of sending webhook event to users, triggered by db change?
    e

    emmanuelaina_

    08/28/2022, 7:57 PM
    Has anyone had a use case for sending users a webhook event? Where the event will be triggered by a Supabase db data delete, update or create; then fire to users. Use case: Having a transactions table, when there is a new entry, I want to send an event to the users webhook URL on my application
    o
    • 2
    • 1
  • Disabling timeout for long learning procedures
    q

    qria

    08/28/2022, 10:33 PM
    I am trying to run a pgsql procedure that runs for 5+ minutes, but doing so in supabase admin SQL editor, the query times at at amount ~2 minutes with "An error has occured: Failed to fetch" error. What options do I have to configure for timeout to not happen and what would be the recommended way to trigger a long running procedure?
    g
    • 2
    • 4
  • Invalid JWT
    a

    Aaron Me

    08/29/2022, 12:31 AM
    When trying to upload an Image to the bucket (Policy: Authenticated and (bucket_id = 'site-logos'::text)) I get a response "Invalid JWT" Any ideas?
    Copy code
    import { supabaseClient
    } from "@supabase/auth-helpers-nextjs";
    
    const uploadSiteLogo = async (image, imageName, imageType) => {
      const { data, error } = await supabaseClient.storage
        .from("site-logos")
        .upload(imageName, decode(image), {
          cacheControl: "3600",
          upsert: true,
          contentType: imageType,
        });
      if (error) {
        throw error;
      }
      const response = { data, error };
      return response;
    };
    Error:
    Copy code
    {
      statusCode: '401',
      error: 'Invalid JWT',
      message: 'new row violates row-level security policy for table "objects"'
    }
    I just moved from supabase-js to auth-helper-nextjs. this function works no problem with supabase-js
    g
    • 2
    • 6
  • test environment
    c

    cbunge3

    08/29/2022, 12:36 AM
    is there any way to spin up a test environment database alongside production ?
    s
    h
    t
    • 4
    • 6
  • Check for First Login or New User
    j

    jdgamble555

    08/29/2022, 1:44 AM
    Is there a way to see if a user is a new user? On the first login I want to do things that I would not want to do later. Firebase has a
    additionalUserInfo.isNewUser
    to test for this. Thanks, J
    g
    • 2
    • 8
  • Any tips on improving performance of INSERT
    r

    rbkayz

    08/29/2022, 2:09 AM
    hello! I have an edge function where one of the key tasks is inserting into the DB. It takes a long time, and was wondering if there are any tips from the community on how to make INSERT more performant. Ty
    o
    g
    • 3
    • 9
  • Pagnation
    t

    TARS

    08/29/2022, 9:30 AM
    Hello, I'm building an admin app with client side rendering in next.js and supabase. Now I've come to the part where I probably want to have some kind of pagnination top my data. As I have come to understand it there's some functionality in supabase for this. The problem is that I can't find the documentation for it. Can someone point me in the right direction? Or give me more tip of how to do this.
    s
    • 2
    • 1
  • Expo Go Confirmation Email Redirect
    b

    benjaminbialy

    08/29/2022, 9:36 AM
    Hey all, I've been facing a problem where I can't seem to send data back to my React Native Expo app from the confirmation email for my email and password auth. I'm expecting onAuthStateChange to get triggered and for a session to be created for the user once they click on the link like on web, does anyone know how to do this with Expo? I can successfully open the app from the link, just not send the data over. Any help would be great! Thanks 🙂
  • How to do local development in the right way?
    s

    succodanatra

    08/29/2022, 11:06 AM
    Hi everyone, I'm just started to explore the hosted version of Supabase and I would like to adopt it for our new project. Everything looks cool and easy but the local development is not quite clear to me. My doubt are: 1. How should i manage multiple environments? like having a staging / prod db? I was thinking about creating multiple projects but i'm not sure if it is the right way. 2. I followed the docs, installed the cli, did supabase init and pulled the docker images but how can i pull the migrations i ran in the hosted supabase studio and run then in my local db? 3. why to use local development the folder containing supabase has to have a
    .git
    with main branch? I'm using NX monorepo and supabase is inside apps/db/supabase, my root folder owns the git info, but to run supabase locally i had to do
    git init
    also inside the
    apps/db
    folder, it looks like it can't traverse upwards to look for a .git folder in parents
  • Error starting userland proxy listen tcp4 0.0.0.08443 bind address already in use
    s

    scheduledisplay

    08/29/2022, 11:12 AM
    I am following the self hosted documentation from Supabase. At the end when I am trying to run it by "docker-compose up", it is giving me this error. ERROR: for kong Cannot start service kong: driver failed programming external connectivity on endpoint supabase-kong (2bcf9a92d093e3b5d463143f776bd23aefb2afcfe439ae7719c5dc6364680797): Error starting userland proxy: listen tcp4 0.0.0.0:8443: bind: address already in use I changed the port in .env and docker-compose.yml , but the error still remains. I cannot kill the process running on port 8443. How can I run the supbase project?
  • SignIn with twitter
    e

    EL OUADI Abdelati

    08/29/2022, 11:30 AM
    I want twitter to force login every time so i added force_login param
    Copy code
    options const = { redirectTo: window.location.href, queryParams: { force_login: "true" } }
    await supabaseWeb.auth.signIn({ provider: "twitter" }, options)
    doesn't work even though i added it. if you want twitter to force login every time you have to pass the force_login parameter with oauth_token when you call oauth/authorize or oauth/authenticate but supabase doesn't. when i click on the twitter button i got this
    Copy code
    https://xxxxxxxxx.supabase.co/auth/v1/authorize?provider=twitter&redirect_to=""&force_login=true
    this means that supabase does not add the force_login parameter after getting the oauth_token. Any help ?
    s
    m
    • 3
    • 3
  • realtime only emitting DELETE events no INSERT or UPDATE events
    a

    Alio

    08/29/2022, 1:03 PM
    Copy code
    useEffect(() => {
        const users = supabaseWeb
          .from("users")
          .on("*", payload => {
            console.log("Change received!", payload)
          })
          .subscribe()
    }, [])
    Replication is enabled ✅ Select granted to public ✅ I've also tried to add a policy :
    Copy code
    CREATE POLICY "Enable read access for all users"
        ON public.users
        FOR SELECT USING (
            true
        );
    Supabase:
    1.33.3
    Prisma:
    4.1.1
    Remix:
    1.6.1
    Mac OS Monterey
    12.1
    g
    l
    • 3
    • 27
  • Testing OTP sign-in locally
    k

    kaaloo

    08/29/2022, 1:39 PM
    Hi, I don't see a way to setup login with phone auth when running supabase locally for development using supabase start. Am I missing something?
  • Help with Twilio Functions.
    g

    gaIaxy

    08/29/2022, 2:46 PM
    when i try to update my db trough twilio i get this error. data { error: { message: 'No API key found in request' }, data: null, count: null, status: 401, statusText: 'Unauthorized', body: null } const test = await supabase .from("person") .update({ is_coming, arrives_in, }) .match({ phone: from }); when i test it with my other project supabase instance it works, but somehow doesn't with the new one.
    g
    u
    • 3
    • 16
  • How could I write the following query in JS?
    s

    Sanctus

    08/29/2022, 4:08 PM
    I'm having difficulties translating this query:
    Copy code
    postgres
    SELECT location.name
    FROM location
    JOIN facility
        ON location.id = facility.location_id
    JOIN facility_category
        ON facility_category.id = facility.facility_category_id
        WHERE facility_category.name = 'Imaging Center'
    So far I have something likke this:
    Copy code
    ts
    .from('location')
          .select('name, facility!inner(*), facility_category(*)')
          .eq('facility_category.name', 'Imaging Center')
    But I just get the follwing error: "**Could not find a relationship between 'location' and 'facility_category' in the schema cache**", even though the query works fine in the SQL editor. Also, I'd like to make it distinct, but my understanding is that it is not possible via the API?
    g
    o
    t
    • 4
    • 9
  • Where can I find a more updated version of the storage's API documentation?
    j

    Juanπ

    08/29/2022, 4:46 PM
    I'm trying to retrieve a signedurl using only the API, but I having a lot of issue... Do you have an example of how to achieve this ?
    g
    • 2
    • 24
  • Why do I get this error?
    g

    gaIaxy

    08/29/2022, 5:17 PM
    on one supabase instance I get and error, but when switching to another one with same config (using different keys ofcourse) I get and error
    • 1
    • 1
  • Failed to run sql query column does not exist
    d

    Dginio

    08/29/2022, 5:32 PM
    Hello, i am unable to do a simple Search on a table, can someone help me ? Check the pictures to see the error
    g
    • 2
    • 2
  • Cannot invoke edge function, using flutter and supabase_flutter package.
    a

    AllxRise

    08/29/2022, 5:43 PM
    Invocation returns
    Copy code
    dart
    I/flutter (10801): FormatException: Unexpected character (at character 1)
    I/flutter (10801): Internal Server Error
    I/flutter (10801): ^
    error. I'm using hello-world example, I didn't changed anything.
    g
    • 2
    • 5
  • Invite user (auth)
    d

    DevThoughts

    08/29/2022, 6:52 PM
    I want to send a sign up email to create account manually as there is already option to invite user. But instead i want send also reset/create password with invitation with same email. Anyone know how can i do that?
    n
    • 2
    • 8
  • How to use crypto.subtle.importKey with supabase JWT?
    n

    nickreed

    08/29/2022, 10:58 PM
    I'm trying to do a simple verification of the incoming JWT, but I cannot figure out how to use the
    crypto.subtle.importKey
    to actually import the supabase JWT (from API credentials). I have added my secret as SUPABASE_JWT_SECRET, but I don't know what values to use for the crypto settings (ie the SHA-256 and HMAC strings seem wrong, but I have no clue what would be correct):
    Copy code
    import { verify } from "https://deno.land/x/djwt@v2.7/mod.ts";
    
    
    serve(async (req) => {
      const jwt = req.headers.get("Authorization")!.replace("Bearer ", "");
    
      var key = await crypto.subtle.importKey(
        "jwk",
        Deno.env.get("SUPABASE_JWT_SECRET"),
        { name: "HMAC", hash: "SHA-256" },
        true,
        ["sign", "verify"]
      );
    
      const payload = await verify(jwt, key, "HS512");
    • 1
    • 1
  • Testing strategies with NextJS
    t

    timeforpoptarts

    08/30/2022, 3:04 AM
    I am looking for an example on how to build component, API, and page testing with Supabase/Next. I haven't found a great example to follow closely, but I think I have been able to cobble together something that works. The primary issue that I am running into now is the best way to set up a test user (assuming in a jest set up script) and tear it back down.
    n
    • 2
    • 1
  • Trigger function of my server on new user added
    f

    fernandops26

    08/30/2022, 4:20 AM
    I am doing GitHub auth from two sides: -* Webapp:* Auth to Github and the callback is go to the server. - VSCode: Auth to GitHub directly callback return to my vscode extension: (vscode://..) No matter from where is logging, I need to attach it to a default Stripe plan. How I can detect when a new user has been logged into the system to do it?
  • staging enviorments for auth
    a

    aleemrehmtulla

    08/30/2022, 4:43 AM
    hey! how can i have a dev, staging and prod environment for auth? both on supabase redirect -- and putting in multiple keys for third-party
    s
    • 2
    • 3
  • is it possible to run edge functions on supabase dashboard?
    d

    d33pu

    08/30/2022, 8:16 AM
    I am curious if its possible to develop and run edge functions on supabase dashboard unlike on local machine?
    u
    • 2
    • 5
  • is it okay to have repetitive foreign key names?
    l

    Lukas V

    08/30/2022, 9:16 AM
    I have users table, where I store all the info about user, such as billing_address, username, dob, etc. I also have separate tables for usernames and stripe_connect_accounts, in those tables I have set primary keys as users
    uid
    . That made my users table look like this screenshot, and I was just wondering, even though joins and everything works, is it ok to have columns
    id
    ,
    username
    ,
    stripe_connect_account
    with identical values?
    h
    • 2
    • 6
  • Getting array of ids from array of elements
    m

    MATTI

    08/30/2022, 10:31 AM
    I have an array of foods ["Pizza", "Pasta", "Pasta", "Pizza"]. I also have a table of foods with a name and id, it's in the image. I want to get all the ids from the foods in the array. I want it so that I am able to get multiple of the same ids. The expected result is an array of ids that look like this: [1,2,2,1] How would I go about doing this in supabase ts/js?
    g
    • 2
    • 4
  • Zapier + Supabase Postgres
    a

    anderjaska

    08/30/2022, 4:26 PM
    I'm trying to connect my database with zapier via the connection pooling string, but I don't know what fields it may need. has anyone done this before? See screenshots
  • Concerns about loss of sync getUser in 2.0
    m

    martypdx

    08/30/2022, 4:42 PM
    I noticed in v2
    getUser
    is now async. Seems like that would be extra handling to prevent apps from rendering without a user, then second rerender once the
    getUser
    call resolves. Any background on this or possibility to included a
    getUserSync
    ?
    s
    g
    • 3
    • 12
1...111213...230Latest