CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • CiviMail did not record activity for all recipients
Pages: [1]

Author Topic: CiviMail did not record activity for all recipients  (Read 2114 times)

ruid

  • I post occasionally
  • **
  • Posts: 46
  • Karma: 4
CiviMail did not record activity for all recipients
March 02, 2010, 02:47:18 pm
I have 2 clients had the same problem that after sending a CiviMail, not all recipients got recorded an activity.

1. CiviCRM upgraded from 1.9 to 3.1.3
    Sent to 7000 recipients and only about 800 of them got recorded an activity. (I got the 800 info from table civicrm_activity_target with the mailing activity id.)
2. CiviCRM upgraded from 2.2.7 to 3.1.3
    Sent to 5000 recipients and only about 400 of them got recorded an activity.

I found all the contacts with activity recorded correctly are the contacts with the latest contact id. Eg, for the second case, all contacts with id greater than 20795 are recorded and activity but the older contacts have no activity recorded. I did a test to send email to test group (about 5 recipients) with no problem. There was no problem before upgrade.

I tested on demo site(300 contacts) but couldn't see this problem.

Any clue for this problem?

Rui

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviMail did not record activity for all recipients
March 02, 2010, 04:38:01 pm

can u replicate the problem on a local machine while redirecting the email to '/dev/null' (using: CIVICRM_MAIL_LOG) on a 3.1.3 install

might help to isolate and fix the bug. I took a look at the code and it seems right but incredibly inefficient, IMO. so would be good to track and fix

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: CiviMail did not record activity for all recipients
March 03, 2010, 07:55:45 am
Quote from: ruid on March 02, 2010, 02:47:18 pm
I have 2 clients had the same problem that after sending a CiviMail, not all recipients got recorded an activity.

1. CiviCRM upgraded from 1.9 to 3.1.3
    Sent to 7000 recipients and only about 800 of them got recorded an activity. (I got the 800 info from table civicrm_activity_target with the mailing activity id.)
2. CiviCRM upgraded from 2.2.7 to 3.1.3
    Sent to 5000 recipients and only about 400 of them got recorded an activity.

Did actually all 7000/5000 mails got sent (from CiviMail’s report)? CiviMail sends in batches, maybe the mailing didn’t finish.

Otherwise, as Lobo says, it might be performance issue – if the activity recording is inefficient and the mailing script can’t reset the PHP script timeout, it might be that in the default 30 seconds only 800/400 activities managed to get recorded.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

ruid

  • I post occasionally
  • **
  • Posts: 46
  • Karma: 4
Re: CiviMail did not record activity for all recipients
March 08, 2010, 03:55:38 pm
The sent another mailing and got the same problem.

This is the report:
Intended Recipients   7266
Succesful Deliveries   7213 (99.27%)
Spooled Mails   0
Tracked Opens   1538
Click-throughs   819
Forwards   0
Replies   39
Bounces   53 (0.73%)
Unsubscribe Requests   15 (0.21%)
Scheduled Date   8 March 2010 3:11 PM
Status   Complete
Start Date   8 March 2010 3:12 PM
End Date   8 March 2010 3:24 PM

I checked the civicrm_activity_target table and only 266 contacts got recorded. I can confirm some recipients got emails but not recorded activity.
The activity was recorded for contacts starting from contact id 26222 till the greatest contact id.  I wonder why it randomly picked up a contact id and recorded activity from it instead of recording from the smallest contact id.

Is there any configuration change I can try on codes or server to improve the performance?


Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: CiviMail did not record activity for all recipients
March 10, 2010, 03:46:08 am
Quote from: ruid on March 08, 2010, 03:55:38 pm
I checked the civicrm_activity_target table and only 266 contacts got recorded. I can confirm some recipients got emails but not recorded activity.
The activity was recorded for contacts starting from contact id 26222 till the greatest contact id.  I wonder why it randomly picked up a contact id and recorded activity from it instead of recording from the smallest contact id.

Hm, this seems like a bug, but we’ll need to replicate it before fixing.

Quote
Is there any configuration change I can try on codes or server to improve the performance?

As Lobo said – can you try replicating the problem (ideally – on a local machine) while redirecting the emails to /dev/null (via CIVICRM_MAIL_LOG in the config file) on a 3.1.3 install? It might point out whether it’s a performance problem or not.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: CiviMail did not record activity for all recipients
March 26, 2010, 08:20:52 pm
So adding to this - civimail to 12000 or so - Activities recorded 500 or so.

Of those who do not have the civimail Activity recorded their are people who Opted Out.

I note your comment about local machine testing required. I will see if we can help shed any more light on this. (system is 3.1.2)
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

ruid

  • I post occasionally
  • **
  • Posts: 46
  • Karma: 4
Re: CiviMail did not record activity for all recipients
March 29, 2010, 07:50:18 pm
Did a few local tests and found the problem finally.

There is a MAX_CONTACTS_TO_PROCESS (default 1000) in CRM_Mailing_BAO_Job which I think is to reduce the work load of the server. This process limit cause a number of calls to api/v2/Acitivity.php civicrm_activity_create function.

In civicrm_activity_create function, it calls CRM_Activity_BAO_Activity::create. This function deleted all the activity_target records of the activity before recording activity target, which introduce the problem that processing more than 1000 contacts will delete the previous  activity_target records of this activity.

For example, if there are 2120 recipients, it records 3 times to the activity_target table. First 1000, then deletes the first 1000 and records the second 1000, then delete the second 1000 and record the remaining 120 records. This explains why only the greatest contact ids got the records.

If I comment this line (413 in latest trunk) "self::deleteActivityTarget( $activityId );", it will work. Is this line necessary? 
I changed the MAX_CONTACTS_TO_PROCESS to 10000 for now.

I have filed an issue http://issues.civicrm.org/jira/browse/CRM-6035


Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviMail did not record activity for all recipients
March 30, 2010, 06:33:57 am

hey rui:

awesome detective work and figuring things out. we'll fix this for 3.1.4

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Eliet Henderson

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 4
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 7
  • MySQL version: 5.0
  • PHP version: 5.2
Re: CiviMail did not record activity for all recipients
July 12, 2011, 12:18:08 pm
Hi,

This is an old thread, but I am still seeing this bug on my site using 3.3.6.

The mailing report of successful deliveries shows 5828 contacts receiving the email. You can’t search in the Successful Deliveries report, but spot-checking suggests their Contact IDs are all lower than 428xx.
 
Only 230 contacts have the Bulk Email activity recorded to their records. Their Contact IDs are 428xx through 433xx.

Have there been any further updates on this fix since 3.1.4?

Thanks.

Eliet Henderson

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 4
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 7
  • MySQL version: 5.0
  • PHP version: 5.2
Re: CiviMail did not record activity for all recipients
July 14, 2011, 10:18:53 am

Hi again -- I tried increasing the number of MAX_CONTACTS_TO_PROCESS, as suggested by ruid, but that did not seem to have any result.

I ran another mailing after increasing the max contacts; the Successful Deliveries item says 5740, while the civicrm_activity_target table shows only 47 activities recorded, for contacts with sequential IDs between 43346 and 43460.

Is anyone else having this problem?

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • CiviMail did not record activity for all recipients

This forum was archived on 2017-11-26.