Problem/Motivation
We're seeing these errors on
[ERROR] [aws_cloudwatchlogs] [2024-03-08T01:15:59] Error executing "PutLogEvents" on "https://logs.eu-central-1.amazonaws.com"; AWS HTTP error: Client error: `POST https://logs.eu-central-1.amazonaws.com` resulted in a `400 Bad Request` response:
{"__type":"InvalidParameterException","message":"Log event too large: 2749925 bytes exceeds limit of 262144"}
InvalidParameterException (client): Log event too large: 2749925 bytes exceeds limit of 262144 - {"__type":"InvalidParameterException","message":"Log event too large: 2749925 bytes exceeds limit of 262144"} | 0 | https://cms.prelive.infoportal.vw-group.com/ | | 127.0.0.1 |
Steps to reproduce
Not sure how to reproduce.
Proposed resolution
Ensure the log message gets always written and worst-case is truncated, but never not-written.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 3427553-aws_cloudwatchlos-invalidpamaterexception-6.patch | 1.86 KB | useernamee |
Issue fork aws_cloudwatchlogs-3427553
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
useernamee commentedI've investigated the issue a bit and found the max batch size limit on PutLogEvents.
https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API...
So I've added some logic that truncates the message to 256kb if it is too long.
Comment #4
useernamee commentedI've also created a patch so that it can be added to project composer patches.
Comment #5
useernamee commentedComment #6
petar_basic commentedComment #7
useernamee commentedHad a minor issue in the patch and I fixed that.
Comment #9
useernamee commentedMerged