# Problem Executing Campaign Actions

**URL:** <https://forum.mautic.org/t/problem-executing-campaign-actions/2383>\
**Category:** Product Support\
**Created:** [September 22, 2015, 9:41am UTC](https://forum.mautic.org/t/problem-executing-campaign-actions/2383 "2015-09-22T09:41:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![edudesouza](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/edudesouza/32/5898_2.png) [@edudesouza](https://forum.mautic.org/u/edudesouza)\
**Post date:** [September 22, 2015, 9:41am UTC](https://forum.mautic.org/t/problem-executing-campaign-actions/2383/1 "2015-09-22T09:41:00Z")

</div>

Hi folk, I am experiencing an issue trigging my campaign.  
  
  
  
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ Code \_\_\_  
  
   
  
_ **try {** _  
  
_**$args = array(‘console’, ‘mautic:campaigns:trigger’, ‘–env=prod’, ‘–no-debug’);**_  
  
_**$input = new ArgvInput($args);**_  
  
_**$output = new BufferedOutput();**_  
  
   
  
_**$kernel = new AppKernel(‘prod’, false);**_  
  
_**$application = new Application($kernel);**_  
  
_**$application-\>setAutoExit(false);**_  
  
_**$result = $application-\>run($input, $output);**_  
  
   
  
_ **echo “** _

## _ **Execute Campaign Actions** _
_ **”;** _  
  
_**echo “
```
n”.$output->fetch().’
```
’;**_  
  
   
  
_**}catch(Exception $exception) {**_  
  
   
  
_**echo $exception-\>getMessage();**_  
  
   
  
_ **}** _  
  
_ **\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ Response** _  
  
  
  
Triggering events for campaign 1  
  
Triggering first level events  
  
4 total events(s) to be processed in batches of 100  
  
  
  
[DoctrineORM RMException]  
  
  
  
Entity of type MauticCampaignBundleEntityLeadEventLog has identity through a foreign entity MauticLeadBundleEntityLead, however this entity has no identity itself. You have to call EntityManager#persist() on the related entity and make sure that an identifier was generated before trying to persist ‘MauticCampaignBundleEntityLeadEventLog’. In case of Post Insert ID Generation (such as MySQL Auto-Increment or PostgreSQL SERIAL) this means you have to call EntityManager#flush() between both persist operations.  
  
  
  
mautic:campaigns:trigger [-i|–campaign-id[="…"]] [-l|–batch-limit[="…"]] [-m|–max-events[="…"]] [-f|–force]  
  
  
  
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
  
  
  
Any guess how to fix or what is causing?

---

<div class="post-metadata">

**Author:** ![edudesouza](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/edudesouza/32/5898_2.png) [@edudesouza](https://forum.mautic.org/u/edudesouza)\
**Post date:** [September 22, 2015, 9:41am UTC](https://forum.mautic.org/t/problem-executing-campaign-actions/2383/2 "2015-09-22T09:41:00Z")

</div>

Hi folk, I am experiencing an issue trigging my campaign.

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ Code \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

try {  
$args = array(‘console’, ‘mautic:campaigns:trigger’, ‘–env=prod’, ‘–no-debug’);  
$input = new ArgvInput($args);  
$output = new BufferedOutput();

```
$kernel = new AppKernel('prod', false);
$application = new Application($kernel);
$application->setAutoExit(false);
$result = $application->run($input, $output);

echo "<h2>Execute Campaign Actions</h2>";
echo "<pre>n".$output->fetch().'</pre>';

```

}catch(Exception $exception) {

```
echo $exception->getMessage();

```

}  
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ Response\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

Triggering events for campaign 1  
Triggering first level events  
4 total events(s) to be processed in batches of 100

[DoctrineORM RMException]

Entity of type MauticCampaignBundleEntityLeadEventLog has identity through a foreign entity MauticLeadBundleEntityLead, however this entity has no identity itself. You have to call EntityManager#persist() on the related entity and make sure that an identifier was generated before trying to persist ‘MauticCampaignBundleEntityLeadEventLog’. In case of Post Insert ID Generation (such as MySQL Auto-Increment or PostgreSQL SERIAL) this means you have to call EntityManager#flush() between both persist operations.

mautic:campaigns:trigger [-i|–campaign-id[="…"]] [–scheduled-only] [–negative-only] [-l|–batch-limit[="…"]] [-m|–max-events[="…"]] [-f|–force]

* * *

Any guess how to fix or what is causing?

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [February 2, 2020, 10:58pm UTC](https://forum.mautic.org/t/problem-executing-campaign-actions/2383/3 "2020-02-02T22:58:23Z")

</div>


