lazywithclass/winston-cloudwatch

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

Opened this issue · 4 comments

xtr0 commented

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

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

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

Thanks for opening this issue.

Yup same here, getting the error

this fix the issue for me https://github.com/StenAL/winston-cloudwatch/pull/1 (based on #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.