Emails no longer being delivered after update to 1.1.1 on Drupal 9

Created on 26 October 2023, about 1 year ago
Updated 23 January 2024, 11 months ago

Problem/Motivation

In preparation of bringing a site I maintain to Drupal 10, I updated this module to the latest branch while the site is still on Drupal 9. However, since doing so, emails seem to have stopped sending through Mailchimp Tranasctional/Mandrill. I'm no expert on email systems, so forgive any naivetΓ© here. Here's what I can say for certain at this point.

1. The site had the Drupal 9 exclusive branch of this module for a while and was configured with settings that worked. No settings were changed before or after updating to version 1.1.1.

2. In Mandrill, in the API logs, I noticed the listed method changed after the update. The working version called the method "/subaccounts/list.json" and then, when the email was marked as delivered, the method "/messages/send.json" appeared in the log. Since the update, attempting to send an email from the site results in a method of "/users/ping.json". Since no email was delivered in version 1.1.1, there is no follow-up method logged.

3. These test emails (password reset requests and test emails sent via the module itself) take about 45 minutes to an hour to land in various inboxes, and sometimes don't ever land. That's true of the working version of the module and may have nothing at all to do with the module. That could be 100% Mailchimp and Gmail. Just wanted to mention it in case.

4. I can't find associated error logs anywhere. I can't tell if Mandrill is even getting the requests, frankly, but it's not obviously failing to handle them.

Any insights here would be amazing. Trying to get my site updated before the end of the month and this module is a critical feature.

Thanks!
Ben

πŸ’¬ Support request
Status

Postponed: needs info

Version

1.1

Component

Miscellaneous

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Bzr
  • πŸ‡§πŸ‡ͺBelgium dieterholvoet Brussels

    Both the subaccounts/list.json and users/ping.json endpoints are only triggered when visiting the module settings form, so those are probably unrelated. Some things to check:

  • Status changed to Postponed: needs info about 1 year ago
  • πŸ‡§πŸ‡ͺBelgium dieterholvoet Brussels
  • Thanks for the reply, DieterHolvoet!

    As far as I've seen, no error shows up in the logs on either side. The only logged notice on the Drupal side I've found is just one that says an email send request was initiated. Seems pretty normal there.

    The templates module is not activated on the site, so no templates should be in use. This is a site I relatively recently inherited dev responsibilities on, so I don't know the deep ins-and-outs, but that doesn't seem to be a factor in the sending problem.

    I can certainly check the database table you mentioned. The tricky point is, this all has to be tested on the live site, which causes total email pause. There shouldn't be anything queued at this point, since reverting the module allowed the emails to send again. If there was anything queue-related in the database, I'm guessing it's gone now. That said, I will have to run another test soon to finish the Drupal 10 update. If I do see the mailchimp_transactional_queue item in the database, what does that imply is happening and what might be a solution?

  • Hey DieterHolvoet,

    Coming back with some more information. I had the chance to run some additional tests, and the issue does seem to be around the queueing. When the "Queue outgoing messages" toggle is off, emails send through Mandrill with no problem. When I turn queueing on, emails stop sending. The "Queue" database table remains empty after attempted sends and cron runs. The information is just not being passed to the database, it seems. I don't get any errors during this process. I tried this with standard password reset requests to make sure nothing custom was standing in the way.

    The site I'm working on is fairly email intensive. It currently sends out a 700+ user email blast on Wednesday nights, and I know the owners are actively looking to increase there userbase. The resources involved in sending all these emails at once could cause timeouts, errors, inaccessibility, etc.

    I looked through the threads and patch notes from version 1.1.0 onward, but nothing stood out to me as a cause of this issue. The queuing mechanism does work on version 1.0.1.

    Any insights

  • πŸ‡§πŸ‡ͺBelgium dieterholvoet Brussels

    Could this maybe be related to πŸ› Drupal cron is not executing mailchimp_transactional_queue Fixed ? That issue was fixed in 1.1.2, have you tried updating?

  • Yes, all my latests tests were all done on version 1.1.2. That issue definitely sounds like the same issue, but not sure why the the fix from that MR hasn't helped in my case.

  • I haven't tried this on the live set yet with actual sending yet, but when I have my test environments upgraded to Drupal 10 the queueing does work. Strongly suspecting it's just a matter of what calls work in what environment. Seems like this won't actually be an issue once the live site is fully upgraded. I'll post an update if I find otherwise.

    Thanks for you help!

  • πŸ‡§πŸ‡ͺBelgium dieterholvoet Brussels

    is trying to use the most recent version on a Drupal 9 site a problem

    It shouldn't be, if there's a problem we should find it.

    Are the methods to initiate queueing in D9 and D10 different?

    No, they aren't. Basically all we're doing is this, and this API didn't change:

    $queue = \Drupal::queue(MailchimpTransactionalInterface::MAILCHIMP_TRANSACTIONAL_QUEUE, TRUE);
    $queue->createItem($mailchimp_transactional_params);
    

    Between 1.0.1 and 1.1.0 we fixed the Queue worker timeout setting. Can you check the value of that setting in your site?
    Maybe try to enable the Log queued emails setting and try to send an email. Is anything logged?

  • Sorry for the delay. I thought this was fixed, so I didn't check back. I'm now seeing the emails still aren't sending while queueing is enabled, even after I completed the upgrade. This is strange since I did see the queuing work on a dev version of the Drupal 10 site, but not on live.

    The queue timer is currently set to 30.

    As for logging, I will have to get back to you on that. I am going to disable queueing on the live site for right now to hopefully allow my weekly newsletter to send again. I will have to run some tests this coming Friday, after the newsletter has sent, when I have more wiggle room to create tests.

Production build 0.71.5 2024