# Segments page. 500 Internal Server Error

**URL:** <https://forum.mautic.org/t/segments-page-500-internal-server-error/29223>\
**Category:** Product Support\
**Created:** [September 8, 2023, 11:15am UTC](https://forum.mautic.org/t/segments-page-500-internal-server-error/29223 "2023-09-08T11:15:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilia77717](https://avatars.discourse-cdn.com/v4/letter/i/f0a364/32.png) [@ilia77717](https://forum.mautic.org/u/ilia77717)\
**Post date:** [September 8, 2023, 11:15am UTC](https://forum.mautic.org/t/segments-page-500-internal-server-error/29223/1 "2023-09-08T11:15:54Z")

</div>

**Your software**  
My Mautic version is:4.4.10

**Your problem**  
My problem is:already the second day, I have an error when going to the “segments” page. **500 Internal Server Error**

Please help me

 ![screenshot20230908081459aaaa](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/8/8708621ada5147ddbde8360825f62e1725cab707.png)

---

<div class="post-metadata">

**Author:** ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)\
**Post date:** [September 8, 2023, 1:14pm UTC](https://forum.mautic.org/t/segments-page-500-internal-server-error/29223/2 "2023-09-08T13:14:42Z")

</div>

500 error is very general. You will need to check the logs to get a better error message to see what is wrong.

In the settings under system info there is a log section that might show the error message. If there is an error share there here.

If there is no error showing there you will need to check some other logs that require looking into a few folders and files on your server. Do you have terminal/console/cli/putty access to your server?

---

<div class="post-metadata">

**Author:** ![ilia77717](https://avatars.discourse-cdn.com/v4/letter/i/f0a364/32.png) [@ilia77717](https://forum.mautic.org/u/ilia77717)\
**Post date:** [September 8, 2023, 1:33pm UTC](https://forum.mautic.org/t/segments-page-500-internal-server-error/29223/3 "2023-09-08T13:33:19Z")

</div>

[2023-09-08 13:31:27] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DriverException: “An exception occurred while executing ‘SELECT count(l.lead\_id) as thecount, l.leadlist\_id FROM lead\_lists\_leads l USE INDEX (manually\_removed) WHERE (l.leadlist\_id = 21) AND (l.manually\_removed = ?) GROUP BY l.leadlist\_id’ with params [0]: SQLSTATE[42000]: Syntax error or access violation: 1176 Key ‘manually\_removed’ doesn’t exist in table ‘l’” at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 128 {“exception”:“[object] (Doctrine\DBAL\Exception\DriverException(code: 0): An exception occurred while executing ‘SELECT count(l.lead\_id) as thecount, l.leadlist\_id FROM lead\_lists\_leads l USE INDEX (manually\_removed) WHERE (l.leadlist\_id = 21) AND (l.manually\_removed = ?) GROUP BY l.leadlist\_id’ with params [0]:\n\nSQLSTATE[42000]: Syntax error or access violation: 1176 Key ‘manually\_removed’ doesn’t exist in table ‘l’ at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:128, Doctrine\DBAL\Driver\PDO\Exception(code: 42000): SQLSTATE[42000]: Syntax error or access violation: 1176 Key ‘manually\_removed’ doesn’t exist in table ‘l’ at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18, PDOException(code: 42000): SQLSTATE[42000]: Syntax error or access violation: 1176 Key ‘manually\_removed’ doesn’t exist in table ‘l’ at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117)”} {“hostname”:“creditgo\_mautic”,“pid”:11065}

---

<div class="post-metadata">

**Author:** ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)\
**Post date:** [September 8, 2023, 1:56pm UTC](https://forum.mautic.org/t/segments-page-500-internal-server-error/29223/4 "2023-09-08T13:56:41Z")

</div>

The log entry you provided is a critical error message from Mautic. It indicates that an uncaught PHP exception of type Doctrine\DBAL\Exception\DriverException has occurred while executing a SQL query. The error message suggests a problem with the SQL query itself, specifically, the use of an index named “manually\_removed” on table “l,” which doesn’t exist in the table structure.

`"An exception occurred while executing 'SELECT count(l.lead_id) as thecount, l.leadlist_id FROM lead_lists_leads l USE INDEX (manually_removed) WHERE (l.leadlist_id = 21) AND (l.manually_removed = ?) GROUP BY l.leadlist_id' with params [0]: SQLSTATE[42000]: Syntax error or access violation: 1176 Key 'manually_removed' doesn't exist in table 'l'"` :

The error message, which indicates that there is no “manually\_removed” index in the “l” table.

I am not skilled enough with Mysql to help much further but “Manually” suggests you perhaps have edited some data in the database directly and this is causing issues. The issue seems to be the segment with ID 21.

Hopefully some with more techy skills can see the issue and guide you on how to fix it.

---

<div class="post-metadata">

**Author:** ![mr\_agung](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mr_agung/32/9610_2.png) [@mr\_agung](https://forum.mautic.org/u/mr_agung)\
**Post date:** [September 9, 2023, 1:12pm UTC](https://forum.mautic.org/t/segments-page-500-internal-server-error/29223/5 "2023-09-09T13:12:02Z")

</div>

Tray to access to yourdomain(dot)com/s/update/schema

---

<div class="post-metadata">

**Author:** ![adiux](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/adiux/32/5793_2.png) [@adiux](https://forum.mautic.org/u/adiux)\
**Post date:** [September 15, 2023, 5:48am UTC](https://forum.mautic.org/t/segments-page-500-internal-server-error/29223/6 "2023-09-15T05:48:29Z")

</div>

If that does not work, and you have access to the console, you can also run the command directly from the console:

`bin/console doctrine:migrations:migrate`

---

<div class="post-metadata">

**Author:** ![adrianmaj\_idm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/adrianmaj_idm/32/12727_2.png) [@adrianmaj\_idm](https://forum.mautic.org/u/adrianmaj_idm)\
**Post date:** [December 5, 2024, 11:28am UTC](https://forum.mautic.org/t/segments-page-500-internal-server-error/29223/7 "2024-12-05T11:28:38Z")

</div>

Hey, I have the same problem when entering contacts or segments section. Did you have any fix for that? It happened when migrating from 5.0.0 to 5.2.0, and now I can’t even revert back to 5.0.0 because i got the same DB error.
