supabase / storage

S3 compatible object storage service that stores metadata in Postgres
https://supabase.com/docs/guides/storage
Apache License 2.0
807 stars 115 forks source link

upload file failed in studio when i use minio as storage backend #523

Closed unfazed2049 closed 3 months ago

unfazed2049 commented 3 months ago

Bug report

Describe the bug

I am using MinIO as the backend storage service for S3, and I have correctly configured the environment variables such as STORAGE_BACKEND, STORAGE_S3_ENDPOINT, S3_PROTOCOL_ACCESS_KEY_ID, and S3_PROTOCOL_ACCESS_KEY_SECRET. However, when I attempt to upload a file on Studio, an exceptional error occurs.

url: 
method: post

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Open Page 'studio'
  2. Click on 'storage'
  3. Click on 'Upload files'
  4. See error

Expected behavior

Normal file upload.

Screenshots

Buckets-Supabase Desktop-screenshot Desktop-screenshot (1)

System information

Additional context

unfazed2049 commented 3 months ago

i am sorry, i miss the error infomation.

url: http://localhost:8000/storage/v1/object/test/archive.png
method: POST
{
    "statusCode": "500",
    "code": "S3Error",
    "error": "Could not load credentials from any providers",
    "message": "CredentialsProviderError"
}
fenos commented 3 months ago

Hi @unfazed2049

The environment variables that you need to set are:

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=

These will grant permission to your Minio server. You can take a look here: https://github.com/supabase/storage/blob/master/docker-compose.yml#L28-L34

To clarify, these credentials prefixed with S3_PROTOCOL are controlling Storage's own S3 protocol. In this case the below envs, will set specific credentials for the client to use via the S3 protocol.

S3_PROTOCOL_ACCESS_KEY_ID
S3_PROTOCOL_ACCESS_KEY_SECRET
fenos commented 3 months ago

If you need any more help just drop a message, but I'm pretty sure that setting the right envs will fix the issue.

unfazed2049 commented 3 months ago

Hi @unfazed2049

The environment variables that you need to set are:

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=

These will grant permission to your Minio server. You can take a look here: https://github.com/supabase/storage/blob/master/docker-compose.yml#L28-L34

To clarify, these credentials prefixed with S3_PROTOCOL are controlling Storage's own S3 protocol. In this case the below envs, will set specific credentials for the client to use via the S3 protocol.

S3_PROTOCOL_ACCESS_KEY_ID
S3_PROTOCOL_ACCESS_KEY_SECRET

Thanks for your reply! i didn't know aws-sdk read then env variable, so i make a mistake. BTW, Hope you have a great time!