API Contact update returns success response but results in Contact being unable to be viewed due to 500 error

Your software
My Mautic version is: 4.4.6
My PHP version is: 7.4.33
My Database type and version is: MySQL 8

Your problem
My problem is:

I am using the Mautic PHP library as recommended in the docs.

I am able to successfully create and edit contacts using the API (basic auth).

When attempting to update the contact by updating custom fields & applying tags or removing tags I sometimes receive a success response from Mautic but when I attempt to view the in Mautic I get a 500 error.

Unfortunately when checking the /var/logs folder and viewing the files there are no details regarding this error at all.

Really hoping for some insight :slight_smile:

Details of PHP object for contact creation:

(
    [wp_user_id] => 1463985
    [email] => mauticfailedsub7@emaildomain.com
    [firstname] => 
    [lastname] => 
    [dateregistered] => 2023-03-07 01:19:11
    [last_login_time] => 2023-03-07 01:03:19
    [communications_opt_in] => 1
    [user_occupation] => Podcaster
    [membership_status] => 
    [membership_level] => 13
    [membership_start_date] => 2023-03-07 01:03:19
    [expiration_date] => 
    [phone] => 
    [card_type] => 
    [last_paypalexpress_ipn_id] => 
    [tags] => Array
        (
            [0] => -Membership Payment Failed
            [1] => Basic User
            [2] => -Monthly Gold Subscriber
            [3] => -Yearly Gold Subscriber
            [4] => -Sub Account
            [5] => -Membership Expired
            [6] => -Membership Cancellation Pending
            [7] => -Membership Cancelled
        )

)

Details of Contact update PHP object resulting in 500 error after update:

(
    [wp_user_id] => 1463985
    [email] => mauticfailedsub7@emaildomain.com
    [firstname] => Bon
    [lastname] => Jones
    [dateregistered] => 2023-03-07 01:19:11
    [last_login_time] => 2023-03-07 01:03:19
    [communications_opt_in] => 1
    [user_occupation] => Podcaster
    [membership_status] => 
    [membership_level] => 1
    [membership_start_date] => 2023-03-07 01:03:24
    [expiration_date] => 
    [phone] => 0431111111
    [card_type] => 
    [last_paypalexpress_ipn_id] => 
    [tags] => Array
        (
            [0] => -Membership Payment Failed
            [1] => Monthly Gold Subscriber
            [2] => -Basic User
            [3] => -Membership Expired
            [4] => -Membership Cancellation Pending
            [5] => -Membership Cancelled
        )

)

These errors are showing in the log: No Errors showing in log related to described issue

Steps I have tried to fix the problem: Looking for log information related to the error

You can clear the mautic cache and then try again, and make sure update all fields value correctly for example don’t put string value in multiselect field, that is not mapped in that multiselect field values.

The Mautic team has confirmed the bug on the github repo so theoretically it’s being taken care of there :slight_smile: