Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when triggering a campaign with send SMS action #13646

Open
1 task done
RCheesley opened this issue Apr 12, 2024 · 0 comments
Open
1 task done

Error when triggering a campaign with send SMS action #13646

RCheesley opened this issue Apr 12, 2024 · 0 comments
Labels
bug Issues or PR's relating to bugs campaigns Anything related to campaigns and campaign builder sms Anything related to SMS T1 Low difficulty to fix (issue) or test (PR)

Comments

@RCheesley
Copy link
Sponsor Member

RCheesley commented Apr 12, 2024

Mautic Version

5.0.x series

Way of installing

I cloned the Mautic repo (not recommended or supported)

PHP version

8.1

What browsers are you seeing the problem on?

No response

What happened?

I was testing a PR which required sending an SMS. When triggering the send via a Campaign, it throws an error.

How can we reproduce this issue?

Step 1: Create a segment called Test
Step 2: Configure Twilio plugin
Step 3: Set up a text message
Step 4: Set up a campaign with segment Test (add a lead with a mobile number to the segment) and send SMS as an immediate action
Step 5: Rebuild campaign with ddev exec bin/console m:c:r
Step 6: Trigger campaign with ddev exec bin/console m:c:t

Relevant log output

rcheesley@Drop mautic % ddev exec bin/console m:c:t
Triggering events for campaign 2
Triggering events for newly added contacts
1 total events(s) to be processed in batches of 100 contacts
 1/1 [============================] 100%16:04:47 ERROR     [mautic] Doctrine\ORM\ORMInvalidArgumentException: A new entity was found through the relationship 'Mautic\CampaignBundle\Entity\LeadEventLog#lead' that was not configured to cascade persist operations for entity: Mautic\LeadBundle\Entity\Lead with ID #109. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity or configure cascade persist this association in the mapping for example @ManyToOne(..,cascade={"persist"}). (uncaught exception) at /var/www/html/vendor/doctrine/orm/src/ORMInvalidArgumentException.php line 103 while running console command `mautic:campaigns:trigger`
[stack trace]
#0 /var/www/html/vendor/doctrine/orm/src/UnitOfWork.php(3844): Doctrine\ORM\ORMInvalidArgumentException::newEntitiesFoundThroughRelationships(Array)
#1 /var/www/html/vendor/doctrine/orm/src/UnitOfWork.php(417): Doctrine\ORM\UnitOfWork->assertThatThereAreNoUnintentionallyNonPersistedAssociations()
#2 /var/www/html/vendor/doctrine/orm/src/EntityManager.php(403): Doctrine\ORM\UnitOfWork->commit(NULL)
#3 /var/www/html/app/bundles/CoreBundle/Entity/CommonRepository.php(796): Doctrine\ORM\EntityManager->flush()
#4 /var/www/html/app/bundles/CampaignBundle/Executioner/Logger/EventLogger.php(115): Mautic\CoreBundle\Entity\CommonRepository->saveEntities(Array)
#5 /var/www/html/app/bundles/CampaignBundle/Executioner/EventExecutioner.php(308): Mautic\CampaignBundle\Executioner\Logger\EventLogger->persistCollection(Object(Doctrine\Common\Collections\ArrayCollection))
#6 /var/www/html/app/bundles/CampaignBundle/Executioner/EventExecutioner.php(128): Mautic\CampaignBundle\Executioner\EventExecutioner->persistLogs(Object(Doctrine\Common\Collections\ArrayCollection))
#7 /var/www/html/app/bundles/CampaignBundle/Executioner/EventExecutioner.php(98): Mautic\CampaignBundle\Executioner\EventExecutioner->executeLogs(Object(Mautic\CampaignBundle\Entity\Event), Object(Doctrine\Common\Collections\ArrayCollection), Object(Mautic\CampaignBundle\Executioner\Result\Counter))
#8 /var/www/html/app/bundles/CampaignBundle/Executioner/EventExecutioner.php(169): Mautic\CampaignBundle\Executioner\EventExecutioner->executeForContacts(Object(Mautic\CampaignBundle\Entity\Event), Object(Doctrine\Common\Collections\ArrayCollection), Object(Mautic\CampaignBundle\Executioner\Result\Counter), false)
#9 /var/www/html/app/bundles/CampaignBundle/Executioner/KickoffExecutioner.php(159): Mautic\CampaignBundle\Executioner\EventExecutioner->executeEventsForContacts(Object(Doctrine\Common\Collections\ArrayCollection), Object(Doctrine\Common\Collections\ArrayCollection), Object(Mautic\CampaignBundle\Executioner\Result\Counter))
#10 /var/www/html/app/bundles/CampaignBundle/Executioner/KickoffExecutioner.php(60): Mautic\CampaignBundle\Executioner\KickoffExecutioner->executeOrScheduleEvent()
#11 /var/www/html/app/bundles/CampaignBundle/Command/TriggerCampaignCommand.php(332): Mautic\CampaignBundle\Executioner\KickoffExecutioner->execute(Object(Mautic\CampaignBundle\Entity\Campaign), Object(Mautic\CampaignBundle\Executioner\ContactFinder\Limiter\ContactLimiter), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/html/app/bundles/CampaignBundle/Command/TriggerCampaignCommand.php(285): Mautic\CampaignBundle\Command\TriggerCampaignCommand->executeKickoff()
#13 /var/www/html/app/bundles/CampaignBundle/Command/TriggerCampaignCommand.php(234): Mautic\CampaignBundle\Command\TriggerCampaignCommand->triggerCampaign(Object(Mautic\CampaignBundle\Entity\Campaign))
#14 /var/www/html/vendor/symfony/console/Command/Command.php(298): Mautic\CampaignBundle\Command\TriggerCampaignCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/html/vendor/symfony/console/Application.php(1058): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /var/www/html/vendor/symfony/framework-bundle/Console/Application.php(96): Symfony\Component\Console\Application->doRunCommand(Object(Mautic\CampaignBundle\Command\TriggerCampaignCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /var/www/html/vendor/symfony/console/Application.php(301): Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand(Object(Mautic\CampaignBundle\Command\TriggerCampaignCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /var/www/html/vendor/symfony/framework-bundle/Console/Application.php(82): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /var/www/html/vendor/symfony/console/Application.php(171): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /var/www/html/bin/console(16): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 {main} ["hostname" => "mautic-web","pid" => 2535]
16:04:47 CRITICAL  [console] Error thrown while running command "'m:c:t'". Message: "A new entity was found through the relationship 'Mautic\CampaignBundle\Entity\LeadEventLog#lead' that was not configured to cascade persist operations for entity: Mautic\LeadBundle\Entity\Lead with ID #109. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity or configure cascade persist this association in the mapping for example @ManyToOne(..,cascade={"persist"})." ["exception" => Doctrine\ORM\ORMInvalidArgumentException^ { …},"command" => "'m:c:t'","message" => "A new entity was found through the relationship 'Mautic\CampaignBundle\Entity\LeadEventLog#lead' that was not configured to cascade persist operations for entity: Mautic\LeadBundle\Entity\Lead with ID #109. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity or configure cascade persist this association in the mapping for example @ManyToOne(..,cascade={"persist"})."] ["hostname" => "mautic-web","pid" => 2535]
16:04:47 WARNING   [mautic] Command `mautic:campaigns:trigger` exited with status code 1 ["hostname" => "mautic-web","pid" => 2535]

In ORMInvalidArgumentException.php line 103:
                                                                                                                                                            
  A new entity was found through the relationship 'Mautic\CampaignBundle\Entity\LeadEventLog#lead' that was not configured to cascade persist operations f  
  or entity: Mautic\LeadBundle\Entity\Lead with ID #109. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity or con  
  figure cascade persist this association in the mapping for example @ManyToOne(..,cascade={"persist"}).

Code of Conduct

  • I confirm that I have read and agree to follow this project's Code of Conduct




Care about this issue? Want to get it resolved sooner? If you are a member of Mautic, you can add some funds to the Bounties Project so that the person who completes this task can claim those funds once it is merged by a member of the core team! Read the docs here.

@RCheesley RCheesley added bug Issues or PR's relating to bugs needs-triage For new issues/PRs that need to be triaged campaigns Anything related to campaigns and campaign builder sms Anything related to SMS T1 Low difficulty to fix (issue) or test (PR) and removed needs-triage For new issues/PRs that need to be triaged labels Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues or PR's relating to bugs campaigns Anything related to campaigns and campaign builder sms Anything related to SMS T1 Low difficulty to fix (issue) or test (PR)
Projects
Status: 🤔 To Do
Development

No branches or pull requests

1 participant