Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Files Uploading to Default Bucket Despite Specified Bucket-ID #216

Closed
SysoevIgor opened this issue Aug 12, 2024 · 6 comments
Closed

Files Uploading to Default Bucket Despite Specified Bucket-ID #216

SysoevIgor opened this issue Aug 12, 2024 · 6 comments

Comments

@SysoevIgor
Copy link

Hi, I’m using nhost/hasura-storage:0.6.1. I added a new bucket to the buckets table, and when uploading, I specify the new bucket-id. The entries in the files table successfully receive the new value, but all the files I see in MinIO are uploaded to the default bucket. Is this the expected behavior, or did I miss specifying some necessary parameters?

1 2
@dbarrosop
Copy link
Member

Hello,
thanks for the report. Could you, provide step by step instructions on how to reproduce?

Thanks

@SysoevIgor
Copy link
Author

I simply created a bucket called ‘trailers’ in Hasura (the buckets table) and created the same one in MinIO. Then I ran example_curl.sh, where I changed the BUCKET (bucket-id). The files were sent, but only to the default bucket.

@dbarrosop
Copy link
Member

Thanks for the explanation. I think this a misunderstanding, hasura-storage's buckets don't map into minio buckets. No matter of which bucket you upload to in the request the file will be uploaded to the bucket you configured on the service when starting it. hasura-storage's buckets are a specific construct of the service to group configuration and permissions so the only thing that setting bucket-id header does is set the appropriate column files.bucket_id, which based on your screenshot works as intended.

Closing as I don't think there is anything to do here but if you have any questions don't hesitate to comment. Thanks again.

@SysoevIgor
Copy link
Author

Alright, I understand, thank you. If it’s not possible to change the bucket, is there a way for me to upload a file to a specific folder (which might not yet be created), or will all files be uploaded to the root folder in minio?

@dbarrosop
Copy link
Member

That depends on the underlying storage. For instance, s3 doesn't have folders per se but their UI will "pretend" there are folders if you set as filename somefolder/myfile.txt. This is just a UI thing as S3 doesn't really care about files and/or folders (everything is an object). To support that kind of behavior you can do the same with hasura-storage, you can set as filename a full path if needed. My guess is that minio will do the same that s3 does in this regard. So, in summary, just set as filename the full path; /path/to/file.txt.

@SysoevIgor
Copy link
Author

Ok, thank you, I’ll give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants