Deadwood-ai / deadwood-api

Main FastAPI application for the deadwood backend
GNU General Public License v3.0
0 stars 0 forks source link

fix thumbnail storage policy #21

Closed JesJehle closed 3 months ago

JesJehle commented 3 months ago

If trying to create thumbnail i get a row level security error: new row violates row-level security policy

full error with info:

base_dir='/data' archive_dir='archive' cog_dir='cogs' thumbnail_bucket='v1_thumbnails' tmp_dir='tmp' supabase_url='https://ijuphmnaebfdzsfrnsrn.supabase.co' supabase_key='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImlqdXBobW5hZWJmZHpzZnJuc3JuIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MDcyMjU5OTMsImV4cCI6MjAyMjgwMTk5M30.gBvzRDSzy69UN7ArnU-7VsopCClWjZcq89um8Vmj87c' uvicorn_host='0.0.0.0' uvicorn_port=8762 uvicorn_root_path='/' uvicorn_proxy_headers=True processor_username='processor@deadtrees.earth' processor_password='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImlqdXBobW5hZWJmZHpzZnJuc3JuIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTcwNzIyNTk5MywiZXhwIjoyMDIyODAxOTkzfQ.9fYCtAzQ72TCkQWuiD65wvQjbJQR0Z54kZkCblEDKJk' datasets_table='v1_datasets' metadata_table='v1_metadata' cogs_table='v1_cogs' labels_table='v1_labels'
api-1      | INFO:     192.168.65.1:48602 - "POST //datasets HTTP/1.1" 200 OK
api-1      | [ERROR]: Error uploading thumbnail for dataset 235: {'statusCode': 400, 'error': 'Unauthorized', 'message': 'new row violates row-level security policy'} file_path: /data/tmp/e82031c5-211c-4f76-bbab-eaf007d5f7fc_upload-test.jpg filename: e82031c5-211c-4f76-bbab-eaf007d5f7fc_upload-test.jpg thumbnail_bucket: v1_thumbnails

I also get this error, for logging and even if I use the processor user.

ich bekomme den fehler sogar wenn ich die thumbnails als bytes in eine neue tabelle v1_thumbnails schreibe, die keine RLS aktiviert hat. Ich kann wirklich nicht mehr. Scheiss auf den ganzen SCHEISSSS!!

JesJehle commented 3 months ago

https://www.reddit.com/r/Supabase/comments/12zfn6p/supabase_error_new_row_violates_rowlevel_security/ https://stackoverflow.com/questions/76409149/insert-statement-returns-a-policy-violation-using-expression

mmaelicke commented 3 months ago

This is done right?