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.
An error occurred requesting list information from MailChimp. "cURL error 28: Operation timed out after 60000 milliseconds with 0 bytes received (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)"
It is showing the error location as the homepage, where I have a newsletter signup form.
Any thoughts on what may be wrong here?
I'm using 1.0.2 of the API.
Usually if I reload the page, it loads quickly without an error the second time, so I guess this could be a caching issue.
Comment | File | Size | Author |
---|---|---|---|
#39 | mailchimp-curl-error-custom-timeout-d7-2768455-39.patch | 2.04 KB | firewaller |
#37 | high_curl_timeout_ca-2768455-37.patch | 3.11 KB | szeidler |
| |||
#29 | mailchimp-curl-error-custom-timeout-2768455-29-D8.patch | 3.11 KB | NickDJM |
| |||
#28 | mailchimp-curl-error-custom-timeout-2768455-28-D8.patch | 3.08 KB | NickDJM |
| |||
#21 | mailchimp-curl_timeout_2768455-21-D8.patch | 2.57 KB | szeidler |
|
Comments
Comment #2
webdrips CreditAttribution: webdrips commentedComment #3
Perignon CreditAttribution: Perignon commentedTimeouts on curl are usually related to network issues, not code issues. I am using the module and code right now in development and I do not have any timeout errors.
But do make sure you upgrade Guzzle for the HTTP_PROXY vulnerability that was released yesterday.
Comment #4
bsnodgrass CreditAttribution: bsnodgrass commentedduplicated this with Mailchimp VERSION = '1.0.5';
Composer involved, trying to solve now
I find my API matches composer.json
composer.lock has no mailchimp identified
.. One more thing I am running php 7.0. on Pantheon - Latest versions: Drupal 7.56, Mailchimp 7.x-4.8 using mailchimp subscription form.
(Hi Dan)
Comment #5
bsnodgrass CreditAttribution: bsnodgrass at net2Community, Inc. commentedComment #6
johndubo CreditAttribution: johndubo commentedbsnodgrass, I am running on the same specs (php 7.0. on Pantheon, Drupal 7.56, Mailchimp 7.x-4.8) and have a similar timeout issue (503 first byte timeout) on the campaigns page. My library version is 1.0.6.
Another note: on Friday, I upgraded to Pantheon's new CDN and the timeout problem seems to have started since then.
Comment #7
delta CreditAttribution: delta as a volunteer commentedI've got the same error a few time since we are using this module, it happens on user registration or when user edit their account
No way to add a catch of the error and put a shorter timeout... like 3 seconds that sounds already a lot, but here it's 60 seconds timeout and before first bytes received, I mean after 3 seconds if first bytes not received, there is most likely an issue with the distant server and our connection is stuck and will not succeed...
Comment #8
firewaller CreditAttribution: firewaller commented+1
Comment #9
ahimsauzi+1
Comment #10
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedThe comment in https://cgit.drupalcode.org/mailchimp/tree/mailchimp.module?h=7.x-5.x#n172 is quite ironic. Everyone would consider 60 seconds as being down :)
Is there a specific reason, that we pass such a high value in here? The PHP Library itself has the default of 10 seconds, which would be much more reasonable, if the Mailchimp service is struggling. I would vote for making it configurable via a variable and use a more sensible default.
The Mailchimp Signup forms are usually not critical parts of the website and shouldn't cause such drastic side-effects.
Comment #11
minorOffense CreditAttribution: minorOffense at Coldfront Labs Inc. commentedAn outage at MailChimp definitely should not cause a Drupal site to break. Need some better error handling.
Comment #12
minorOffense CreditAttribution: minorOffense at Coldfront Labs Inc. commentedWe have a rudimentary patch here https://www.drupal.org/project/mailchimp/issues/3000365
Not the best solution but it at least it stops the thrown exception from throwing second time.
Comment #13
firewaller CreditAttribution: firewaller commentedWe had to put our site in maintenance mode in the meantime. Reducing the timeout from 60s to something reasonable sounds right, but preventing the errors from taking down the site sounds like the best approach.
Comment #14
firewaller CreditAttribution: firewaller commentedThe approach from #12 worked for me, but there are still a few non-critical errors thrown by the mailchimp modules. I've added a few isset checks to the patch attached. Please note, this does not fix the critical issue above, it just supplements it.
Comment #15
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedError handling is one part. A more sensitive timeout is required, too.
Otherwise errors, that are not returned immediately from Mailchimp (like non slow/non responding servers) will still cause huge loading times.
Comment #16
minorOffense CreditAttribution: minorOffense at Coldfront Labs Inc. commentedYeah it would likely make sense to use a local cache of the data from mailchimp and then update that. So Drupal can always fallback to it's own copy of whatever mailchimp last sent. And then the updates to the data happen on cron or something.
That way long timeouts or outages aren't tied to page loads.
Comment #17
firewaller CreditAttribution: firewaller commentedI don't know if this will resolve the performance issue, but attached is a separate patch addressing the hardcoded 60 second timeout. This allows for a configuration to override it.
Comment #18
firewaller CreditAttribution: firewaller commentedThis is less of a priority now that Mailchimp API is working again, can we look to resolve this before it happens again?
Comment #19
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedWe're again experiencing connectivity issues to the Mailchimp service, which drastically slows down the site. Patch #17 solves it with a configurable variable and works fine.
Comment #20
Anonymous (not verified) CreditAttribution: Anonymous at Netuxo Ltd (RIP) commentedThis seems to also happen with mailchimp for D8. Any port of the patch to D8?
Comment #21
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedThe following patch should do it. Take care, that might need to set the timeout value manually in admin ui, because I didn't wanted to write a update hook, that might mess up the update hook numbers.
Comment #22
esolitosPatch for 7.x and 8.x both look good.
Update hook is required for #21 before it can be committed, but the 7.x is RTBC!
Comment #25
firewaller CreditAttribution: firewaller commentedCan we look into merging this before there is another Mailchimp API outage?
Comment #26
bisonbleu CreditAttribution: bisonbleu commentedI'm running into a similar timeout issue but with the Campaigns tab (/admin/config/services/mailchimp/campaigns). Not 100% sure it's related, but I'm guessing it is. So setting back to 'needs work' in case it is.
I manually applied the patch in #17 to Mailchimp 7.x-4.11 (Drupal 7.64), I can now set MailChimp API Timeout. I have 76 campaigns. So I bumped the timeout to 120s and flushed all caches before clicking the Campaigns tab...
Strangely, it timed out after just 60s and the watchdog (which I emptied just before) is filled with 128 pages of Notices (6300!)
23 PHP notices,
and 23 mailchimp_campaign errors.
Update - In case it is useful: all this on the dev environment of a Pantheon.io hosted website.
Comment #27
bisonbleu CreditAttribution: bisonbleu commentedReporting back after more tests.
I was able to somewhat solve my problem: I'm now able to display the Campaigns tab, although it takes forever every time I load the Campaigns tab. Here are a few interesting notes.
Comment #28
NickDJM CreditAttribution: NickDJM commentedHere's #21 with an update hook.
Comment #29
NickDJM CreditAttribution: NickDJM commentedRe-rolled for latest version of 8.x
Comment #30
esolitosReroll looks as fine as the others.
Comment #31
joekrukoskyPatch from #17 didn't completely work for me with version 7.x-5.6. Here's an updated patch.
Comment #32
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedAs we have working patches for Drupal 8 and Drupal 7, I'm changing this issue to target 8.x-1.x-dev to gain attention.
Unplanned or planned outages (https://twitter.com/MailchimpStatus/status/1222489554864787456) can still "take your sites down", when not having the patches applied.
Comment #33
esolitosSmall suggestion for #29 8.x patch.
I suggest that the default timeout should be lower from the start.
for any external service like mailchimp 10 seconds should more than enough to answer back.
Comment #34
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedI agree with it. You need to see the end user perspective. If the end user needs to wait 60s, because Mailchimp is not responding, he would have already considered the page to be down.
Comment #35
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedAs suggested in #33, I reduced the default timeout to 10 seconds. So we're doing what the Mailchimp PHP library does too.
Comment #36
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedAlso using the 10 seconds in the update hook.
Comment #37
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedLet's try this.
Comment #38
brendanthinkshout CreditAttribution: brendanthinkshout at ThinkShout commentedD8 patch looks good to me, but it looks like @joekrukosky's reroll no longer applies in D7. If we can get that rerolled and reviewed then we can add this to the next release. @aprice42, do you have any time to take a look?
Comment #39
firewaller CreditAttribution: firewaller commentedAttached is a re-roll of #31 (still works) against 7.x-5.x
Comment #40
firewaller CreditAttribution: firewaller commentedComment #41
gcbComment #46
gcb