# Ever seen such campaign behaviour?

**URL:** <https://forum.mautic.org/t/ever-seen-such-campaign-behaviour/26343>\
**Category:** Product Support\
**Created:** [December 7, 2022, 4:18pm UTC](https://forum.mautic.org/t/ever-seen-such-campaign-behaviour/26343 "2022-12-07T16:18:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dirk\_s](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dirk_s/32/748_2.png) [@dirk\_s](https://forum.mautic.org/u/dirk_s)\
**Post date:** [December 7, 2022, 4:18pm UTC](https://forum.mautic.org/t/ever-seen-such-campaign-behaviour/26343/1 "2022-12-07T16:18:19Z")

</div>

**Your software**  
My Mautic version is: 4.4.5  
My PHP version is: 7.4

**Your problem**  
My problem is:

- mautic:campaigns:rebuild doesn’t finish

These errors are showing in the log:  
none

![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/b/b402efad4505de0b0c0602fcab3d4b8201fb0cd7.png)

1 contact to be added 😳

I cloned the old campaign and stopped it. The clone now runs fine.  
What happenend?

---

<div class="post-metadata">

**Author:** ![marc.beinder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/marc.beinder/32/7256_2.png) [@marc.beinder](https://forum.mautic.org/u/marc.beinder)\
**Post date:** [December 7, 2022, 8:36pm UTC](https://forum.mautic.org/t/ever-seen-such-campaign-behaviour/26343/2 "2022-12-07T20:36:23Z")

</div>

I encounter this from time to time. Previously, I deleted the problematic campaign after cloning it and all seemed fine. I’ve also encountered this with segments. Now I add a --max-contacts=X flag and then it works just fine.

Note: Replace X with the max number of contacts you want that cron job run to process. I’ve got mine sitting around 500 right now without any issues.

---

<div class="post-metadata">

**Author:** ![dirk\_s](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dirk_s/32/748_2.png) [@dirk\_s](https://forum.mautic.org/u/dirk_s)\
**Post date:** [December 12, 2022, 9:25am UTC](https://forum.mautic.org/t/ever-seen-such-campaign-behaviour/26343/3 "2022-12-12T09:25:09Z")

</div>

Okay, this seems to be the reason (fixed with v5)

> <https://github.com/mautic/mautic/pull/11318>
>
> \<!-- ## Which branch should I use for my PR?
> 
> Assuming that:
> 
> a = current ma…jor release
> b = current minor release
> c = future major release
> 
> \* a.x for any features and enhancements (e.g. 5.x)
> \* a.b for any bug fixes (e.g. 4.4, 5.1)
> \* c.x for any features, enhancements or bug fixes with backward compatibility breaking changes (e.g. 5.x) --\>
> 
> | Q | A
> | -------------------------------------- | ---
> | Bug fix? (use the a.b branch) | \[\]
> | New feature/enhancement? (use the a.x branch) | \[\]
> | Deprecations? | \[\]
> | BC breaks? (use the c.x branch) | \[\]
> | Automated tests included? | \[\] 
> | Related user documentation PR URL | mautic/mautic-documentation#... 
> | Related developer documentation PR URL | mautic/developer-documentation#... 
> | Issue(s) addressed | Fixes https://github.com/mautic/mautic/issues/11061
> 
> \<!--
> Additionally (see https://contribute.mautic.org/contributing-to-mautic/developer/code/pull-requests#work-on-your-pull-request):
> - Always add tests and ensure they pass.
> - Bug fixes must be submitted against the lowest maintained branch where they apply
> (lowest branches are regularly merged to upper ones so they get the fixes too.)
> - Features and deprecations must be submitted against the "4.x" branch.
> \--\>
> 
> \#### Description:
> 
> Ugly looping issue while campaign rebuild use with \`Allow contacts to restart the campaign \`
> 
> \<!--
> Please write a short README for your feature/bugfix. This will help people understand your PR and what it aims to do. If you are fixing a bug and if there is no linked issue already, please provide steps to reproduce the issue here.
> \--\>
> 
> \#### Steps to test this PR:
> 
> \<!--
> This part is really important. If you want your PR to be merged, take the time to write very clear, annotated and step by step test instructions. Do not assume any previous knowledge - testers may not be developers.
> \--\>
> 1. Open this PR on Gitpod or pull down for testing locally (see docs on testing PRs \[here\](https://contribute.mautic.org/contributing-to-mautic/tester))
> 2. Add to segment two contacts by filter not manually
> 3. Create campaign with segment
> 4. Rebuild segment 
> 5. Then manually remove from campaign one contact
> 6. Then rebuild campaign 
> 7. See rebuild looping
> 8. After PR should work properly
> 
> \<!--
> If you have any deprecations, list them here along with the new alternative.
> If you have any backwards compatibility breaks, list them here.
> \--\>
> 
> 
> \<a href="https://gitpod.io/#https://github.com/mautic/mautic/pull/11318"\>\<img src="https://gitpod.io/button/open-in-gitpod.svg"/\>\</a\>

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)\
**Post date:** [December 13, 2022, 9:25pm UTC](https://forum.mautic.org/t/ever-seen-such-campaign-behaviour/26343/4 "2022-12-13T21:25:33Z")

</div>

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
