Hi there, I'm currently using Supabase to try and ...
# python
c
Hi there, I'm currently using Supabase to try and upload a .txt file to a public bucket named "training-data", but for some reason, it's giving me this error:
Copy code
storage3.utils.StorageException: {'statusCode': 400, 'error': 'Key is not present in table "buckets".', 'message': 'insert or update on table "objects" violates foreign key constraint "objects_bucketId_fkey"'}
I made sure to create all the necessary object policies to allow for insertion, as well as make the bucket itself public. Here is my code:
Copy code
py
from supabase import create_client
from dotenv import load_dotenv
import os

load_dotenv()
url = os.environ.get("DEPLOY_URL")
key = os.environ.get("DEPLOY_KEY")


supabase = create_client(url, key)

file = "test.txt"
# data = supabase.storage().from_("public/training-data").download("test.txt")
# print(data)

supabase.storage().from_("public/training-data").upload("test.txt", file)
If anyone has any suggestions, please let me know.
2 Views