https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • Wrong Oauth2 redirect uri, but why? I put in my site's vercel domain, but it doesn't work?
    s

    stunna

    02/13/2023, 8:15 AM
    It works for local site - I log in normally no problem, but not with the vercel deployment. It has weirdness with the domains too, take a look at the screenshots. The redacted parts are EXACTLY the same everywhere. One is my website 'domain name', and the other which starts with 'b' is my email. What am I doing wrong? Following a tutorial for local, and remote supabase

    https://youtu.be/ZWBYu2yFpDs▾

    • 1
    • 2
  • Get the user table data
    h

    HugoDuprez

    02/13/2023, 8:41 AM
    Hi there! Do you know if it's possible to retrieve the entier base of users (in JSON or other). Not a table called "profiles" or so, but the list of users we have on the "Authentication" page 🙂 Thanks!
    g
    • 2
    • 2
  • How do I use supabase database functions with react?
    s

    SSHSRN

    02/13/2023, 9:04 AM
    I created a database function to create a table as I need a table dynamically created for users in my project. The function I created is attached below. Then I referred the docs and called the function in my react project, but it is showing a 404 not found error. I have attached the necessary screenshots and any help is appreciated!
    j
    g
    • 3
    • 56
  • pg_net does not seem to be sending any headers
    a

    animeshjain

    02/13/2023, 9:46 AM
    I am trying to call an edge function via
    pg_net
    (to setup scheduled invocations eventually), but I am stumbling upon a weird behaviour My pg_net query looks like follows:
    Copy code
    select
      net.http_post(
        url:='https://ixrnmjhxqamwctmuiymp.functions.supabase.co/track-data',
        headers:='{"Content-Type": "application/json", "Authorization": "Bearer <redacted_token>", "random-header": "test"}'::jsonb
        body:=concat('{"time": "', now(), '"}')::jsonb
      ) as request_id;
    My function invocation is happening, but I am getting an http 500 or 502 status in response. When I look at the invocation log, I see that none of the headers are getting included.
    Copy code
    Log ID
    9caba173-af16-47cd-98db-049d8d90d5d7
    .
    .
    .
    Log Metadata
    [
      {
        "deployment_id": "ixrnmjhxqamwctmuiymp_27bcaf6d-84c0-4739-b672-aeff23314a52_3",
        "execution_time_ms": 254,
        "function_id": "27bcaf6d-84c0-4739-b672-aeff23314a52",
        "project_ref": "ixrnmjhxqamwctmuiymp",
        "request": [
          {
            "headers": [
              {
                "accept": "*/*",
                "accept_encoding": null,
                "connection": null,
                "content_length": "41",
                "cookie": null,
                "host": "ixrnmjhxqamwctmuiymp.functions.supabase.co",
                "user_agent": "pg_net/0.7"
              }
            ],
            "host": "subhosting-v1.deno-aws.net",
            "method": "POST",
            "pathname": "/track-data",
            "port": null,
            "protocol": "https:",
            "search": null,
            "url": "https://subhosting-v1.deno-aws.net/track-data"
          }
        ],
        "response": [
          {
            "headers": [
              {
                "content_length": null,
                "content_type": "text/plain;charset=UTF-8",
                "date": "Mon, 13 Feb 2023 09:29:34 GMT",
                "server": "deno/aws-us-east-1",
                "vary": "Accept-Encoding"
              }
            ],
            "status_code": 500
          }
        ],
        "version": "3"
      }
    ]
    Any idea what I am missing here? Thanks!
  • Help unit testing serve handler
    m

    MarcoSantonastasi

    02/13/2023, 10:03 AM
    Is there a short and coincise way to test a serve(handler: Handler) function where I can easily and succinctly compare the Response returned form the handler with a fixtured Response? A short made-up snippet for reference that does __NOT__ work:
    Copy code
    typescript
    import { assertEquals } from "https://deno.land/std@0.177.0/testing/asserts.ts";
    import handler from "./handler.ts";
    
    Deno.test("handler", (_t) => {
      const expected = new Response("Hello World!");
      const received = handler(
        new Request(new URL("/testing", "http://localhost")),
      );
    
      assertEquals(expected, received);
    });
    I feel that testing each property one by one is tedious and error prone, but shallow
    assertEquals
    does not seems to work and I really expected it to work... What am I missing? I also tried the Deno community, since I believe it's more of a Deno question, but amybe people here are more reactive: https://discord.com/channels/684898665143206084/1074629346448384051/1074629346448384051
    f
    • 2
    • 1
  • Automated row deletion every hour
    s

    Sanctus

    02/13/2023, 10:14 AM
    Hi, I would like to automatically delete rows from a element table where slug = 'demo'. Is there a way to do that?
    u
    • 2
    • 1
  • JWSInvalidSignature in local development
    a

    ak4zh

    02/13/2023, 11:33 AM
    Getting
    JWSInvalidSignature
    when selecting any table in local development.
    Copy code
    js
    PUBLIC_SUPABASE_URL=http://localhost:54321
    PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0
    Copy code
    js
    {
      code: 'PGRST301',
      details: null,
      hint: null,
      message: 'JWSError JWSInvalidSignature'
    }
    n
    • 2
    • 2
  • One column of a table returns "undefined"
    h

    Hypersigils

    02/13/2023, 12:17 PM
    Hey! I'm trying to gather data from a table. A single foreign key column is showing as "undefined" despite being visible in the table editor. This is especially strange since another foreign key column is not! Does anyone know why? A screenshot of the table:

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

    A screenshot of what's returned by this statement:

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

    Copy code
    const { data, error } = await supabase
        .from('maps_tags')
        .select()
        .eq('map', mapID);
    I had read access RLS on all tables, then shut RLS off when it wasn't working.
    u
    g
    • 3
    • 20
  • Please Help - 3rd Time Posting This - Can't Deploy Edge Function
    i

    ICAZ117

    02/13/2023, 1:01 PM
    Hey yall! I'm quite new to supabase, and am currently in the process of following the supabase tutorial (https://supabase.com/docs/guides/functions/examples/stripe-webhooks) to integrate Stripe into a Supabase edge function. I'm at the point where I'm ready to deploy the edge function, but I'm getting the following error, and can't seem to find anything online for it.
    Copy code
    js
    Error: Error bundling function: exit status 1
    file:///src/import_map.json
    file:///src/index.ts
    error: Uncaught (in promise) Error: Relative import path "http" not prefixed with / or ./ or ../ and not in import map from "https://esm.sh/v106/@types/node@16.18.10/http.d.ts"
          const ret = new Error(getStringFromWasm0(arg0, arg1));
                      ^
        at __wbg_new_8d2af00bc1e329ee (https://deno.land/x/eszip@v0.30.0/eszip_wasm.generated.js:312:19)
        at <anonymous> (https://deno.land/x/eszip@v0.30.0/eszip_wasm_bg.wasm:1:79439)
        at <anonymous> (https://deno.land/x/eszip@v0.30.0/eszip_wasm_bg.wasm:1:1388039)
        at <anonymous> (https://deno.land/x/eszip@v0.30.0/eszip_wasm_bg.wasm:1:1862894)
        at __wbg_adapter_18 (https://deno.land/x/eszip@v0.30.0/eszip_wasm.generated.js:146:6)
        at real (https://deno.land/x/eszip@v0.30.0/eszip_wasm.generated.js:130:14)
    u
    t
    • 3
    • 18
  • Foreign keys and ON DELETE CASCADE
    e

    edgaras

    02/13/2023, 1:02 PM
    I have 3 tables with this M-M structure: To which tables and what foreign keys should I add, so when I delete a
    jobs
    or
    job_filters
    row, a related
    jobs_job_filter
    row should be automatically deleted?
    • 1
    • 2
  • Cannot use sign_up in Python
    s

    Sriniketh J

    02/13/2023, 1:14 PM
    I am trying to use the authenticate (sign up feature) using supabase-py. Here's the code for the same:
    Copy code
    from dotenv import load_dotenv
    load_dotenv()
    
    import os
    
    from supabase import create_client
    
    url = os.environ.get("SUPABASE_URL")
    key = os.environ.get("SUPABASE_KEY")
    Client = create_client(url, key)
    
    email = ""
    password = ""
    user = Client.auth.sign_up(email=email, password=password)
    But I get the following error:
    Copy code
    Traceback (most recent call last):
      File "/Users/srini/Documents/supabase-py/auth.py", line 8, in <module>
        user = Client.auth.sign_up(email=random_email, password=random_password)
    TypeError: sign_up() got an unexpected keyword argument 'email'
    Is there something I am missing?
    • 1
    • 2
  • i get a 401 saying new row violates RLS, even though there is no policy
    l

    lake_mattiato

    02/13/2023, 1:36 PM
    I have a bucket: documents in that bucket i have two folders: invoices and models. When trying to upload to the bucket i get the following error:
    Copy code
    json
    {
      statusCode: "401",
      error: "Invalid JWT",
      message: 'new row violates row-level security policy for table "objects"'
    }
    However, i am uploading like this:
    Copy code
    js
    const path = 'documents/invoices/ab20f0af-50c5-4ecb-a169-3f4a77ff1036/Test 1.jpeg'
    console.log(path)
    
    const { data, error } = await supabase
       .storage
       .from('documents')
       .upload(path, file, {
          cacheControl: '3600',
          upsert: false
       })
    Any ideas? Thanks
    g
    • 2
    • 1
  • Best Practice on supplying additional with auth.getSession()
    a

    actraiser

    02/13/2023, 2:06 PM
    When retrieving a session in a nextjs frontend using supabase.auth.getSession() it seems I can only receive the data from the auth.users table. I also want to supply additional fields to be queried from other tables (e.g. user_profiles) that should always be returned with getSession(). Right now, I can only see two possibilities to either submit an additional query to the user_profiles table everywhere I use getSession() or keep a copy of my desired additional data in the raw_user_meta_data and use triggers everywhere to update that field when something changed that should be part of the session object. Does either approach make sense or is there something simpler I overlooked?
    g
    • 2
    • 5
  • supabase-js: select relationship value as alias
    m

    Marty

    02/13/2023, 2:11 PM
    I'm having a look at the supabase-js documentation and was wondering if I could return a foreign table value as an alias. For example, these are my supposed tables: COUNTRIES TABLE: id, name CITIES TABLE: id, name, country_id
    Copy code
    const { data, error } = await supabase.from('cities').select(`name, country_id (name)`)
    This query would return the data as:
    Copy code
    [
      {
        "name": "Munich",
        "country_id": [
          {
            "name": "Germany"
          }
        ]
      }
    ]
    What I want to get back is:
    Copy code
    [
      {
        "name": "Munich",
        "country_name": "Germany"
        ]
      }
    ]
    I know that this could be done using an rpc function but I'd like to know if it would be possible to do it directly with a query like this:
    Copy code
    const { data, error } = await supabase.from('cities').select(`name, country_id (name) as country_name`)
    Thank you for your help!
    g
    a
    • 3
    • 4
  • API: .like() not filtering the non existing sub-table entries
    e

    enti

    02/13/2023, 2:47 PM
    I do an API call filtering with an optional `word`:
    Copy code
    sql
    const { data, count, error } = await supabase
        .from("table1")
        .select(***)
        .like("table2.label", "%" + word + "%")
    ...
    The problem is that some
    table1
    entries don't have any reference in
    table2
    . That makes these
    table1
    entries filtered out even when the filtering
    word
    isn't provided. Is there another way to include them? Is there a way to make my
    .like
    request optional when
    word
    isn't provided?
    g
    • 2
    • 4
  • StorageUnknownError: fetch failed (SvelteKit)
    p

    phoenix

    02/13/2023, 2:57 PM
    Trying to list my buckets, however (I'm running locally), this happens:
    j
    • 2
    • 2
  • Unable to Self Host using Docker
    d

    Daemon

    02/13/2023, 2:58 PM
    Are there any additional steps to self hosting Docker than using the commands listed on: https://supabase.com/docs/guides/self-hosting/docker
    Copy code
    # Get the code
    git clone --depth 1 https://github.com/supabase/supabase
    
    # Go to the docker folder
    cd supabase/docker
    
    # Copy the fake env vars
    cp .env.example .env
    
    # Start
    docker compose up
    I initially replaced the following env variables in
    .env
    with the values from my cloud project, but that never finished building. The documentation however says that replacing these variables are only recommended before going to production so I would expect it to work locally without changing them.
    Copy code
    POSTGRES_PASSWORD=
    JWT_SECRET=
    ANON_KEY=
    SERVICE_ROLE_KEY=
    My ultimate goal is to create a local dev environment and I will use Supabase Cloud for my production environment.
    s
    g
    +2
    • 5
    • 28
  • Uploaded file public URL on localhost
    k

    Krysalist

    02/13/2023, 3:36 PM
    Why my Supabase Storage files public url in localhost come with the Docker host ? (

    http://supabase_kong_myproject:8000/storage/v1/object/public/locations/file1-1676302351169.jpeg▾

    ) The working url is with 'localhost' :

    http://localhost:54321/storage/v1/object/public/locations/file1-1676302351169.jpeg▾

    These is a configuration parameter somewhere ?
  • Databse service unhealthy docker
    j

    JOCKER

    02/13/2023, 3:56 PM
    Hello everyone hope you all doing well , im facing some issues while running
    supabase start
    i got an error
    failed to connect to host=localhost user=postgres database=postgres: dial error (timeout: dial tcp 127.0.0.1:54322: i/o timeout)
    im running Docker on WSL on windows if anone have an idea about the issue, thanks1
    s
    g
    n
    • 4
    • 13
  • how to keep new line’s in a text column
    h

    Hugos

    02/13/2023, 3:58 PM
    I’m storing some text in a column and the new line’s are important when parsing it so whenever i save it to the db the newline or whitespace misformats
    g
    • 2
    • 10
  • User capabilities when user creates account, but has to verify email
    l

    Lukas V

    02/13/2023, 4:32 PM
    Hello, I am trying to create a seamless auth flow for users that land on my page. Imagine instagram/patreon built on supabase, if user lands on instagram.com/therock and then proceeds to subscribe to the creator. I want to: 1. Present with onboarding modal - some quick form that includes basic user bio, accept terms and conditions, etc. 2. following onboarding modal, I want to show auth components sign/create account. If user signs in with social auth, then I would simply persist the form inputs to database, create stripe customer, close modal and then user still remains on instagram.com/therock page and then they can checkout immediately. What happens if they choose to create account instead and has to verify the email? I assume they wouldn't even have permissions to write to their database, so I couldn't even persist their form inputs? and then when go to confirm their email, they are taken to root domain instead of
    /therock
    ? Is it possible to recreate this seamless sign up flow for
    create user with email and password
    ?
    m
    • 2
    • 1
  • how to downgrade pgsql version of supabase project
    j

    Jackw3434

    02/13/2023, 4:37 PM
    I created a new db instance, but this instance has a pgsql version 15, but my other db instances are version 14, meaning i cant schema diff. I dont want to upgrade from 14 to 15, i want to stay on 14 for now. How can i downgrade from 15 to 14 ?
    g
    • 2
    • 4
  • Is there a way I can have a magic link replace this email/pw while keeping the google sign-in butto?
    z

    zhay

    02/13/2023, 4:49 PM
    Whenever I add the magic link param, it removes the google auth button as well.
    g
    • 2
    • 3
  • how can i see the AMI image version of hosted supabase postgres?
    l

    logemann

    02/13/2023, 5:15 PM
    I am waiting on a fix and would like to know if there is any way to reveal the AMI version number for the postgres image. Second: Does "restart project" update the AMI version of the image? I am on the pro plan now and there is no option to "pause" the project. Also i ve seen this in the docs: Upgrade your project "This is only available for projects on the Free plan." So, how can i upgrade on the pro plan then?
    g
    • 2
    • 3
  • How to Bypass Database Triggers with Service Role
    s

    Shelby

    02/13/2023, 5:18 PM
    How do I make this happen my trigger function is
    Copy code
    sql
    
    BEGIN
      NEW.is_approved = false;
      RETURN NEW;
    END;
    g
    • 2
    • 4
  • Email Templates Editors
    s

    Señor Bruno

    02/13/2023, 6:30 PM
    Hi I am curious to know if any of you have examples or knowledge of third party email template generator that works with Supabase. I tried maizzle but that did not work well
    n
    g
    s
    • 4
    • 19
  • Downloading file from Storage with Javascript
    s

    suitedcode

    02/13/2023, 7:00 PM
    I am trying to initiate a download from the browser when a user clicks on a link. I am trying two things: 1. Initiate the download in a client-side function (
    onClick
    handler) 2. Initiate the download in a Next.js serverless function. - In the serverless function, I'll have access to the
    fs
    module to read the blob and write a file back to the client. I haven't had to write my own function to handle blobs and file streams to initiate a download, so this is beyond my scope of knowledge in what needs to happen. Any guidance would be greatly appreciated (especially on the core concepts of blobs, streams, etc.)
    • 1
    • 1
  • Public many to many table security?
    j

    jh

    02/13/2023, 7:04 PM
    I have a many to many relationship table I need to create. I'm worried about security on it. From what I've seen in the docs they don't seem to talk about the security of it. The many to many table doesn't have references to user ID's so I can't protect it with RLS in traditional means of checking auth ID against the user ID. These tables do reference other tables that do have a user_id column however. Do I just enable RLS and attach a user_id column with no other purpose other than to prevent others reading everyone else's data?
    g
    p
    • 3
    • 49
  • failed to update pg.publications with the given ID: must be owner of table scores
    m

    MawinOnAMac

    02/13/2023, 7:29 PM
    Hello guys i get this error when i want to enable realtime on a second database. Do you know why this happens?
  • image resizing question about pricing
    a

    abaum

    02/13/2023, 7:34 PM
    we're exploring using the image resizing functionality, but I was a little confused by the wording.
    Copy code
    We tried to find a middle ground, where you pay for the number of images you want to transform rather than the number of transformations:
    
    - You can transform 100 images per project, at no additional cost. Beyond this, it is $5 per additional 1000 images transformed.
    - Each image can be transformed up to 20 times. This is based on fair-usage. If you exceed the limit, we won't return an error and your site will continue to function (but you will get a sternly-worded email from @ AntWilson).
    https://supabase.com/blog/storage-image-resizing-smart-cdn#availability-and-pricing I'm interpreting this to mean that we pay once per image per size that we want it transformed to. however, the second bullet point confused me – does "Each image can be transformed up to 20 times" refer to the different possible sizes? or CDN cache misses? or something else that I'm missing?
    o
    • 2
    • 4
1...130131132...230Latest