digitalnodecom / node-red-contrib-generic-s3

Generic S3 nodes for use in Node-RED
https://www.npmjs.com/package/@digitalnodecom/node-red-contrib-generic-s3
Apache License 2.0
3 stars 5 forks source link

Demo uploads with zero bytes #74

Closed ttftw closed 6 months ago

ttftw commented 9 months ago

I'm using your example dashboard from 1.11.3 and have an s3 Space through Digital Ocean which is supposed to be s3 compatible.

When I run your node to put an object, the file is created on DO, but the file is 0 bytes. I don't have an Amazon account to test this with s3 directly, but I wanted to check here to make sure there's not something else I'm missing before talking with DO about what might be wrong.

I've also tries to send an image as bytes and anything I try to send shows up on their end as 0 bytes.


// File contents, in this example object that is later stringified in json
const testJson = {
    "Data": {
        "Exists": true,
        "Testing": "Dummy data"
    },
    "Something": "Other dummy data",
    "Changes": true
}

// Parameters that are later passed to create the object
const objectToCreate = {
    Key: 'TestFile.json',
    ContentType: 'application/json',
    Body: JSON.stringify(testJson),
}

// Object's unique identifier
msg.key = objectToCreate.Key;
// Content type of the object
msg.contentType = objectToCreate.ContentType;
// Object body
msg.body = objectToCreate.Body;
// Is stream flag for the body. Please refer to the docs for how to streamify the body
msg.stream = false;
// Upsert flag for the node
msg.upsert = true;

return msg;
ttftw commented 8 months ago

I used this same code to Amazon S3 and it still is uploading 0 bytes so I must be missing something else here

rristov60 commented 8 months ago

Hi @ttftw, sorry for the delayed response. I checked the examples and unfortunately seems that they are not up to date and for some nodes there are none, which will be patched. Right now I will try to reproduce your issue, and will get back at you with the results from that

rristov60 commented 8 months ago

Quick update on this @ttftw. I've tried to recreate your issue using Scaleway, but unfortunately I was not able to. Just quick note when you said that you've tried to send an image as bytes, I hope that you updated the ContentType header as well, because that plays crucial role. But, when I tried to even mismatch the header(with Scaleway at least), the object was still uploaded with the correct amount of bytes, the retrieving of the object had some issues. Even though this is out of scope of this issue, you can find most common used ContentType header values here, and the list of all available header values here.

Next step that is to try and test with different providers, but I can say that the example successfully uploads 93 bytes when using Scaleway.

Also I am not sure exactly what your configuration is (if you can provide a sample from the flow you are using that would be great, as it will allow me to easily recreate the issue), but please keep in mind that priority is always given to the input fields on the node itself (UI input fields).

rristov60 commented 8 months ago

Hi @ttftw, just wanted to follow up if there is any update from your side on this ?

ttftw commented 7 months ago

No, I eventually just wrote a Python script to do what I need to do. I don't get what was going on, no matter what service I used, it would get 0B payloads. I was just using your demo code, changing the config to point to my service and it would create an empty file with the correct name, but no matter what I tried, I could not get any data to post.

trajche commented 6 months ago

Closing this due to inability to replicate.