Intermittent API Errors (500 Internal Server Error)

My Mautic version is: 4.4.2
My PHP version is: 8.0.24
My Database type and version is: MySql 8.0.28

My problem is:
I have successfully installed Mautic self-hosted (2 core, 4GB mem) and am using it for multiple campaigns/emails/contact mgmt/etc.

I am using the API to add contacts to segments/trigger campaigns and every now and then I get 500 Internal Server Errors intermittently.
ex. POST https://mymautic.com/api/segments/<segmentId>/contact/<contactId>/add

I don’t see anything crazy in the CPU/Memory logs, in fact, the instance is underutilized!

These errors are showing in the log:

Looking at the log in the System Info page, I see stuff like the following happening every hour or so:

I understand there’s a FK violation going on but I don’t understand why it’s happening. Is it b/c for ex. there’s already a user in the segment/campaign or…?

Steps I have tried to fix the problem:

I’ve added retries client side…but that doesn’t solve the root cause of course :confused: