-
Notifications
You must be signed in to change notification settings - Fork 29
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
Is the AWS S3 library S3-compatible? #50
Comments
Hi @w0rd-driven, I am not the main maintainer, so can't really give you a 100% certain answer but:
Having gone through the code and done some experiments, it seems that after you get your s3 client instance
you can do
and that seems to work for my basic test. But I can't really test it fully as I will need an s3 compliant setup. Hope this helps you for now |
I just realized I posted this on the source GH instead of https://github.com/grafana/jslib.k6.io where it was only minified 🤦♂️. That's the problem I was having debugging as my focus was there and somehow finally made it here. Thank you for that. The host gets me further but I'm still seeing a S3ServiceError
I find it odd that line 297 is for createMultipartUpload and I'm just calling I have been playing with trying to sign requests manually and see if I can piece together something tangible as every manner of When I build the sig myself I get a mix of things but the most consistent is NotImplemented or 501 which is the generic response from Spaces according to the docs: One wrench in this is I'm using Insomnia and the plugin https://www.npmjs.com/package/insomnia-plugin-aws-iam-v4 works with the same credentials hitting the same All of this makes me feel really close. I'll go back through everything starting at zero as it could easily be something obvious in hindsight. I have verified my credentials are coming from I know the runtimes aren't 1:1 here and I know this is difficult for anyone else to replicate without DO Spaces access. If their API keys didn't give access to all buckets (another 🤦) I wouldn't mind sharing it temporarily for debugging purposes. I planned on revoking access after the tests were done anyway. |
That is because you are looking at the current master which has a lot of changes on top of the actually released v0.7.2 k6-jslib-aws/src/internal/s3.ts Line 297 in 5f3d27d
and 62 is the call to it: k6-jslib-aws/src/internal/s3.ts Line 62 in 5f3d27d
I might recommend actually trying to use the master version from the master as it might have been fixed. Unfortunately I am not the main maintainer and I don't know why some of those changes have been put in a release and would prefer to not do that on my own ;) |
Hey @w0rd-driven 👋🏻 Thanks for reporting the issue 🙇🏻 I want to start with a disclaimer: we do not officially support anything other than the official AWS platform and to a certain extent Localstack (but because we use it for testing purposes). That being said, we have had some issues raised by users using either Ceph or MinIO in the past. In the case of S3 support, most of them were linked to the URL generation in one way or another. I would be keen to make the customization of the target more straightforward than it is now, as @mstoykov pointed out, we support controlling the host only at this point. I was planning to timebox a quick test run with MinIO in the near future, but no guarantees that we will reach anything conclusive, and we probably never target officially supporting it either (we just don't have the resources to ensure that at the moment). If you'd be keen to look into it yourself, it should be possible to put together a way to pass the S3 URL scheme in the form of closure or something along those lines. If you were to come up with a Pull Request, I would for sure allocate some time to review it 👍🏻 |
Regarding the disclaimer: That's totally understood and I titled this before I really understood how this all fits together. Thank you tremendously for your help @mstoykov. I think I figured it out through futzing with the body in Insomnia. There is a line for sending the request with an empty body: const res = http.request(method, signedRequest.url, signedRequest.body || '', {
headers: signedRequest.headers,
}) If I duplicate I do see that the code is assigning an empty variable to avoid an If anyone had any tips for how I could inject the body otherwise, I'm open to that approach but I don't think it's possible. Maybe I could get by with duping SignatureV4 where I set Thanks again for the help. |
A quick look through the code show cases that we do use Looking at the A quick look at https://docs.digitalocean.com/products/spaces/reference/s3-sdk-examples/ seems to suggest the only "strange" settting is I couldn't figure out the code where listObject is called in both go or js in 5 minutes. So I am aborting that try. @w0rd-driven are you certain that is the only thing you've changed? I would recommend openning a PR as well. And potentially making a script that is reproducing the issue. Even if we need to provide our own digital ocean credentials taht will be really helpful. |
@mstoykov Indeed, the setting @w0rd-driven, I concur, it would be beneficial if you could put together an example or set of examples that demonstrate the issue to make sure we're all on the same level of understanding and to help us reproduce the issue (I must admit I'm not 100% sure what the actual problem you're experiencing and where is at this point 😸). Could you confirm the exact setup you experience the issue against, I got a bit confused along the way. Thanks a lot 🙇🏻 |
I agree that it makes very little sense and I honestly found it via a fluke by trying Insomnia. I realized sending an empty string would return a similar 503 response which lead me down that rabbit hole. I've rebuilt the script from the ground up starting with 0.8.0 and verified the default implementation still doesn't work just to make certain that wasn't playing tricks. I pulled in just I don't know what other examples I could provide other than |
Hey @w0rd-driven 👋🏻 I finally took the time to look in more depth into this. I could interact with a DO space using the S3 module. It took me a while to get to the bottom of the issue, but my experiments showed that the main issue was that I expect the fix to land in the next version of jslib-aws ( I might also take a stab at #57 and provide an |
I will close this as I believe this is now addressed and will land in Feel free to reopen in case you still encounter issues 🙇🏻 |
I was looking to potentially load test S3-compatible APIs but I think it may be locked into AWS proper as I can't seem to configure the respective endpoint correctly.
A configuration like the following:
Produces output like:
I can change the endpoint to just
.digitaloceanspaces.com
but that produces a URL likehttps://[bucket].s3.sfo2.digitaloceanspaces.com/
which is not correct. It produces an SSL certificate error as the wildcard cert doesn't apply at that extra level I believe (it would need to be ..sfo2).Other S3-compatible stores like Minio wouldn't necessarily have the s3 prefix but if I controlled the domain, I could make the resolution work. I can't control Digital Ocean's domains and something like a CNAME would work in theory but it'd introduce an SSL problem that puts me back to square one.
I think my biggest hurdle to self-discovery is this is also bundled so I can't easily dig into the source to see if I could propose a change or find the incantation I need to alter the outbound URL. Nothing jumps out of the official documentation.
It's also possible this isn't or wouldn't be supported due to other technical reasons that I can't see.
The text was updated successfully, but these errors were encountered: