# 500 Error on Dashboard

**URL:** https://forum.mautic.org/t/500-error-on-dashboard/9501
**Category:** Product Support
**Created:** [September 19, 2017, 2:08am UTC](https://forum.mautic.org/t/500-error-on-dashboard/9501 "2017-09-19T02:08:09Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![jfbarnes](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jfbarnes](https://forum.mautic.org/u/jfbarnes)
#### Post date: [September 19, 2017, 2:08am UTC](https://forum.mautic.org/t/500-error-on-dashboard/9501/1 "2017-09-19T02:08:09Z")

</div>

Hi all, I’ve checked out other 500 error threads but they don’t seem to match up so…here’s another one. I’m getting a 500 on the dashboard (only, as far as I can tell) and it seems to all stem from the following query:

Code:

SELECT COUNT(t.id) as quantity, t.country FROM leads t WHERE (t.country IS NOT NULL) AND (t.date\_added BETWEEN ? AND ?) GROUP BY t.country

  
with the error:  
  
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'group\_key'  
  
where seems to change every so often (examples being "Bornholm, Hovedstaden", "Santa Cruz de Tenerife, Spain", and "South Ari Atoll").  
  
We're currently using Mautic (ver 2.9) in tandem with a WordPress site running WP Mautic plugin (ver 2.0.4) on PHP (ver 5.6.30) and MySQL (ver 5.6.37).  
  
Any help would be greatly appreciated.

---

<div class="post-metadata">

### Author: ![jfbarnes](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jfbarnes](https://forum.mautic.org/u/jfbarnes)
#### Post date: [September 19, 2017, 2:08am UTC](https://forum.mautic.org/t/500-error-on-dashboard/9501/2 "2017-09-19T02:08:09Z")

</div>

Hi all, I’ve checked out other 500 error threads but they don’t seem to match up so…here’s another one. I’m getting a 500 on the dashboard (only, as far as I can tell) and it seems to all stem from the following query:

```auto
SELECT COUNT(t.id) as quantity, t.country FROM leads t WHERE (t.country IS NOT NULL) AND (t.date_added BETWEEN ? AND ?) GROUP BY t.country
```

with the error:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘’ for key ‘group\_key’

where seems to change every so often (examples being “Bornholm, Hovedstaden”, “Santa Cruz de Tenerife, Spain”, and “South Ari Atoll”).

We’re currently using Mautic (ver 2.9) in tandem with a WordPress site running WP Mautic plugin (ver 2.0.4) on PHP (ver 5.6.30) and MySQL (ver 5.6.37).

Any help would be greatly appreciated.

---

<div class="post-metadata">

### Author: ![bizcrony](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bizcrony/32/409_2.png) [@bizcrony](https://forum.mautic.org/u/bizcrony)
#### Post date: [September 19, 2017, 8:46am UTC](https://forum.mautic.org/t/500-error-on-dashboard/9501/3 "2017-09-19T08:46:40Z")

</div>

clear cache

---

<div class="post-metadata">

### Author: ![jfbarnes](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jfbarnes](https://forum.mautic.org/u/jfbarnes)
#### Post date: [September 19, 2017, 12:48pm UTC](https://forum.mautic.org/t/500-error-on-dashboard/9501/4 "2017-09-19T12:48:53Z")

</div>

Thanks, Bizcrony, but I’ve already tried this to no avail

---

<div class="post-metadata">

### Author: ![bizcrony](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bizcrony/32/409_2.png) [@bizcrony](https://forum.mautic.org/u/bizcrony)
#### Post date: [September 19, 2017, 2:21pm UTC](https://forum.mautic.org/t/500-error-on-dashboard/9501/5 "2017-09-19T14:21:07Z")

</div>

are you trying to update mautic?

---

<div class="post-metadata">

### Author: ![jfbarnes](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jfbarnes](https://forum.mautic.org/u/jfbarnes)
#### Post date: [September 19, 2017, 11:23pm UTC](https://forum.mautic.org/t/500-error-on-dashboard/9501/6 "2017-09-19T23:23:59Z")

</div>

No, nothing special, just trying to access the dashboard. It seems to be the only page giving me the 500 error. If there is any approach that I can use to post more info, I’d be happy to. The entire error message seems a little redundant, but I’ll post it in case there is a specific that I’m not understanding about it:

mautic.CRITICAL: Uncaught PHP Exception DoctrineDBALExceptionUniqueConstraintViolationException: “An exception occurred while executing ‘SELECT COUNT(t.id) as quantity, t.country FROM leads t WHERE (t.country IS NOT NULL) AND (t.date\_added BETWEEN ? AND ?) GROUP BY t.country’ with params [“2017-08-20 00:00:00”, “2017-09-19 09:38:58”]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘South Ari Atoll’ for key ‘group\_key’” at /home/mauticbnb/public\_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 66 {“exception”:"[object] (Doctrine\DBAL\Exception\UniqueConstraintViolationException(code: 0): An exception occurred while executing ‘SELECT COUNT(t.id) as quantity, t.country FROM leads t WHERE (t.country IS NOT NULL) AND (t.date\_added BETWEEN ? AND ?) GROUP BY t.country’ with params [“2017-08-20 00:00:00”, “2017-09-19 09:38:58”]:nnSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘South Ari Atoll’ for key ‘group\_key’ at /home/mauticbnb/public\_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:66, Doctrine\DBAL\Driver\PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘South Ari Atoll’ for key ‘group\_key’ at /home/mauticbnb/public\_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:93, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘South Ari Atoll’ for key ‘group\_key’ at /home/mauticbnb/public\_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:91)"} []

---

<div class="post-metadata">

### Author: ![cdevogt](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@cdevogt](https://forum.mautic.org/u/cdevogt)
#### Post date: [September 20, 2017, 10:06am UTC](https://forum.mautic.org/t/500-error-on-dashboard/9501/7 "2017-09-20T10:06:06Z")

</div>

Try updating your database schema:

Updates the database schema:  
php app/console doctrine:schema:update --force

May be that will help you out

~Chris

---

<div class="post-metadata">

### Author: ![jfbarnes](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jfbarnes](https://forum.mautic.org/u/jfbarnes)
#### Post date: [September 20, 2017, 12:38pm UTC](https://forum.mautic.org/t/500-error-on-dashboard/9501/8 "2017-09-20T12:38:16Z")

</div>

Hi Chris, thanks for the suggestion. I just tried it, but still getting the same error as above. I also tried clearing and warming up the cache again after the schema update

---

<div class="post-metadata">

### Author: ![jfbarnes](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jfbarnes](https://forum.mautic.org/u/jfbarnes)
#### Post date: [September 21, 2017, 2:38pm UTC](https://forum.mautic.org/t/500-error-on-dashboard/9501/9 "2017-09-21T14:38:02Z")

</div>

Is it possible that I have to reinstall the application? Or could this strictly be a database issue?
