Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error: The batch of log events in a single PutLogEvents request cannot span more than 24 hours #96

Closed
webkod3r opened this issue Jun 29, 2021 · 7 comments

Comments

@webkod3r
Copy link

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.

@roborourke
Copy link

Also seeing this though it appears to be incredibly rare. Digging into why this might occur.

@lucasantarella
Copy link

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?

@jackwakefield
Copy link
Contributor

This is fixed by #107

@cbulgariu
Copy link

This is fixed by #107

do you know when it will be merged ?

@maxbanton
Copy link
Owner

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.

@roborourke
Copy link

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.

@webkod3r
Copy link
Author

webkod3r commented Nov 8, 2022

Thanks @maxbanton and sorry to hear that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants