cwh
cwh copied to clipboard
Getting error: The batch of log events in a single PutLogEvents request cannot span more than 24 hours
Lumen version: 5.6 package version: v1.1.14
Recently I started getting this error while running my lumen application: The batch of log events in a single PutLogEvents request cannot span more than 24 hours.
Eexception 'Aws\CloudWatchLogs\Exception\CloudWatchLogsException' with message 'Error executing "PutLogEvents" on "https://logs.us-east-1.amazonaws.com"; AWS HTTP error: Client error: `POST https://logs.us-east-1.amazonaws.com` resulted in a `400 Bad Request` response:
{"__type":"InvalidParameterException","message":"The batch of log events in a single PutLogEvents request cannot span mo (truncated...)
InvalidParameterException (client): The batch of log events in a single PutLogEvents request cannot span more than 24 hours. - {"__type":"InvalidParameterException","message":"The batch of log events in a single PutLogEvents request cannot span more than 24 hours."}'
GuzzleHttp\Exception\ClientException: Client error: `POST https://logs.us-east-1.amazonaws.com` resulted in a `400 Bad Request` response:
{"__type":"InvalidParameterException","message":"The batch of log events in a single PutLogEvents request cannot span mo (truncated...)
in /application/path/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
Stack trace:
...
Is anyone familiar with this type of error? Does this error mean the log stream was pushing logs for more than 24 hours? Can this package handle log streams that old?
Thanks for your help.
Also seeing this though it appears to be incredibly rare. Digging into why this might occur.
Also getting this, but it's related to when there are few enough requests that it doesn't trigger the batch to be sent until after 24 hours.
I know it is explicitly written in the documentation that this is the case (phpdoc on the method) but maybe we should have some way to flush the batch after a certain period?
This is fixed by https://github.com/maxbanton/cwh/pull/107
This is fixed by #107
do you know when it will be merged ?
Hi guys, it's a little bit hard to maintain war-work-life balance, so sorry for delay. PR is already merged and new version v2.0.3 has been published. Please test it an let me know if everything is ok. Thanks.
Oh man, thanks so much @maxbanton. Will work off a fork rather than put any undue additional pressure on you if there are future issues that need an urgent fix.
Thanks @maxbanton and sorry to hear that.