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.

Command icon 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

useernamee created an issue. See original summary.

useernamee’s picture

I'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.

useernamee’s picture

Issue tags: -error +AWS
StatusFileSize
new1.85 KB

I've also created a patch so that it can be added to project composer patches.

useernamee’s picture

Status: Active » Needs review
petar_basic’s picture

Status: Needs review » Reviewed & tested by the community
useernamee’s picture

StatusFileSize
new1.86 KB

Had a minor issue in the patch and I fixed that.

  • useernamee committed 9a15b50a on 8.x-1.x
    Issue #3427553 by useernamee, petar_basic: InvalidParameterException:...
useernamee’s picture

Status: Reviewed & tested by the community » Fixed

Merged

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.