# 500 error when creating a new contact (interface and API)

**URL:** <https://forum.mautic.org/t/500-error-when-creating-a-new-contact-interface-and-api/20599>\
**Category:** Product Support\
**Tags:** mautic-4\
**Created:** [August 26, 2021, 7:20am UTC](https://forum.mautic.org/t/500-error-when-creating-a-new-contact-interface-and-api/20599 "2021-08-26T07:20:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/alin/32/637_2.png) [@alin](https://forum.mautic.org/u/alin)\
**Post date:** [August 26, 2021, 7:20am UTC](https://forum.mautic.org/t/500-error-when-creating-a-new-contact-interface-and-api/20599/1 "2021-08-26T07:20:11Z")

</div>

My Mautic version is: 4.0.0-rc  
My PHP version is: 7.4.22  
My Database type and version is: 10.6.4-MariaDB-1:10.6.4+maria~hirsute

**Your problem**  
My problem is:  
I cannot create a new contact. In the interface I am getting a 500 error if I try to create a contact with just name and email.

In the API I get the issue also when using test data

```auto
  $this->testPayload = [
            'firstname' => 'John',
            'lastname' => 'APIDoe',
            'address2' => 'Sam & Sons',
            'email' => 'test@mautic.api',
            'owner' => 1,
            'points' => 3,
            'tags' => [
                'APItag1',
                'APItag2',
            ],
        ];

```

Also I encounter this issue with the API. I am getting 500 error.

These errors are showing in the log (I get same error for API request and for creating a contact in the interface):

When I add a tags field:

`[2021-08-26 07:02:47] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Form\Exception\TransformationFailedException: "Unable to transform value for property path "tags": Expected a Doctrine\Common\Collections\Collection object." at /var/www/vendor/symfony/form/Form.php line 1110 {"exception":"[object] (Symfony\\Component\\Form\\Exception\\TransformationFailedException(code: 0): Unable to transform value for property path \"tags\": Expected a Doctrine\\Common\\Collections\\Collection object. at /var/www/vendor/symfony/form/Form.php:1110, Symfony\\Component\\Form\\Exception\\TransformationFailedException(code: 0): Expected a Doctrine\\Common\\Collections\\Collection object. at /var/www/vendor/symfony/doctrine-bridge/Form/DataTransformer/CollectionToArrayTransformer.php:44)"} []`

When I do not mention any tags :  
`[2021-08-26 06:52:12] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Types\ConversionException: "Serialized array includes null-byte. This cannot be saved as a text. Please check if you not provided object with protected or private members. Serialized Array: a:1:{s:6:"fields";a:1:{s:4:"tags";a:2:{i:0;s:76:"Doctrine\Common\Collections\ArrayCollection@0000000016b5c52b00000000014f4997";i:1;O:43:"Doctrine\Common\Collections\ArrayCollection":1:{s:53:" __NULL_BYTE__ Doctrine\Common\Collections\ArrayCollection __NULL_BYTE__ elements";a:0:{}}}}}" at /var/www/app/bundles/CoreBundle/Doctrine/Type/ArrayType.php line 46 {"exception":"[object] (Doctrine\\DBAL\\Types\\ConversionException(code: 0): Serialized array includes null-byte. This cannot be saved as a text. Please check if you not provided object with protected or private members. Serialized Array: a:1:{s:6:\"fields\";a:1:{s:4:\"tags\";a:2:{i:0;s:76:\"Doctrine\\Common\\Collections\\ArrayCollection@0000000016b5c52b00000000014f4997\";i:1;O:43:\"Doctrine\\Common\\Collections\\ArrayCollection\":1:{s:53:\" __NULL_BYTE__ Doctrine\\Common\\Collections\\ArrayCollection __NULL_BYTE__ elements\";a:0:{}}}}} at /var/www/app/bundles/CoreBundle/Doctrine/Type/ArrayType.php:46)"} []`

Note:

When attempting to create a contact (with only email, for example) in the interface , apart from getting the 500 error, it creates the Contact but on the tags fields it has the following value `Doctrine\Common\Collections\ArrayCollection@0000000037349d4a00000000145e85d4`

Steps I have tried to fix the problem:

I have tried multiple fields combinations for fields with no success.
