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

Error using a subdomain style s3 repo #208

Open
bestmazzo opened this issue May 13, 2024 · 2 comments
Open

Error using a subdomain style s3 repo #208

bestmazzo opened this issue May 13, 2024 · 2 comments

Comments

@bestmazzo
Copy link
Contributor

bestmazzo commented May 13, 2024

Hello,
I've been successfully using hasura-storage 0.6.0 in a staging environment, leveraging a minio service, in a k8s architecture.

Now I'm planning to move to a production env, and there I'll be using s3 in a subdomain hosted by a third party provider.
The endpoint will be in the form https://{BUCKET_NAME}.{REGION}.myprovider.com

So I set the hasura-storage image ENV VARIABLES:
S3_ENDPOINT: https://{BUCKET_NAME}.{REGION}.myprovider.com
S3_BUCKET: {BUCKET_NAME}
S3_REGION: {REGION}

I'm currently having issues with such configuration, as I keep getting a 403 error when trying to upload a file.

 errors="[problem processing request: problem uploading file to storage: problem putting object: operation error S3: PutObject, https response error StatusCode: 403, RequestID: a197b1b2-0f2a-567107630, HostID: , api error SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your key and signing method.]"

Digging into the code, I noticed this line:

o.UsePathStyle = true

So I presume, hasura-storage assumes we're always using a path-style repo, so signature calculation may never be correct in a subdomain scenario

Am I doing something wrong?
Should I just provide ENV VARs in a different form?
Or do we need to make UsePathStyle option available from ENV VARs in order to cover such deployment scenarios?

Thank you for your help

@dbarrosop
Copy link
Member

Or do we need to make UsePathStyle option available from ENV VARs in order to cover such deployment scenarios?

I guess so, I am not familiar with that type of configuration so I can't say for sure.

@bestmazzo
Copy link
Contributor Author

Looking at AWS SDK, seems this could be the right param to change in such scenarios.
I can try and make a PR, but I'm not used to GO programming, so just tell me what you prefer..

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

No branches or pull requests

2 participants