Mautic Community Forums

segment update cron removing and adding contacts!

I have 2.1.1 and the crons setup staggered every 15 minutes, etc.



I have a segment which is based on “visiting a URL”. After I create the segment, people got added to it correctly.

Then after a little while, the cron segment:update REMOVES THOSE PEOPLE.

Then after a little while, the cron segment:update ADDS THE PEOPLE AGAIN?



It seems Mautic is incorrectly disqualifying contacts from a segment and removes them. Then when it runs again it realizes

that the people belong in the segment and re-adds them.

This is wreaking havoc with a campaign that is triggered by the people being added to the segment!!!



I suspect there is some error in how it judges someone no longer belongs in the segment and/or is timing out.

The thing is, if I run in in a console, segment:update is pretty quick and I allow plenty of time to finish.



Can someone help? This has been happening since 2.0 and I was hoping it was fixed, but it is not.

Here is an example output:



Rebuilding contacts for segment 21

852 total contact(s) to be added in batches of 300

0/852 [>---------------------------] 0%

85/852 [==>-------------------------] 9%

170/852 [=====>----------------------] 19%

255/852 [========>-------------------] 29%

340/852 [===========>----------------] 39%

425/852 [=============>--------------] 49%

510/852 [================>-----------] 59%

595/852 [===================>--------] 69%

680/852 [======================>-----] 79%

765/852 [=========================>–] 89%

850/852 [===========================>] 99%

852/852 [============================] 100%

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

852 contact(s) affected



The above runs in undcer 1 minute. Then 15 minutes later:

Rebuilding contacts for segment 21

2 total contact(s) to be added in batches of 300

0/2 [>---------------------------] 0%

1/2 [==============>-------------] 50%

2/2 [============================] 100%

501 total contact(s) to be removed in batches of 300

0/501 [>---------------------------] 0%

50/501 [==>-------------------------] 9%

100/501 [=====>----------------------] 19%

150/501 [========>-------------------] 29%

200/501 [===========>----------------] 39%

250/501 [=============>--------------] 49%

300/501 [================>-----------] 59%

350/501 [===================>--------] 69%

400/501 [======================>-----] 79%

450/501 [=========================>–] 89%

500/501 [===========================>] 99%

501/501 [============================] 100%

503 contact(s) affected




I have 2.1.1 and the crons setup staggered every 15 minutes, etc.

I have a segment which is based on “visiting a URL”. After I create the segment, people got added to it correctly.
Then after a little while, the cron segment:update REMOVES THOSE PEOPLE.
Then after a little while, the cron segment:update ADDS THE PEOPLE AGAIN?

It seems Mautic is incorrectly disqualifying contacts from a segment and removes them. Then when it runs again it realizes
that the people belong in the segment and re-adds them.
This is wreaking havoc with a campaign that is triggered by the people being added to the segment!!!

I suspect there is some error in how it judges someone no longer belongs in the segment and/or is timing out.
The thing is, if I run in in a console, segment:update is pretty quick and I allow plenty of time to finish.

Can someone help? This has been happening since 2.0 and I was hoping it was fixed, but it is not.
Here is an example output:

Rebuilding contacts for segment 21
852 total contact(s) to be added in batches of 300
0/852 [>---------------------------] 0%
85/852 [==>-------------------------] 9%
170/852 [=====>----------------------] 19%
255/852 [========>-------------------] 29%
340/852 [===========>----------------] 39%
425/852 [=============>--------------] 49%
510/852 [================>-----------] 59%
595/852 [===================>--------] 69%
680/852 [======================>-----] 79%
765/852 [=========================>–] 89%
850/852 [===========================>] 99%
852/852 [============================] 100%
0 total contact(s) to be removed in batches of 300
852 contact(s) affected

The above runs in undcer 1 minute. Then 15 minutes later:
Rebuilding contacts for segment 21
2 total contact(s) to be added in batches of 300
0/2 [>---------------------------] 0%
1/2 [==============>-------------] 50%
2/2 [============================] 100%
501 total contact(s) to be removed in batches of 300
0/501 [>---------------------------] 0%
50/501 [==>-------------------------] 9%
100/501 [=====>----------------------] 19%
150/501 [========>-------------------] 29%
200/501 [===========>----------------] 39%
250/501 [=============>--------------] 49%
300/501 [================>-----------] 59%
350/501 [===================>--------] 69%
400/501 [======================>-----] 79%
450/501 [=========================>–] 89%
500/501 [===========================>] 99%
501/501 [============================] 100%
503 contact(s) affected

I have a similar problem, and it’s quite serious. Update Segments cron runs twice a day, once at midnight and once at 06:00. The midnight run is removing X number of contacts from the unsubscribe segment, then the morning run is adding same X number back in. Why is Update Segments ever removing any contacts from the Unsubscribe segment for any reason?!