lazywithclass / winston-cloudwatch

Send logs to Amazon Cloudwatch using Winston.
MIT License
258 stars 104 forks source link

InvalidParameterException: 1 validation error detected: Value '[]' at 'logEvents' failed to satisfy constraint: Member must have length greater than or equal to 1 #136

Open xtr0 opened 4 years ago

xtr0 commented 4 years ago

Sometimes they come back - #55

As far as I understand from the code the issue appears if uploadRate is less then the time required to upload logs AND the logStreamName changes between iterations

Simple code to reproduce (and logs): https://github.com/xtr0/issues-winston-cloudwatch/tree/change-logstreamname-upload-iterations-overlap

PS: winston-cloudwatch 2.3.2 & winston 3.3.3

xtr0 commented 4 years ago

to be honest I don't think it will be an issue in a real scenario as nobody will change logStreamName on every call... I got this error while was doing some synthetic test

lazywithclass commented 4 years ago

I will mark this as bug nonetheless as it may be suggesting a deeper problem in the implementation.

Thanks for opening this issue.

lvillacin commented 2 years ago

Yup same here, getting the error

rawpixel-vincent commented 1 year ago

this fix the issue for me https://github.com/StenAL/winston-cloudwatch/pull/1 (based on https://github.com/lazywithclass/winston-cloudwatch/pull/214 to test)

fwiw it does happen when logStream name changes

that fix doesn't feel right, I think there's probably something deeper to fix, maybe something around log events loosing their log stream name target when the log stream changes between the event is buffered and the upload is triggered.