-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
helm chart minio bug + extension upload bug #2067
Comments
we will get there, i think there is a knock on effect with creating / saving plugins
|
@hm2075 yes, those two are indeed the root causes. Seems like some special characters are double encoded while generating the signed URL. I was able to work around this by writing a little service to create the signature correctly, and then calling it from the nginx lua script, right between the call to the server and minio. Was just too hackish to contribute the fix into the GitPod repo 😄 |
Yes, I noticed that I had to decode the url @corneliusludmann the first fix is easy but I couldn't see how the url is generated for the second issue |
ran a complete trace on this from mc admin tools
this is what is causing the failure with uploading extensions
f @jgallucci32 download https://docs.min.io/docs/minio-client-quickstart-guide.html minio client, windows binaries available hunting down the code on gitpod that is generating the url as @arleif-dfactory said, double encoded credential ? ` if ($action = preflight) {
}` |
C:\Development>mc admin trace -v local |
the get request is fine, and then on the put request we see the credentials are encoded and signature is probably wrong too |
@hm2075 I was able to get a valid request on the PUT by replacing the |
can we log this ngx.var.targetUrl = response.body;
and see what the response.body is? looks to me it is doing a preflight check without issue, then using the response body for the put request |
I'll see if I can get that to log. Side note, I also replaced |
@jgallucci32 @hm2075 |
Thanks @arleif-dfactory I confirm that is exactly the same request I see in wireshark capture of the request. It looks like the character |
From this page https://www.npmjs.com/package/aws4 I noticed the following
Looking at 568 // Content-Type has to match exactly with the `getSignedUrl` request from gcloud-storage-client.ts
569 // otherwise the upload will fail with a "signature does not match" error.
570 'Content-Type': '*/*',
571 'Content-Length': stat.size So it is quite possible the changing of the Content-Type and removing the |
Explains why cloud gcp works but selfhosted doesnt What would happen if we patch the response.body and do a replace in the conf file ? |
here's my hack job edit chart\config\proxy\lib.gitpod-plugins.conf response.body = response.body:gsub("%%252F", "%%2F"); needs a double % to escape otherwise lua thinks we are looking at a regex I dont think this is a valid fix, more like a patch job on the helm templates |
@hm2075 You were on the right track. It looks like the correct function is I created #2072 which escapes the URI using the nginx function. |
Excellent , We still need to fix the first issue though , whereby server deployment has hard coded minio values. |
@hm2075 I'm unable to reproduce the initial issue. I deployed Gitpod v0.5.0 self-hosted into a native-Kubernetes deployment using Rancher and it worked with both the default Minio values as well as overwritten values for s3gateway functionality. I do think I see what the issue might be. When I configured Minio to be an s3gateway I had to set the minio values in two places. It has to be defined at the high-level as well as in the components:
wsSync:
remoteStorage:
minio:
accessKey: "XXXXXXXXXXXXXXXXXXX"
secretKey: "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
minio:
accessKey: "XXXXXXXXXXXXXXXXXXXX"
secretKey: "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy" NOTE: X and y must match exactly in the two sections. I think this is the hard-coded part which needs to be fixed as it should only need to be referenced once. |
Thank you very much for investigating this, @jgallucci32 @hm2075 @arleif-dfactory! Awesome contribution! And thanks for the PR #2072, @jgallucci32. I'll take care that this one will be reviewed soon! I'll also have a look at the initial issue of whether we need to fix the |
Glad to see this is getting worked on 😄 |
Describe the bug
when a user sets up their own instance of minio, gitpod server deployment continues to use hard coded values
update chart/templates/server-deployment.yaml
replacing these hard codes values with those from values.yaml
with a linked issue on uploading extensions, users using minio pod or external minio are unable to upload extensions
The text was updated successfully, but these errors were encountered: