500 Error on Dashboard

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.

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:

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.

clear cache

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

are you trying to update mautic?

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)"} []

Try updating your database schema:

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

May be that will help you out

~Chris

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

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