# Post data to mautic form 500 response

**URL:** <https://forum.mautic.org/t/post-data-to-mautic-form-500-response/6249>\
**Category:** Product Support\
**Created:** [October 17, 2016, 8:51am UTC](https://forum.mautic.org/t/post-data-to-mautic-form-500-response/6249 "2016-10-17T08:51:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Florush](https://avatars.discourse-cdn.com/v4/letter/f/a9a28c/32.png) [@Florush](https://forum.mautic.org/u/Florush)\
**Post date:** [October 17, 2016, 8:51am UTC](https://forum.mautic.org/t/post-data-to-mautic-form-500-response/6249/1 "2016-10-17T08:51:28Z")

</div>

After we upgraded our self hosted version of Mautic (to the latest 2.2.0) we encounter a problem when posting form data directly to our Mautic instance.  
  
We have a form defined with emailaddress and company name, and post data via Python:  
  
data = {‘mauticform[company\_name]’: ‘Test’, ‘mauticform[formId]’: 18, ‘mauticform[partner\_email]’: ‘florus+test2@{custom\_domain}.nl’}  
  
requests.post(‘https://{custom\_mautic\_domain}/form/submit’, data=data)  
  
  
  
Response is 500.  
  
  
  
And here are the last lines of the log file (after posting):  
  
[2016-10-17 11:33:13] mautic.ERROR: Deprecation: The alias option of the form.type\_extension tag of service “fos\_rest.form.extension.csrf\_disable” is deprecated since version 2.8 and will be removed in 3.0. Use the extended\_type option instead. - in file /opt/bitnami/apps/mautic/htdocs/vendor/symfony/framework-bundle/DependencyInjection/Compiler/FormPass.php - at line 67 [] []  
  
[2016-10-17 09:38:12] mautic.NOTICE: PHP Notice: Array to string conversion - in file /opt/bitnami/apps/mautic/htdocs/app/bundles/CoreBundle/Helper/InputHelper.php - at line 309 [] []  
  
[2016-10-17 09:38:12] mautic.CRITICAL: Uncaught PHP Exception DoctrineORMORMInvalidArgumentException: “A new entity was found through the relationship ‘MauticFormBundleEntitySubmission#lead’ that was not configured to cascade persist operations for entity: MauticLeadBundleEntityLead with ID #1131. 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”}).” at /opt/bitnami/apps/mautic/htdocs/vendor/doctrine/orm/lib/Doctrine/ORM/ORMInvalidArgumentException.php line 92 {“exception”:"[object] (Doctrine\ORM\ORMInvalidArgumentException(code: 0): A new entity was found through the relationship ‘Mautic\FormBundle\Entity\Submission#lead’ that was not configured to cascade persist operations for entity: Mautic\LeadBundle\Entity\Lead with ID #1131. 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”}). at /opt/bitnami/apps/mautic/htdocs/vendor/doctrine/orm/lib/Doctrine/ORM/ORMInvalidArgumentException.php:92)"} []  
  
[2016-10-17 09:38:12] mautic.ERROR: Deprecation: The SymfonyComponentTranslationTranslator::getMessages method is deprecated since version 2.8 and will be removed in 3.0. Use TranslatorBagInterface::getCatalogue() method instead. - in file /opt/bitnami/apps/mautic/htdocs/vendor/symfony/translation/Translator.php - at line 275 [] []  
  
  
  
Hope anyone can point us in the right direction.  
  
  
  
Thanks a lot!

---

<div class="post-metadata">

**Author:** ![Florush](https://avatars.discourse-cdn.com/v4/letter/f/a9a28c/32.png) [@Florush](https://forum.mautic.org/u/Florush)\
**Post date:** [October 17, 2016, 8:51am UTC](https://forum.mautic.org/t/post-data-to-mautic-form-500-response/6249/2 "2016-10-17T08:51:28Z")

</div>

After we upgraded our self hosted version of Mautic (to the latest 2.2.0) we encounter a problem when posting form data directly to our Mautic instance.  
We have a form defined with emailaddress and company name, and post data via Python:  
data = {‘mauticform[company\_name]’: ‘Test’, ‘mauticform[formId]’: 18, ‘mauticform[partner\_email]’: ‘florus+test2@{custom\_domain}.nl’}  
requests.post(‘https://{custom\_mautic\_domain}/form/submit’, data=data)

Response is 500.

And here are the last lines of the log file (after posting):  
[2016-10-17 11:33:13] mautic.ERROR: Deprecation: The alias option of the form.type\_extension tag of service “fos\_rest.form.extension.csrf\_disable” is deprecated since version 2.8 and will be removed in 3.0. Use the extended\_type option instead. - in file /opt/bitnami/apps/mautic/htdocs/vendor/symfony/framework-bundle/DependencyInjection/Compiler/FormPass.php - at line 67 [] []  
[2016-10-17 09:38:12] mautic.NOTICE: PHP Notice: Array to string conversion - in file /opt/bitnami/apps/mautic/htdocs/app/bundles/CoreBundle/Helper/InputHelper.php - at line 309 [] []  
[2016-10-17 09:38:12] mautic.CRITICAL: Uncaught PHP Exception DoctrineORMORMInvalidArgumentException: “A new entity was found through the relationship ‘MauticFormBundleEntitySubmission#lead’ that was not configured to cascade persist operations for entity: MauticLeadBundleEntityLead with ID #1131. 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”}).” at /opt/bitnami/apps/mautic/htdocs/vendor/doctrine/orm/lib/Doctrine/ORM/ORMInvalidArgumentException.php line 92 {“exception”:"[object] (Doctrine\ORM\ORMInvalidArgumentException(code: 0): A new entity was found through the relationship ‘Mautic\FormBundle\Entity\Submission#lead’ that was not configured to cascade persist operations for entity: Mautic\LeadBundle\Entity\Lead with ID #1131. 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”}). at /opt/bitnami/apps/mautic/htdocs/vendor/doctrine/orm/lib/Doctrine/ORM/ORMInvalidArgumentException.php:92)"} []  
[2016-10-17 09:38:12] mautic.ERROR: Deprecation: The SymfonyComponentTranslationTranslator::getMessages method is deprecated since version 2.8 and will be removed in 3.0. Use TranslatorBagInterface::getCatalogue() method instead. - in file /opt/bitnami/apps/mautic/htdocs/vendor/symfony/translation/Translator.php - at line 275 [] []

Hope anyone can point us in the right direction.

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![Elenchus](https://avatars.discourse-cdn.com/v4/letter/e/ccd318/32.png) [@Elenchus](https://forum.mautic.org/u/Elenchus)\
**Post date:** [October 17, 2016, 12:08pm UTC](https://forum.mautic.org/t/post-data-to-mautic-form-500-response/6249/3 "2016-10-17T12:08:59Z")

</div>

Couple of observations: firstly the latest version is 2.2.1, which version do you have? Were there any errors during the installation?

Secondly, the timestamp on that first error is a couple of hours later than all the warnings, so I reckon your problem is to be found there. At a guess I’d say that file hasn’t been updated while others have, but you could take a look at line 67 and see if there’s something you can change like it says (but that may just lead to a different error further down the line)
