How many contacts added to segments and campaings

Im trying to understand how Mautic “moves” contacts to Campaings.

Is this understanding right:
The “Segment” cronjobs runs and picks up to 300 contacts each time it is triggered?
The “Campaings” cronjob runs and pikcs up to 100 contacts each time it is triggered?

Contacts are processed in batches of 300 records per batch. Obviously you can adjust the batch size.

Thanks @mzagmajster where do I change the bach sizes?

mautic:segments:update --batch-limit=300
mautic:campaigns:update --batch-limit=300

Ahh, so easy!

Many thanks @mzagmajster

FYI (see errors):

Rebuilding contacts for campaign 1
Triggering events for campaign 1
Triggering events for newly added contacts
0 total contact(s) to be added in batches of 1
0 total contact(s) to be removed in batches of 1

Rebuilding contacts for campaign 2
0 total contact(s) to be added in batches of 1
0 total events(s) to be processed in batches of 100 contacts

0 total events were executed
0 total events were scheduled

Triggering scheduled events
0 total contact(s) to be removed in batches of 1

Rebuilding contacts for campaign 3
0 total events(s) to be processed in batches of 100 contacts

0 total events were executed
0 total events were scheduled

Triggering events for inactive contacts

0 total events were executed
0 total events were scheduled

0 total contact(s) to be added in batches of 1
0 total contact(s) to be removed in batches of 1

Rebuilding contacts for campaign 6
Triggering events for campaign 2
Triggering events for newly added contacts
0 total contact(s) to be added in batches of 1
0 total events(s) to be processed in batches of 100 contacts

0 total events were executed
0 total events were scheduled

Triggering scheduled events
0 total contact(s) to be removed in batches of 1

X-Powered-By: PHP/7.4.33
Content-type: text/html; charset=UTF-8

0 total events(s) to be processed in batches of 100 contacts

0 total events were executed
0 total events were scheduled

Triggering events for inactive contacts

0 total events were executed
0 total events were scheduled

Triggering events for campaign 3
Triggering events for newly added contacts
0 total events(s) to be processed in batches of 100 contacts

0 total events were executed
0 total events were scheduled

Triggering scheduled events
Rebuilding contacts for segment 1
0 total events(s) to be processed in batches of 100 contacts

0 total events were executed
0 total events were scheduled

Triggering events for inactive contacts

0 total events were executed
0 total events were scheduled

Triggering events for campaign 6
Triggering events for newly added contacts
0 total events(s) to be processed in batches of 100 contacts

0 total events were executed
0 total events were scheduled

Triggering scheduled events
0 total events(s) to be processed in batches of 100 contacts

0 total events were executed
0 total events were scheduled

Triggering events for inactive contacts

0 total events were executed
0 total events were scheduled

X-Powered-By: PHP/7.4.33
Content-type: text/html; charset=UTF-8

0 total contact(s) to be added in batches of 1
0 total contact(s) to be removed in batches of 1
0 contact(s) affected
Rebuilding contacts for segment 2
0 total contact(s) to be added in batches of 1
0 total contact(s) to be removed in batches of 1
0 contact(s) affected
Rebuilding contacts for segment 3
0 total contact(s) to be added in batches of 1
0 total contact(s) to be removed in batches of 1
0 contact(s) affected
Rebuilding contacts for segment 6
0 total contact(s) to be added in batches of 1
0 total contact(s) to be removed in batches of 1
0 contact(s) affected
X-Powered-By: PHP/7.4.33
Content-type: text/html; charset=UTF-8

[2024-02-20 11:48:04] Processing default mailer spool…
0 emails sent
X-Powered-By: PHP/7.4.33
Content-type: text/html; charset=UTF-8

Rebuilding contacts for segment 1
0 total contact(s) to be added in batches of 1
0 total contact(s) to be removed in batches of 1
Triggering events for campaign 1
Triggering events for newly added contacts
0 contact(s) affected
Rebuilding contacts for segment 2
0 total contact(s) to be added in batches of 1
0 total contact(s) to be removed in batches of 1
0 total events(s) to be processed in batches of 100 contacts

0 total events were executed
0 total events were scheduled

Triggering scheduled events
0 total events(s) to be processed in batches of 100 contacts

0 total events were executed
0 total events were scheduled

Triggering events for inactive contacts

0 total events were executed
0 total events were scheduled

Triggering events for campaign 2
Triggering events for newly added contacts
0 total events(s) to be processed in batches of 100 contacts

0 total events were executed
0 total events were scheduled

Triggering scheduled events
0 total events(s) to be processed in batches of 100 contacts

0 total events were executed
0 total events were scheduled

Triggering events for inactive contacts

0 total events were executed
0 total events were scheduled

0 contact(s) affected
Rebuilding contacts for segment 3
Triggering events for campaign 3
Triggering events for newly added contacts
0 total events(s) to be processed in batches of 100 contacts

0 total events were executed
0 total events were scheduled

Triggering scheduled events
0 total events(s) to be processed in batches of 100 contacts

0 total events were executed
0 total events were scheduled

Triggering events for inactive contacts

0 total events were executed
0 total events were scheduled

219 total contact(s) to be added in batches of 1
0/219 [>---------------------------] 0%Triggering events for campaign 6
Triggering events for newly added contacts
0 total events(s) to be processed in batches of 100 contacts

0 total events were executed
0 total events were scheduled

Triggering scheduled events
0 total events(s) to be processed in batches of 100 contacts

0 total events were executed
0 total events were scheduled

Triggering events for inactive contacts

0 total events were executed
0 total events were scheduled

X-Powered-By: PHP/7.4.33
Content-type: text/html; charset=UTF-8

Rebuilding contacts for campaign 1
0 total contact(s) to be added in batches of 1
0 total contact(s) to be removed in batches of 1

Rebuilding contacts for campaign 2
0 total contact(s) to be added in batches of 1
0 total contact(s) to be removed in batches of 1

Rebuilding contacts for campaign 3
0 total contact(s) to be added in batches of 1
0 total contact(s) to be removed in batches of 1

Rebuilding contacts for campaign 6
0 total contact(s) to be added in batches of 1
0 total contact(s) to be removed in batches of 1

X-Powered-By: PHP/7.4.33
Content-type: text/html; charset=UTF-8

1/219 [>---------------------------] 0%
2/219 [>---------------------------] 0%
3/219 [>---------------------------] 1%
4/219 [>---------------------------] 1%
5/219 [>---------------------------] 2%
6/219 [>---------------------------] 2%
7/219 [>---------------------------] 3%
8/219 [=>--------------------------] 3%
9/219 [=>--------------------------] 4%
10/219 [=>--------------------------] 4%
11/219 [=>--------------------------] 5%
12/219 [=>--------------------------] 5%
13/219 [=>--------------------------] 5%
14/219 [=>--------------------------] 6%
15/219 [=>--------------------------] 6%
16/219 [==>-------------------------] 7%
17/219 [==>-------------------------] 7%
18/219 [==>-------------------------] 8%
19/219 [==>-------------------------] 8%
20/219 [==>-------------------------] 9%
21/219 [==>-------------------------] 9%
22/219 [==>-------------------------] 10%
23/219 [==>-------------------------] 10%
24/219 [===>------------------------] 10%
25/219 [===>------------------------] 11%
26/219 [===>------------------------] 11%
27/219 [===>------------------------] 12%
28/219 [===>------------------------] 12%
29/219 [===>------------------------] 13%
30/219 [===>------------------------] 13%
31/219 [===>------------------------] 14%
32/219 [====>-----------------------] 14%
33/219 [====>-----------------------] 15%
34/219 [====>-----------------------] 15%
35/219 [====>-----------------------] 15%
36/219 [====>-----------------------] 16%
37/219 [====>-----------------------] 16%
38/219 [====>-----------------------] 17%
39/219 [====>-----------------------] 17%
40/219 [=====>----------------------] 18%
41/219 [=====>----------------------] 18%
42/219 [=====>----------------------] 19%
43/219 [=====>----------------------] 19%
44/219 [=====>----------------------] 20%
45/219 [=====>----------------------] 20%
46/219 [=====>----------------------] 21%
47/219 [======>---------------------] 21%
48/219 [======>---------------------] 21%
49/219 [======>---------------------] 22%
50/219 [======>---------------------] 22%
51/219 [======>---------------------] 23%
In AbstractMySQLDriver.php line 68:

An exception occurred while executing ‘INSERT INTO lead_event_log (user_id,
user_name, bundle, object, action, object_id, date_added, properties, lead
_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)’ with params [null, “System”, "lead
", “segment”, “added”, 3, “2024-02-20 11:48:58”, "{"object_description":\
“Test"}”, “28866”]:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update
a child row: a foreign key constraint fails (root2_test1.lead_event_log
, CONSTRAINT FK_753AF2E55458D FOREIGN KEY (lead_id) REFERENCES leads
(id) ON DELETE CASCADE)

In Exception.php line 18:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update
a child row: a foreign key constraint fails (root2_test1.lead_event_log
, CONSTRAINT FK_753AF2E55458D FOREIGN KEY (lead_id) REFERENCES leads
(id) ON DELETE CASCADE)

In PDOStatement.php line 117:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update
a child row: a foreign key constraint fails (root2_test1.lead_event_log
, CONSTRAINT FK_753AF2E55458D FOREIGN KEY (lead_id) REFERENCES leads
(id) ON DELETE CASCADE)

mautic:segments:update [-b|–batch-limit [BATCH-LIMIT]] [-m|–max-contacts [MAX-CONTACTS]] [-i|–list-id [LIST-ID]] [-tm|–timing [TIMING]] [–bypass-locking] [-t|–timeout TIMEOUT] [-x|–lock_mode LOCK_MODE] [-f|–force] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [-e|–env ENV] [–no-debug] [–]

X-Powered-By: PHP/7.4.33
Content-type: text/html; charset=UTF-8

Triggering events for campaign 1
Triggering events for newly added contacts
0 total events(s) to be processed in batches of 100 contacts

0 total events were executed
0 total events were scheduled

Triggering scheduled events
0 total events(s) to be processed in batches of 100 contacts

0 total events were executed
0 total events were scheduled

Triggering events for inactive contacts

0 total events were executed
0 total events were scheduled

Triggering events for campaign 2
Triggering events for newly added contacts
0 total events(s) to be processed in batches of 100 contacts

0 total events were executed
0 total events were scheduled

Triggering scheduled events
0 total events(s) to be processed in batches of 100 contacts

0 total events were executed
0 total events were scheduled

Triggering events for inactive contacts

0 total events were executed
0 total events were scheduled

Triggering events for campaign 3
Triggering events for newly added contacts
0 total events(s) to be processed in batches of 100 contacts

0 total events were executed
0 total events were scheduled

Triggering scheduled events
0 total events(s) to be processed in batches of 100 contacts

0 total events were executed
0 total events were scheduled

Triggering events for inactive contacts

0 total events were executed
0 total events were scheduled

Triggering events for campaign 6
Triggering events for newly added contacts
0 total events(s) to be processed in batches of 100 contacts

0 total events were executed
0 total events were scheduled

Triggering scheduled events
0 total events(s) to be processed in batches of 100 contacts

0 total events were executed
0 total events were scheduled

Triggering events for inactive contacts

0 total events were executed
0 total events were scheduled

X-Powered-By: PHP/7.4.33
Content-type: text/html; charset=UTF-8

Rebuilding contacts for segment 1
0 total contact(s) to be added in batches of 1
0 total contact(s) to be removed in batches of 1
0 contact(s) affected
Rebuilding contacts for segment 2
0 total contact(s) to be added in batches of 1
0 total contact(s) to be removed in batches of 1
0 contact(s) affected
Rebuilding contacts for segment 3
0 total contact(s) to be added in batches of 1
0 total contact(s) to be removed in batches of 1
0 contact(s) affected
Rebuilding contacts for segment 6
0 total contact(s) to be added in batches of 1
0 total contact(s) to be removed in batches of 1
0 contact(s) affected
X-Powered-By: PHP/7.4.33
Content-type: text/html; charset=UTF-8

Rebuilding contacts for campaign 1
0 total contact(s) to be added in batches of 1
0 total contact(s) to be removed in batches of 1

Rebuilding contacts for campaign 2
0 total contact(s) to be added in batches of 1
0 total contact(s) to be removed in batches of 1

Rebuilding contacts for campaign 3
0 total contact(s) to be added in batches of 1
0 total contact(s) to be removed in batches of 1

Rebuilding contacts for campaign 6
0 total contact(s) to be added in batches of 1
0 total contact(s) to be removed in batches of 1

X-Powered-By: PHP/7.4.33
Content-type: text/html; charset=UTF-8

Inspection of the data processed would be required to see where in the data is the problem.

Basically for some reason mautic is trying to insert invalid data into database, why this is the case I am not sure.

Inspect the campaign where this happens and check the contacts that are effected by this. You can get more verbose output by adding -vvv at the end of mautic:segments:update command.

1 Like