https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • upsert() new row violates row-level security policy
    n

    Neyunse

    11/23/2022, 12:58 AM
    I'm trying to update a user, but I'm getting an error, any idea how to fix this? As far as I can see, everything is correct but for some reason I can't update the user.
    g
    • 2
    • 2
  • reading postgis points with supabase
    t

    tubbo

    11/23/2022, 1:54 AM
    I'm trying to query a
    venue.location
    which is configured to be a
    geometry(point)
    in my schema. however, supabase returns this data as the "WKB" representation, e.g.
    0101000020E6100000FB05BB61DBFA4340983270404BCA52C0
    . i'm trying to parse this out to be a GeoJSON object but coming up short with all the libs i chose. how do most people convert this object into something useful?
    g
    • 2
    • 30
  • Trying to setup custom SMTP with a Google Workspace email
    j

    joshwerner

    11/23/2022, 5:18 AM
    Hi, I'm trying to setup custom SMTP with a Google Workspace email but am receiving this error:
    Copy code
    Error sending confirmation email: 534 5.7.9 Application-specific password required. Learn more at
    5.7.9  https://support.google.com/mail/?p=InvalidSecondFactor c8-20020ac853c8000000b003972790deb9sm9300032qtq.84 - gsmtp
    What does it mean by "Application-specific password required"? How can I create one? I've tried following the instructions in the link provided (https://support.google.com/mail/?p=InvalidSecondFactor) but have no option for creating an App Password. If anyone can help me out it would be much appreciated!
    l
    s
    • 3
    • 9
  • RLS not working for server-side calls
    s

    stukennedy

    11/23/2022, 10:49 AM
    I'm trying to call RLS protected tables from my server-side code. I'm not using supabase-auth-helpers. I have the auth working using cookies and
    supabase.auth.setSession(...)
    , so when I call
    supabase.auth.getUser()
    it returns the correct user. But calls to the DB return empty unless I turn RLS off on the table. Any idea what's going on here? I'm assuming the JWT isn't getting to supabase on the request, but assumed
    setSession
    would take care of that.
    s
    j
    • 3
    • 59
  • Turn off email confirmation on signup
    z

    zicho

    11/23/2022, 2:25 PM
    Where do you turn this off? I know you're supposed to be able to but I can't find the setting anywhere?
    g
    • 2
    • 2
  • invalid input syntax for type bigint
    h

    Hermes

    11/23/2022, 2:46 PM
    I have a table 'comments' which has a column 'instance_id' that was of type bigint previously but now I changed it to varchar but supabase is throwing an error when I try to retrieve data from the 'comments' table and set the instance_id equal to a string. It keeps saying invalid syntax for type bigint even though i already changed the column type from bigint to varchar.
    g
    u
    • 3
    • 4
  • Getting status code 406 with maybeSingle when returning 0 rows
    n

    Nin

    11/23/2022, 4:21 PM
    Copy code
    {
      "code": "PGRST116",
      "details": "Results contain 0 rows, application/vnd.pgrst.object+json requires 1 row",
      "hint": null,
      "message": "JSON object requested, multiple (or no) rows returned"
    }
    Code:
    Copy code
    javascript
    const [wishlist] = createResource(
        () =>
          from('wishlists')
            .select('uuid, name, description, wishlist_items!inner(*)')
            .maybeSingle() as any,
      )
    g
    h
    • 3
    • 10
  • client.auth.signInWithPassword() and client.auth.signOut() ERRORS
    g

    Gerson E. Aguirre

    11/23/2022, 4:28 PM
    I am working on a NuxtJS3 project, when I signin and i want to signout inmediatelly it does not work, if I try to sigout after signin does not work either
    s
    • 2
    • 1
  • What to do when user signs up for the second time with email confirmation?
    d

    Daniel Sosebee

    11/23/2022, 4:47 PM
    I have email confirmation enabled for sign-ups. So, if a user signs up for a second time with the same email, my app tells them to check their email. I would expect this to send them a magic email, but it doesn't. Can I force Supabase to send a magic email in this case? Or if not, what are best practices?
  • Trigger not working or function not firing—RLS?
    s

    Smardrengr

    11/23/2022, 5:58 PM
    So I have this function that, when a
    player
    joins a game, the
    players_conf
    (confirmed) column in the
    games
    record updates to reflect all players who have joined. But... it's not happening. And I'm not sure why. It was working before, but not anymore. Any ideas? Not seeing any errors client-side—like, the player record is being created...
    Copy code
    begin
    update games set players_conf = (select sum(players.num) AS num from players where players.game_id = NEW.game_id group by players.game_id) where games.id = NEW.game_id;
    return NEW;
    end;
    g
    • 2
    • 18
  • Do I need to handle errors with supabase update command?
    c

    Cheqo

    11/23/2022, 6:18 PM
    Hi, basic question, but do I need to handle errors here to prevent my app from crashing?
    Copy code
    useEffect(() => {
        if (user && cookies.affiliate) {
          supabase
            .from('users')
            .update({ referred_by: cookies.affiliate })
            .eq('id', user.id);
        }
      }, [user, cookies]);
    I don't need to present user with anything, if it fails it fails, but I just don't want my app to crash.
    r
    • 2
    • 1
  • is there a way to not enforce uniqueness of email id for oauth users?
    a

    arzy

    11/23/2022, 9:51 PM
    Trying to allow users to connect with multiple oauth providers at the same time but when there are accounts with the same email address, supabase will not let them connect because the email address already exists with a different oauth provider. Error message is:
    ERROR: duplicate key value violates unique constraint "users_email_key" (SQLSTATE 23505)
    We are just trying to get allow the user to connect with both twitter and discord at the same time. Looking at github discussions, it seems that a user should be able to do this if their emails are the same but it seems to be the opposite for us.
    g
    • 2
    • 4
  • SvelteKit auth helpers and storing session.user in a store—no more prop drilling with session.user
    s

    Smardrengr

    11/23/2022, 10:01 PM
    In most code samples I see, the
    auth helpers
    return
    session
    , as part of
    data
    , e.g.
    Copy code
    return {
      games,
      user: session.user
    };
    which is then available to
    +page.svelte
    via
    Copy code
    export let data: PageData;
    $: ({ games, user } = data);
    What I would like to do is store
    user
    in a Svelte store so that components that don't live at
    +page.svelte
    can access user without prop drilling. Wondering how you people are perhaps doing this?
    j
    • 2
    • 3
  • How to get the api key when running supabase in docker (local)
    t

    Trixrabbit

    11/23/2022, 11:47 PM
    I'm following the guides (https://supabase.com/docs/guides/cli/local-development) and I have setup my local supabase instance for development using docker. I have a sveltekit app that sets up the private variables, it works when I set them to my remote staging supabase instance, but I can't figure out how to point my application to my local instance. On the local install, there is no page for API Settings to get the
    anon
    and
    service_role
    key and I can't figure out how to configure this (Sorry for the noob question, I probably missed something obvious, this is my first solo app)
    g
    • 2
    • 6
  • AuthRetryableFetchError NetworkError when attempting to fetch resource
    b

    BarefootDev

    11/24/2022, 4:09 AM
    I'm not sure what I'm doing wrong.. I'm using the nextjs auth helper and calling
    supabaseClient.auth.signUp({ email, password });
    w
    d
    • 3
    • 2
  • Multi-Tenant Architecture for Storage
    g

    giancarlo

    11/24/2022, 10:59 AM
    Hello everyone! I'm building a multi-tenant architecture for files uploaded by groups of users (organizations, teams, etc.) and individual users. For example: - organizations can upload their logos (and can only be updated/read by users of the organization) - users can upload their avatars (and can only be updated by users) Would it be best to: 1. create a bucket for each organization with subfolders for each storage items category (logos, assets, etc.) 2. create a bucket for each item category, and control access using policies/RLS? 3. neither? Thank you in advance!
  • Is there an alternative to beforeSignIn?
    x

    xax948

    11/24/2022, 1:10 PM
    Hi, our team is integrating a risk engine. As a part of this process we need to validate sign-in attempts and block risky ones. Firebase has beforeSignIn blocking function mechanism, it allows you to provide a Cloud Function which is called before each sign in. Is there a similar mechanism for supabase?
  • cURL Parameter for Search Live Text?
    c

    czypnt

    11/24/2022, 1:39 PM
    I am using REST API and cURLS for my app, so when I am trying to build out a screen. I want users to be able to search a list, and the search variable will be assigned to the cURL. Currently I have /Product?name=fts.{{search}} but I realized this isnt doing a live search like each keystroke only after a complete word. What is the best way to accomplish this? So "Bla" shows results like the way "Black" would
    g
    • 2
    • 1
  • Using graphql extension - Could not find the public.graphql()
    a

    antoniojps

    11/24/2022, 3:49 PM
    I was testing the graphql extension on a brand new project and this is what I receive when testing the graphql endpoint:
    Copy code
    json
    {
      "code": "PGRST202",
      "details": null,
      "hint": "If a new function was created in the database with this name and parameters, try reloading the schema cache.",
      "message": "Could not find the public.graphql() function in the schema cache"
    }
    Any clue how to reload schema cache in supabase? Anyway to resolve this?
  • auth v1 token returning 400
    m

    MDobs

    11/24/2022, 3:54 PM
    We are seeing some unusual behaviour where our edge function (previously working) is returning
    session: null
    and we see that the
    /auth/v1/token
    is returning 400 and
    /auth/v1/admin/users
    422 on the edge function logs. What could be wrong?
  • Missing sub claim when try to getUser after setSession
    d

    damian_w

    11/24/2022, 5:30 PM
    Hey, i try to access logged in user details by use function getUser(), but all the times i get
    invalid claim: missing sub claim
    . When i use console.log on setSession there are active user details information. I try set persistSession from this thread (https://discord.com/channels/839993398554656828/1042260964646588516/1042260964646588516) to false but this bug still effect.
    g
    • 2
    • 2
  • Are Edge Functions Down?
    t

    tdhyunk

    11/24/2022, 6:22 PM
    Currently running into an issue where functions are timing out when being called. I've tested from within my application and also via curl but there seems to be a timeout issue. It was working fine yesterday and I haven't updated anything, so I'm doubtful it is something that I incorrectly implemented.
    l
    g
    d
    • 4
    • 7
  • Cookie with name 'supabase-auth-token' was not found at path
    k

    KrisGunnars

    11/25/2022, 1:54 AM
    I've been getting a ton of messages in the console like this: "Cookie with name 'supabase-auth-token' was not found at path '/stocks/aapl/', but a cookie with that name exists at these paths: '/login/pw/'. Did you mean to set its 'path' to '/' instead?" I'm using the Supabase Auth Helpers library for SvelteKit, latest version. It appears like it is setting the cookie at whichever page I logged in as, while presumably it should be setting the cookie at the root path. Has anyone else had this issue?
    j
    s
    e
    • 4
    • 5
  • migrate MySQL wp db into supabase
    i

    iStun4Fun

    11/25/2022, 1:43 PM
    I have my product actually on MySQL WordPress db, and user pass are md5 encrypted. Would like to do q seamless migration so users doesn't have to re-register. Is there a way to solve this?
    s
    o
    • 3
    • 11
  • system requirements
    d

    d4

    11/25/2022, 3:49 PM
    what specs should my vps have if i want to self-host supabase on it?
    a
    n
    • 3
    • 2
  • Parsing arrays in trigger functions
    z

    zeyad

    11/26/2022, 8:28 PM
    i have a trigger function which creates a row based on the auth user meta data and one of the properties is an array but in the function is a string, how do i parse it into an array?
    g
    j
    d
    • 4
    • 29
  • New row violates row-level security policy for table objects
    c

    ChunkyLubie

    11/27/2022, 1:47 AM
    When trying to upload an avatar, I get the error
    Copy code
    new row violates row-level security policy for table "objects"
    Any ideas why this is error is being thrown?
    g
    d
    • 3
    • 3
  • Database space Usage
    b

    bongjovi

    11/28/2022, 11:10 AM
    I'm just starting out with a new Supabase project, before I move to the Pro tier I wondered if someone could fill me in on how "Database space" works? I currently have one table with 216kB of data, but the Usage details under that project say I'm using 45.69 MB of "Database space", or ~9% of the limit. Only thing I could think of is that this "Usage" tab information applies across all projects? Any ideas? Thanks!
    e
    • 2
    • 2
  • Trigger not being created in local DB
    d

    DYELbrah

    11/29/2022, 12:53 AM
    After creating the initial migration file and running my first local instance of my supabase DB, I noticed that upon signing up, the profiles table isn't being automatically filled. In my main DB hosted on supabase, a new row is immediately added upon sign up. After further research I found that the following trigger is missing in my local db, it comes from the User Management Starter.
    Copy code
    create trigger on_auth_user_created
      after insert on auth.users
      for each row execute procedure public.handle_new_user();
    The trigger exists in my supabase hosted DB, however my migrated local instance does not contain it. I also do not see the trigger in the migration file. Any idea why I it didn't automatically add it to the migration file? I also attempted running
    Copy code
    supabase db diff --use-migra --linked
    This was unsuccessful as it did not find any differences. Thank you in advance.
    g
    a
    l
    • 4
    • 14
  • Environment Variables in Edge Functions local dev
    m

    mojogogo

    12/01/2022, 1:14 AM
    Hi, I have set up a local Supabase dev site and have been working with edge function locally. Everything seems to work as expected except for using my own env local secrets. I followed the docs here: https://supabase.com/docs/guides/functions#local-secrets My
    .env.local
    file contains the value for
    MY_NAME
    , but unable to read the value using
    console.log(Deno.env.get('MY_NAME')).
    if run by
    supabase functions serve add-project, console.log(Deno.env.get('MY_NAME'))
    it prints undefined, and if run via command
    supabase functions serve add-project --env-file ./supabase/.env.local
    it throws an error of : Error: Can't separate key from value. The same issue is described in more detail here with screenshots: https://github.com/supabase/supabase/discussions/8075 Has anybody else run into this? Any suggestions would be appreciated. Thanks!
    b
    • 2
    • 1
1...707172...230Latest