upload file to local storage bucket with service key
i cant for the life of me figure out how to upload to storage.
it works fine for authenticated users in the client.
but im trying to do it from a node.js script with the service key.
it seems to be able to download just fine, but can't upload the same file.
28 Replies
it fails without giving me an error, it says "upload failed, no data returned" and no file is there when i check
the download works though
the key im using is the one printed out from the local supabase dev environment under "Secret key", which I believe should have access
The
upload
method doesn't return any properties named dataUpload
or errorUpload
. It should be:
Or just print the whole object to see what you get back.
ah good catch, that explains why it wasn't throwing an error even though it clearly wasn't working.
this is the actual error:
any idea what it means?
What is your cli version?
Supabase CLI 2.48.3
Can you try with v2.47.2. I have that installed locally and uploads work with service role key with this. Will test with v2.48.3 in a while
ill try to figure out how to change versions. i forget how i installed it in the first place
you can simply use npx
Works on v2.48.3 too
weirdly my gui shows a different version


could be browser caching. Try in a private window
launching the different version failed, trying to launch my old version again
works on 2.48.3 as well

we'll see what version i have when it actually starts again
idk why but its downloading everything again
i just used
npx supabase start
it should use the latest version v2.48.3 if you don't have it installed in your local node_modules folder
version appears to be right now

Then previously you must be using the old version
Try running your script now
I am curious, is the Supabase/docker version linked to the CLI version?
The image versions are hardcoded in the cli release. You can only modify the img versions by creating a file in .temp directory
Where can I read more about this directory?
I don't think its mentioned explicitly in the docs. I read about it in a gh issue https://github.com/supabase/cli/issues/1702#issuecomment-2157545136
Awesome! Thank you 🙂
wow, it works perfectly now. i should have tried turning it off and on again :sadd:

thanks for your help inder
No you were using the wrong version before
The screenshot you shared above was showing 2.45
Maybe there was an issue with that version
weird ¯\_(ツ)_/¯
Also if it was 2.48 before, then it wouldn't have downloaded docker images again