# Several problems with Hubspot Integration

**URL:** <https://forum.mautic.org/t/several-problems-with-hubspot-integration/9651>\
**Category:** Product Support\
**Created:** [October 6, 2017, 6:34pm UTC](https://forum.mautic.org/t/several-problems-with-hubspot-integration/9651 "2017-10-06T18:34:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sina](https://avatars.discourse-cdn.com/v4/letter/s/ba8739/32.png) [@sina](https://forum.mautic.org/u/sina)\
**Post date:** [October 6, 2017, 6:34pm UTC](https://forum.mautic.org/t/several-problems-with-hubspot-integration/9651/1 "2017-10-06T18:34:41Z")

</div>

Hello everybody,  
  
there are a number of issues regarding Hubspot intergration, that I can’t wrap my head around. Hope someone here can help me:  
  
  
  
1- When I use

Code:

mautic:inetgration:fetchleads --integration:Hubspot

only 281 contacts imported, while I have around 800 contacts. I can import them from csv with no probmlem.  
2- The

Code:

fetchleads

command doesn't update fields if I change a field in Hubspot.  
3- The

Code:

mautic:integration:pushactivity

command doesn't work at all. I assume it should update fields in Hubspot, if I change it in Mautic. Correct me if I'm wrong.  
4- Sometimes I receive a duplication error in my logs:

Code:

mautic.CRITICAL: Uncaught PHP Exception DoctrineDBALExceptionUniqueConstraintViolationException: "An exception occurred while executing 'INSERT INTO lead\_ips\_xref (lead\_id, ip\_id) VALUES (?, ?)' with params [12012, 1837]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '12012-1837' for key 'PRIMARY'" at /var/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 66 {"exception":"[object] (Doctrine\DBAL\Exception\UniqueConstraintViolationException(code: 0): An exception occurred while executing 'INSERT INTO lead\_ips\_xref (lead\_id, ip\_id) VALUES (?, ?)' with params [12012, 1837]:nnSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '12012-1837' for key 'PRIMARY' at /var/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:66, Doctrine\DBAL\Driver\PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '12012-1837' for key 'PRIMARY' at /var/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:93, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '12012-1837' for key 'PRIMARY' at /var/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:91)"} []

Shouldn't Mautic merge duplicates automatically?  
  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![sina](https://avatars.discourse-cdn.com/v4/letter/s/ba8739/32.png) [@sina](https://forum.mautic.org/u/sina)\
**Post date:** [October 6, 2017, 6:34pm UTC](https://forum.mautic.org/t/several-problems-with-hubspot-integration/9651/2 "2017-10-06T18:34:41Z")

</div>

Hello everybody,  
there are a number of issues regarding Hubspot intergration, that I can’t wrap my head around. Hope someone here can help me:

1- When I use `mautic:inetgration:fetchleads --integration:Hubspot` only 281 contacts imported, while I have around 800 contacts. I can import them from csv with no probmlem.  
2- The `fetchleads` command doesn’t update fields if I change a field in Hubspot.  
3- The `mautic:integration:pushactivity` command doesn’t work at all. I assume it should update fields in Hubspot, if I change it in Mautic. Correct me if I’m wrong.  
4- Sometimes I receive a duplication error in my logs:

```auto
mautic.CRITICAL: Uncaught PHP Exception DoctrineDBALExceptionUniqueConstraintViolationException: "An exception occurred while executing 'INSERT INTO lead_ips_xref (lead_id, ip_id) VALUES (?, ?)' with params [12012, 1837]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '12012-1837' for key 'PRIMARY'" at /var/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 66 {"exception":"[object] (Doctrine\DBAL\Exception\UniqueConstraintViolationException(code: 0): An exception occurred while executing 'INSERT INTO lead_ips_xref (lead_id, ip_id) VALUES (?, ?)' with params [12012, 1837]:nnSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '12012-1837' for key 'PRIMARY' at /var/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:66, Doctrine\DBAL\Driver\PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '12012-1837' for key 'PRIMARY' at /var/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:93, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '12012-1837' for key 'PRIMARY' at /var/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:91)"} []
```

Shouldn’t Mautic merge duplicates automatically?

Thanks in advance
