Support » Plugin: Mailchimp for WooCommerce » Sync stuck between Mailchimp and Woocommerce

  • Resolved gherget

    (@gherget)


    Hello,

    Mailchimp for Woocommerce stops syncing. As of today, I have all the latest WordPress and Woocommerce updates installed.

    These are the last messages I got in the “Mailchimp for Woocommerce” log:

    2019-07-23T11:49:20+00:00 NOTICE coupon_sync.success :: update promo rule :: #1300
    2019-07-23T11:49:20+00:00 DEBUG MailChimp_WooCommerce_Process_Coupons@handle :: queuing up the next job
    2019-07-23T11:49:22+00:00 DEBUG MailChimp_WooCommerce_Process_Coupons@handle :: coupons :: completing now!
    2019-07-23T11:49:22+00:00 NOTICE coupon_sync.completed :: Done with the coupon sync.

    On my server, I’ve following error in the web server log:

    [Tue Jul 23 11:47:58.803545 2019] [proxy_fcgi:error] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught TypeError: Argument 1 passed to MailChimp_WooCommerce_PromoCode::fromArray() must be of the type array, null given, called in /home/runcloud/webapps/mr-bojli/wp-content/plugins/mailchimp-for-woocommerce/includes/api/class-mailchimp-api.php on line 1340 and defined in /home/runcloud/webapps/mr-bojli/wp-content/plugins/mailchimp-for-woocommerce/includes/api/assets/class-mailchimp-promo-code.php:215\nStack trace:\n#0 /home/runcloud/webapps/mr-bojli/wp-content/plugins/mailchimp-for-woocommerce/includes/api/class-mailchimp-api.php(1340): MailChimp_WooCommerce_PromoCode->fromArray(NULL)\n#1 /home/runcloud/webapps/mr-bojli/wp-content/plugins/mailchimp-for-woocommerce/includes/api/class-mailchimp-api.php(1316): MailChimp_WooCommerce_MailChimpApi->updatePromoCodeForRule('5d36f2c205445', Object(MailChimp_WooCommerce_PromoRule), Object(MailChimp_WooCommerce_PromoCode), false)\n#2 /home/runcloud/webapps/mr-bojli/wp-content/plugins/mailchimp-for-woocommerce/includes/processe...', referer: https://www.mr-bojli.hu/wp-json/mailchimp-for-woocommerce/v1/queue/work

    Thank you,
    Gabor

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support khungate

    (@khungate)

    Hi Gabor, sorry to hear you’re having issues with the plugin, we definitely want to try to help out. Just to get a handle on the situation you’re experiencing, could you provide a few more pieces of information to help us understand the issue?

    – What plugin version are you using?
    – Are you on a shared hosting plan?
    – What PHP version are you using and what is the memory limit is set to?
    – Do you have any caching plugins or services running?
    – Have you tried a fresh uninstall or reinstall?

    Thanks in advance for these details. I’ll keep an eye out for your reply.

    Sure, please find my details below:

    – What plugin version are you using?
    Version 2.1.17
    – Are you on a shared hosting plan?
    I manage my server with the help of the server management tool Runcloud and use Cloudflare also (caching is bypassed for all admin sites). Web Application Stack: NGINX + Apache2 Hybrid
    – What PHP version are you using and what is the memory limit is set to?
    PHP 7.3 and MEMORY_LIMIT: 256MB
    – Do you have any caching plugins or services running?
    W3 Total Cache (Page Cache and Browser Cache enabled only)
    – Have you tried a fresh uninstall or reinstall?
    Yes, I have tried fresh uninstall and reinstall of the plugin.

    Thank you, Gabor

    Plugin Author ryanhungate

    (@ryanhungate)

    @gherget we’re going to need to do some checks and balances to see if your server has been blocked by Akamai. When you’re getting a NULL response in an api request we need to take a hard look into why it’s happening.

    https://github.com/mailchimp/mc-woocommerce/issues/318 goes over another thread of problems that are very similar to your issue.

    We should try this first. Log into your server with SSH, and try to make a CURL request to the Mailchimp API… please follow this post to proceed. https://github.com/mailchimp/mc-woocommerce/issues/318#issuecomment-456936594

    Once you’ve done that, we need to see if you’re getting a valid JSON response or if you’re getting a 503 error coming from Akamai.

    Would you be able to do that for us first to see if the problem has anything to do with the IP of your server?

    I did a curl from my server and received a well formatted JSON.

    1. curl -v -X GET https://us19.api.mailchimp.com/3.0/ecommerce/stores?apikey=###
    2. well formatted JSON, starting as follows (replaced content with ### due to privacy…):
      {
          "stores": [
              {
                  "id": "###",
                  "list_id": "###",
                  "name": "Mr Bojli",
                  "platform": "woocommerce",
                  "domain": "https://www.mr-bojli.hu",
                  "is_syncing": true,
                  "email_address": "szia@mr-bojli.com",
                  "currency_code": "HUF",
                  "money_format": "Ft",
      ...
    Plugin Author ryanhungate

    (@ryanhungate)

    @gherget thanks for that info. That at least shows us that the server itself using raw curl without PHP.

    I’m wondering if it has anything to do with your IP address that’s being used for PHP CURL possibly getting in the way. Do you know whether or not you’ve got more than 1 IP address on your machine?

    We may need to get into a more specific setup for the plugin if that’s the case… we’ve got options that might come in handy right now.

    Use a specific outbound IP…

    define('MAILCHIMP_USE_OUTBOUND_IP', 'your.ip.here');

    Sometimes this is what’s causing the trouble and it’s very hard to see with the human eye.

    We will do our best to try and simulate this environment as time permits, but this seems as if Mailchimp is blocking the request, or that possibly your server is not able to make a CURL request with CURL_HTTP_VERSION_1_1.

    Keep us posted if any of this works. We will do the same.

    My server has one dedicated outbound IP address.

    I’ve reset the WP plugin, created a new API key and also removed and reset the connection within Mailchimp. New orders including their products will be added to Mailchimp now. The sync itself is still stuck and previous orders won’t be added to Mailchimp. (wp-cron.php will be triggered every 5min)

    I also couldn’t find any errors in the log why the sync stopped.

    Thank you,
    Gabor

    Plugin Support khungate

    (@khungate)

    @gherget, If you don’t see a button for this on the sync tab, you can force a historical sync by adding in &resync=1 to the query string in the URL and reload the page that way. You should see the re-sync option at that time.

    If that doesn’t fix the problem we’ll be happy to continue troubleshooting with you.

    Perfect, now existing orders will synced as well!

    Thank you very much,
    Gabor

    Problem solved.

    Plugin Support khungate

    (@khungate)

    Glad to hear that fixed the issue @gherget! If anything else pops up, don’t hesitate to reach back out to us. We really appreciate you using the plugin. If it’s working well for you and your business, please consider leaving us a positive review.

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.