# Landing page throws "500 Internal Server Error" when not logged in after Mautic Upgrade

**URL:** <https://forum.mautic.org/t/landing-page-throws-500-internal-server-error-when-not-logged-in-after-mautic-upgrade/19114>\
**Category:** Mautic 3 - Install/Upgrade Support\
**Tags:** mautic-3\
**Created:** [April 21, 2021, 10:14am UTC](https://forum.mautic.org/t/landing-page-throws-500-internal-server-error-when-not-logged-in-after-mautic-upgrade/19114 "2021-04-21T10:14:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![blu-it](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/blu-it/32/5005_2.png) [@blu-it](https://forum.mautic.org/u/blu-it)\
**Post date:** [April 21, 2021, 10:14am UTC](https://forum.mautic.org/t/landing-page-throws-500-internal-server-error-when-not-logged-in-after-mautic-upgrade/19114/1 "2021-04-21T10:14:17Z")

</div>

**Your software**  
My Mautic version is: 3.3.2  
My PHP version is: 7.3  
My Database type and version is: 8.0.13

**Your problem**  
My problem is:

I made an upgrade from Mautic v. 2.x to 3.3.8 via the webinterface with already existing and published landing-page. After that I tried to visit my landing page and it is only loaded and displayed correctly when I am logged in in Mautic.  
When I am logged out of Mautic and load the landing page (that is published) I get “500 Internal Server Error”.

These errors are showing in the log:

```
[2021-04-21 07:03:53] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\UniqueConstraintViolationException: "An exception occurred while executing 'INSERT INTO lead_devices (date_added, client_info, device, device_os_name, device_os_shortname, device_os_version, device_os_platform, device_brand, device_model, tracking_id, lead_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["2021-04-21 07:03:53", "a:6:{s:4:\"type\";s:7:\"browser\";s:4:\"name\";s:6:\"Chrome\";s:10:\"short_name\";s:2:\"CH\";s:7:\"version\";s:4:\"31.0\";s:6:\"engine\";s:5:\"Blink\";s:14:\"engine_version\";s:0:\"\";}", "desktop", "Windows", "WIN", "7", "x64", "", "", "b9998uz66tmdcox5416oanq", "816"]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'" at /home/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 55 {"exception":"[object] (Doctrine\\DBAL\\Exception\\UniqueConstraintViolationException(code: 0): An exception occurred while executing 'INSERT INTO lead_devices (date_added, client_info, device, device_os_name, device_os_shortname, device_os_version, device_os_platform, device_brand, device_model, tracking_id, lead_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [\"2021-04-21 07:03:53\", \"a:6:{s:4:\\\"type\\\";s:7:\\\"browser\\\";s:4:\\\"name\\\";s:6:\\\"Chrome\\\";s:10:\\\"short_name\\\";s:2:\\\"CH\\\";s:7:\\\"version\\\";s:4:\\\"31.0\\\";s:6:\\\"engine\\\";s:5:\\\"Blink\\\";s:14:\\\"engine_version\\\";s:0:\\\"\\\";}\", \"desktop\", \"Windows\", \"WIN\", \"7\", \"x64\", \"\", \"\", \"b9998uz66tmdcox5416oanq\", \"816\"]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' at /home/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:55, Doctrine\\DBAL\\Driver\\PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' at /home/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:123, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' at /home/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:121)"} []
[2021-04-21 07:03:55] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\UniqueConstraintViolationException: "An exception occurred while executing 'INSERT INTO lead_devices (date_added, client_info, device, device_os_name, device_os_shortname, device_os_version, device_os_platform, device_brand, device_model, tracking_id, lead_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["2021-04-21 07:03:55", "a:6:{s:4:\"type\";s:7:\"browser\";s:4:\"name\";s:6:\"Chrome\";s:10:\"short_name\";s:2:\"CH\";s:7:\"version\";s:4:\"31.0\";s:6:\"engine\";s:5:\"Blink\";s:14:\"engine_version\";s:0:\"\";}", "desktop", "Windows", "WIN", "7", "x64", "", "", "db9kztal3m05eztla3i3vnm", "817"]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'" at /home/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 55 {"exception":"[object] (Doctrine\\DBAL\\Exception\\UniqueConstraintViolationException(code: 0): An exception occurred while executing 'INSERT INTO lead_devices (date_added, client_info, device, device_os_name, device_os_shortname, device_os_version, device_os_platform, device_brand, device_model, tracking_id, lead_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [\"2021-04-21 07:03:55\", \"a:6:{s:4:\\\"type\\\";s:7:\\\"browser\\\";s:4:\\\"name\\\";s:6:\\\"Chrome\\\";s:10:\\\"short_name\\\";s:2:\\\"CH\\\";s:7:\\\"version\\\";s:4:\\\"31.0\\\";s:6:\\\"engine\\\";s:5:\\\"Blink\\\";s:14:\\\"engine_version\\\";s:0:\\\"\\\";}\", \"desktop\", \"Windows\", \"WIN\", \"7\", \"x64\", \"\", \"\", \"db9kztal3m05eztla3i3vnm\", \"817\"]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' at /home/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:55, Doctrine\\DBAL\\Driver\\PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' at /home/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:123, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' at /home/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:121)"} []
[2021-04-21 07:03:57] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\UniqueConstraintViolationException: "An exception occurred while executing 'INSERT INTO lead_devices (date_added, client_info, device, device_os_name, device_os_shortname, device_os_version, device_os_platform, device_brand, device_model, tracking_id, lead_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["2021-04-21 07:03:57", "a:6:{s:4:\"type\";s:7:\"browser\";s:4:\"name\";s:6:\"Chrome\";s:10:\"short_name\";s:2:\"CH\";s:7:\"version\";s:4:\"31.0\";s:6:\"engine\";s:5:\"Blink\";s:14:\"engine_version\";s:0:\"\";}", "desktop", "Windows", "WIN", "7", "x64", "", "", "go6ep5edq8h2rs2lzoo9hjg", "818"]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'" at /home/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 55 {"exception":"[object] (Doctrine\\DBAL\\Exception\\UniqueConstraintViolationException(code: 0): An exception occurred while executing 'INSERT INTO lead_devices (date_added, client_info, device, device_os_name, device_os_shortname, device_os_version, device_os_platform, device_brand, device_model, tracking_id, lead_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [\"2021-04-21 07:03:57\", \"a:6:{s:4:\\\"type\\\";s:7:\\\"browser\\\";s:4:\\\"name\\\";s:6:\\\"Chrome\\\";s:10:\\\"short_name\\\";s:2:\\\"CH\\\";s:7:\\\"version\\\";s:4:\\\"31.0\\\";s:6:\\\"engine\\\";s:5:\\\"Blink\\\";s:14:\\\"engine_version\\\";s:0:\\\"\\\";}\", \"desktop\", \"Windows\", \"WIN\", \"7\", \"x64\", \"\", \"\", \"go6ep5edq8h2rs2lzoo9hjg\", \"818\"]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' at /home/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:55, Doctrine\\DBAL\\Driver\\PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' at /home/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:123, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' at /home/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:121)"} []
[2021-04-21 09:23:49] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\UniqueConstraintViolationException: "An exception occurred while executing 'INSERT INTO lead_devices (date_added, client_info, device, device_os_name, device_os_shortname, device_os_version, device_os_platform, device_brand, device_model, tracking_id, lead_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["2021-04-21 09:23:49", "a:6:{s:4:\"type\";s:7:\"browser\";s:4:\"name\";s:7:\"Firefox\";s:10:\"short_name\";s:2:\"FF\";s:7:\"version\";s:4:\"77.0\";s:6:\"engine\";s:5:\"Gecko\";s:14:\"engine_version\";s:0:\"\";}", "desktop", "Mac", "MAC", "10.15", "", "AP", "", "dsggzl6k5lt1rs3qkq313jo", "819"]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'" at /home/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 55 {"exception":"[object] (Doctrine\\DBAL\\Exception\\UniqueConstraintViolationException(code: 0): An exception occurred while executing 'INSERT INTO lead_devices (date_added, client_info, device, device_os_name, device_os_shortname, device_os_version, device_os_platform, device_brand, device_model, tracking_id, lead_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [\"2021-04-21 09:23:49\", \"a:6:{s:4:\\\"type\\\";s:7:\\\"browser\\\";s:4:\\\"name\\\";s:7:\\\"Firefox\\\";s:10:\\\"short_name\\\";s:2:\\\"FF\\\";s:7:\\\"version\\\";s:4:\\\"77.0\\\";s:6:\\\"engine\\\";s:5:\\\"Gecko\\\";s:14:\\\"engine_version\\\";s:0:\\\"\\\";}\", \"desktop\", \"Mac\", \"MAC\", \"10.15\", \"\", \"AP\", \"\", \"dsggzl6k5lt1rs3qkq313jo\", \"819\"]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' at /home/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:55, Doctrine\\DBAL\\Driver\\PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' at /home/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:123, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' at /home/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:121)"} []
[2021-04-21 09:51:51] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\UniqueConstraintViolationException: "An exception occurred while executing 'INSERT INTO lead_devices (date_added, client_info, device, device_os_name, device_os_shortname, device_os_version, device_os_platform, device_brand, device_model, tracking_id, lead_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["2021-04-21 09:51:50", "a:6:{s:4:\"type\";s:7:\"browser\";s:4:\"name\";s:7:\"Firefox\";s:10:\"short_name\";s:2:\"FF\";s:7:\"version\";s:4:\"88.0\";s:6:\"engine\";s:5:\"Gecko\";s:14:\"engine_version\";s:0:\"\";}", "desktop", "Windows", "WIN", "10", "x64", "", "", "67mh0nkd2wsl2iqudnlsp9z", "820"]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'" at /home/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 55 {"exception":"[object] (Doctrine\\DBAL\\Exception\\UniqueConstraintViolationException(code: 0): An exception occurred while executing 'INSERT INTO lead_devices (date_added, client_info, device, device_os_name, device_os_shortname, device_os_version, device_os_platform, device_brand, device_model, tracking_id, lead_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [\"2021-04-21 09:51:50\", \"a:6:{s:4:\\\"type\\\";s:7:\\\"browser\\\";s:4:\\\"name\\\";s:7:\\\"Firefox\\\";s:10:\\\"short_name\\\";s:2:\\\"FF\\\";s:7:\\\"version\\\";s:4:\\\"88.0\\\";s:6:\\\"engine\\\";s:5:\\\"Gecko\\\";s:14:\\\"engine_version\\\";s:0:\\\"\\\";}\", \"desktop\", \"Windows\", \"WIN\", \"10\", \"x64\", \"\", \"\", \"67mh0nkd2wsl2iqudnlsp9z\", \"820\"]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' at /home/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:55, Doctrine\\DBAL\\Driver\\PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' at /home/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:123, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' at /home/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:121)"} []
[2021-04-21 11:58:38] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\UniqueConstraintViolationException: "An exception occurred while executing 'INSERT INTO lead_devices (date_added, client_info, device, device_os_name, device_os_shortname, device_os_version, device_os_platform, device_brand, device_model, tracking_id, lead_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["2021-04-21 09:58:38", "a:6:{s:4:\"type\";s:7:\"browser\";s:4:\"name\";s:7:\"Firefox\";s:10:\"short_name\";s:2:\"FF\";s:7:\"version\";s:4:\"88.0\";s:6:\"engine\";s:5:\"Gecko\";s:14:\"engine_version\";s:0:\"\";}", "desktop", "Windows", "WIN", "10", "x64", "", "", "zz8poqg2682q8kllcyvamqn", "821"]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'" at /home/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 55 {"exception":"[object] (Doctrine\\DBAL\\Exception\\UniqueConstraintViolationException(code: 0): An exception occurred while executing 'INSERT INTO lead_devices (date_added, client_info, device, device_os_name, device_os_shortname, device_os_version, device_os_platform, device_brand, device_model, tracking_id, lead_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [\"2021-04-21 09:58:38\", \"a:6:{s:4:\\\"type\\\";s:7:\\\"browser\\\";s:4:\\\"name\\\";s:7:\\\"Firefox\\\";s:10:\\\"short_name\\\";s:2:\\\"FF\\\";s:7:\\\"version\\\";s:4:\\\"88.0\\\";s:6:\\\"engine\\\";s:5:\\\"Gecko\\\";s:14:\\\"engine_version\\\";s:0:\\\"\\\";}\", \"desktop\", \"Windows\", \"WIN\", \"10\", \"x64\", \"\", \"\", \"zz8poqg2682q8kllcyvamqn\", \"821\"]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' at /home/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:55, Doctrine\\DBAL\\Driver\\PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' at /home/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:123, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' at /home/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:121)"} []

```

Steps I have tried to fix the problem:

I double checked all steps mentioned here: [Update Failed | Mautic](https://docs.mautic.org/en/troubleshooting/update-failed) and ended up with a manual new installation considered as last step.  
Using the existing already upgraded database still leads me to the error 500.  
Tried to switch back to Mautic v. 2 with database backup of v2., but I get the same error and behavior.

Any idea?

Thanks!

---

<div class="post-metadata">

**Author:** ![blu-it](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/blu-it/32/5005_2.png) [@blu-it](https://forum.mautic.org/u/blu-it)\
**Post date:** [May 10, 2021, 9:27am UTC](https://forum.mautic.org/t/landing-page-throws-500-internal-server-error-when-not-logged-in-after-mautic-upgrade/19114/2 "2021-05-10T09:27:53Z")

</div>

Meanwhile I upgraded to v. 3.3.3, but still the same problem: When I am not logged in in mautic, on my landing page is shown"500 Internal Server Error".

No one any idea?

---

<div class="post-metadata">

**Author:** ![misc](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/misc/32/422_2.png) [@misc](https://forum.mautic.org/u/misc)\
**Post date:** [May 10, 2021, 11:58am UTC](https://forum.mautic.org/t/landing-page-throws-500-internal-server-error-when-not-logged-in-after-mautic-upgrade/19114/3 "2021-05-10T11:58:06Z")

</div>

I have the exact same problem. Would be nice to get a hint here. thanks in advance to all contributing!

---

<div class="post-metadata">

**Author:** ![ni1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ni1/32/6488_2.png) [@ni1](https://forum.mautic.org/u/ni1)\
**Post date:** [February 16, 2022, 11:45pm UTC](https://forum.mautic.org/t/landing-page-throws-500-internal-server-error-when-not-logged-in-after-mautic-upgrade/19114/4 "2022-02-16T23:45:40Z")

</div>

alguien q pueda solucionar eso, necesito dessuscribirme de los correos electrónicos, gracias.

# Uh oh! I think I broke it. If I do it again, please report me to the system administrator!

#### **500** Internal Server Error

-Mautibot

[https://emails.tutellus.com/email/unsubscribe/61eee5af18d88137243178](https://emails.tutellus.com/email/unsubscribe/61eee5af18d88137243178)  
[https://emails.tutellus.com/email/unsubscribe/620537897fdb6978712263](https://emails.tutellus.com/email/unsubscribe/620537897fdb6978712263)

---

<div class="post-metadata">

**Author:** ![raramuridesign](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/raramuridesign/32/13226_2.png) [@raramuridesign](https://forum.mautic.org/u/raramuridesign)\
**Post date:** [February 17, 2022, 10:37am UTC](https://forum.mautic.org/t/landing-page-throws-500-internal-server-error-when-not-logged-in-after-mautic-upgrade/19114/5 "2022-02-17T10:37:15Z")

</div>

@blu-it  
Your database table called `lead_devices` - this has duplicate info it is trying to insert.  
What you could do is try to remove the entries here, if you are not bothered about the stats

Your errors is  
`[2021-04-21 07:03:53] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\UniqueConstraintViolationException: "An exception occurred while executing 'INSERT INTO lead_devices (date_added`

`1062 Duplicate entry '0' for key 'PRIMARY'" at `

_Ensure you backup the data before trying this._

M
