Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When the Mailchimp API returns a 500 error it causes MailchimpGuzzleHttpClient to throw a 500 error. This causes any page the mailchimp form shows up on to also throw a 500 error.
Uncaught PHP Exception Mailchimp\\MailchimpAPIException: "500: Internal Server Error - A deep, internal error has occurred during the processing of your request. Please contact support." at /var/www/html/site/web/modules/contrib/mailchimp/lib/mailchimp-api-php/src/http/MailchimpGuzzleHttpClient.php line 64
Comment | File | Size | Author |
---|---|---|---|
#5 | mailchimpguzzlehttpclient-500-error-3000365-5.patch | 7.29 KB | NickDJM |
| |||
#2 | mailchimpguzzlehttpclient-500-error-3000365-2.patch | 596 bytes | NickDJM |
|
Comments
Comment #2
NickDJM CreditAttribution: NickDJM commentedNot a great solution, but for now I have commented out the
throw new MailchimpAPIException
after its already caught the initial exception from the API itself.Comment #3
firewaller CreditAttribution: firewaller commentedThis issue is happening is Drupal 7 as well, taking down the site when Mailchimp API is having issues. The above patch works, but does not seem like a longterm solution.
Comment #4
lindsay.wils CreditAttribution: lindsay.wils commentedAlso getting a similar issue. We have a mailchimp form sitting in the footer of the site and when the exception is thrown no page works and the error is shown, essentially taking down the site. Seemed to be only when logged in for some reason. A cache clear fixed the issue. temporarily.
The website encountered an unexpected error. Please try again later.Mailchimp\MailchimpAPIException: 404: Resource Not Found - The requested resource could not be found. in Mailchimp\http\MailchimpGuzzleHttpClient->handleRequest() (line 64 of /srv/bindings/c8c607c098304952a3f6fabf2cfaac8b/code/vendor/thinkshout/mailchimp-api-php/src/http/MailchimpGuzzleHttpClient.php).
Comment #5
NickDJM CreditAttribution: NickDJM commentedI've done a little more digging into this issue and I found 2 API calls that aren't inside of a try/catch block which seems to be the cause of this issue.
I've changed the patch up to add 2 try/catches to the module file. It looks like it's solving the issue for our website, hopefully others can confirm or expand on the issue.
Comment #6
StijnStroobantsReviewed the patch and successfully applied.
Comment #7
mshaver CreditAttribution: mshaver commentedComment #9
samuel.mortensonThis fix makes sense to me, thanks all!