# Error Command to add custom fields when adding more than one field

**URL:** https://forum.mautic.org/t/error-command-to-add-custom-fields-when-adding-more-than-one-field/22622
**Category:** Product Support
**Created:** [February 7, 2022, 4:52pm UTC](https://forum.mautic.org/t/error-command-to-add-custom-fields-when-adding-more-than-one-field/22622 "2022-02-07T16:52:55Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![azarate1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/azarate1/32/6274_2.png) [@azarate1](https://forum.mautic.org/u/azarate1)
#### Post date: [February 7, 2022, 4:52pm UTC](https://forum.mautic.org/t/error-command-to-add-custom-fields-when-adding-more-than-one-field/22622/1 "2022-02-07T16:52:55Z")

</div>

**Your software**  
My Mautic version is: 4.1.2  
My PHP version is: 7.4  
My Database type and version is: 10.2.39-MariaDB-10.2.39+maria~stretch

My problem is:  
When executing the command mautic:custom-field:create-column I get the following error.

> In AbstractQuery.php line 840:
> 
> [Doctrine\ORM\NonUniqueResultException]  
> More than one result was found for query although one row or none was expected.

It does this when there are several fields to add, if I only have one it executes it without problem.

These errors are showing in the log:  
This is the trace returned by the command

> In AbstractQuery.php line 840:
> 
> [Doctrine\ORM\NonUniqueResultException]  
> More than one result was found for query although one row or none was expected.
> 
> Exception trace:  
> at /var/www/html/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:840  
> Doctrine\ORM\AbstractQuery-\>getOneOrNullResult() at /var/www/html/app/bundles/LeadBundle/Entity/LeadFieldRepository.php:365  
> Mautic\LeadBundle\Entity\LeadFieldRepository-\>getFieldThatIsMissingColumn() at /var/www/html/app/bundles/LeadBundle/Field/Command/CreateCustomFieldCommand.php:82  
> Mautic\LeadBundle\Field\Command\CreateCustomFieldCommand-\>execute() at /var/www/html/vendor/symfony/console/Command/Command.php:255  
> Symfony\Component\Console\Command\Command-\>run() at /var/www/html/vendor/symfony/console/Application.php:1027  
> Symfony\Component\Console\Application-\>doRunCommand() at /var/www/html/vendor/symfony/framework-bundle/Console/Application.php:97  
> Symfony\Bundle\FrameworkBundle\Console\Application-\>doRunCommand() at /var/www/html/vendor/symfony/console/Application.php:273  
> Symfony\Component\Console\Application-\>doRun() at /var/www/html/vendor/symfony/framework-bundle/Console/Application.php:83  
> Symfony\Bundle\FrameworkBundle\Console\Application-\>doRun() at /var/www/html/vendor/symfony/console/Application.php:149  
> Symfony\Component\Console\Application-\>run() at /var/www/html/bin/console:43  
> Steps I have tried to fix the problem:

---

<div class="post-metadata">

### Author: ![arielesp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/arielesp/32/6597_2.png) [@arielesp](https://forum.mautic.org/u/arielesp)
#### Post date: [January 3, 2023, 12:32pm UTC](https://forum.mautic.org/t/error-command-to-add-custom-fields-when-adding-more-than-one-field/22622/2 "2023-01-03T12:32:34Z")

</div>

Hello,  
Any solution about this?  
I am with the same problem

thanks in advance
