node-red / node-red-web-nodes

A collection of node-red nodes aimed at web services
Apache License 2.0
226 stars 157 forks source link

S3 Upload node - hangs after error #212

Open younesmaia opened 6 years ago

younesmaia commented 6 years ago

If there is an error during an upload, the node will not upload the next file that is presented to it. It will stay in this stat until there is a redeploy. The expected behavior for the node is to try to upload the next file that comes, regardless if the last upload was successful or not.

dceejay commented 6 years ago

do you have an example flow you can share ? (obvs not with a keys etc)

younesmaia commented 6 years ago

Actually, the flow just consists of a Camerapi node directly connected to an S3 upload node. msg.payload will contain a JPG image within the buffer. This works pretty well, but if there is a period of no connectivity and a picture is dispatched to the upload node within this time window, the node will throw an error (red dot). If another picture comes later, the node will continue stuck on the error until there is an redeploy. This should be changed. It is important that the node tries uploading the next picture / file every time a new message arrives to the node. It might throw the error again if there is a new failure, and print that to the debug tab.

My flow:

[ { "id": "ae4991d1.d9ea4", "type": "camerapi-takephoto", "z": "bddefc6e.c6cdb", "filemode": "0", "filename": "", "filedefpath": "1", "filepath": "", "fileformat": "jpeg", "resolution": "6", "rotation": "0", "fliph": "0", "flipv": "0", "brightness": "50", "contrast": "0", "sharpness": "0", "imageeffect": "none", "name": "Take Photo", "x": 582, "y": 302, "wires": [ [ "56545602.fd33d" ] ] }, { "id": "a9df0f62.89fd08", "type": "inject", "z": "bddefc6e.c6cdb", "name": "Take picture", "topic": "", "payload": "", "payloadType": "date", "repeat": "", "crontab": "", "once": false, "x": 402, "y": 302, "wires": [ [ "ae4991d1.d9ea4" ] ] }, { "id": "56545602.fd33d", "type": "amazon s3 out", "z": "bddefc6e.c6cdb", "aws": "", "bucket": "xxxREDACTEDxxx", "filename": "", "localFilename": "", "region": "sa-east-1", "name": "Upload photo to AWS S3 bucket", "x": 793.5000305175781, "y": 244.3333339691162, "wires": [] } ]