Closed nkalinov closed 1 year ago
Hello @nkalinov 👋 Thanks for getting in touch. Unfortunately, I am not an expert in the library you are using. Can you please provide a repository with a minimal example? In this case, I could have a look myself.
I'm using the latest official client - "@aws-sdk/client-s3": "^3.301.0" Here's a simple repo with the script that I'm trying, hope that's useful - https://github.com/nkalinov/issue-repro-s3ninja It prints "Body has transformToString method: true" and then hangs.
Hello @nkalinov! I just saw by coincidence that you have updated your comment with a link to an example – many thanks! And sorry for my late reaction, I do not get notifications for edits. In any case, I will have a look and get back to you asap.
Hi @nkalinov! I just happened to have time to check the reported issue. Your example did not work out of the box for me. I fixed it by adding a region
and credentials
to the configuration struct:
import {GetObjectCommand, S3Client} from '@aws-sdk/client-s3';
import {fromIni} from '@aws-sdk/credential-providers';
const s3Client = new S3Client({
endpoint: 'http://localhost:9444',
region: 'us-east-1',
credentials: fromIni({profile: 's3ninja'}),
forcePathStyle: true,
...
Using the latest versions of the SDK, ^3.353.0
, all looks good here. I run S3 Ninja directly, outside of Docker, and I made sure that the object I am querying actually exists.
So, unfortunately, I do not see a way a change in this project could help you resolve the issue. I am sorry. 😔
Please reopen the issue if you have further questions, remarks, etc.
As soon as I try to parse the Body stream using various methods the process hangs. My sample code:
It doesn't throw nor it gets to console.log, it just hangs. I also can't see any activity in the Access Logs. Given the above I am not even sure if it hits the container. I have mapped
ui-shell.localhost
to127.0.0.1
in /etc/hostTo help debugging I enabled logger on the S3 client and here's the output after the above GetObjectCommand:
Body is
IncomingMessage
- I guess that's whyBody.transformToString()
doesn't work? Any ideas what could be wrong?