500 Internal Server Error on PrestaShop admin login:
![Unable to generate a URL for the named route "metrics_page" as such route does not exist. image 23 - Unable to generate a URL for the named route "metrics_page" as such route does not exist.](https://i0.wp.com/pcx3.com/wp-content/uploads/2022/05/image-23.png?resize=703%2C338&ssl=1)
![Unable to generate a URL for the named route "metrics_page" as such route does not exist. image 24 1024x193 - Unable to generate a URL for the named route "metrics_page" as such route does not exist.](https://i0.wp.com/pcx3.com/wp-content/uploads/2022/05/image-24.png?resize=736%2C139&ssl=1)
The first step when troubleshooting any application is to check the error logs, in my case all logs are empty, so the next step is to enable debug mode in prestashop:
Open config/defines.inc.php
![Unable to generate a URL for the named route "metrics_page" as such route does not exist. image 27 - Unable to generate a URL for the named route "metrics_page" as such route does not exist.](https://i0.wp.com/pcx3.com/wp-content/uploads/2022/05/image-27.png?resize=395%2C479&ssl=1)
On line 28, you will find this line: define(‘_PS_MODE_DEV_’, false); – replace it with:
define('_PS_MODE_DEV_', true);
![Unable to generate a URL for the named route "metrics_page" as such route does not exist. image 26 - Unable to generate a URL for the named route "metrics_page" as such route does not exist.](https://i0.wp.com/pcx3.com/wp-content/uploads/2022/05/image-26.png?resize=628%2C513&ssl=1)
Then go back to the page that was displaying 500 error:
![Unable to generate a URL for the named route "metrics_page" as such route does not exist. image 25 1024x517 - Unable to generate a URL for the named route "metrics_page" as such route does not exist.](https://i0.wp.com/pcx3.com/wp-content/uploads/2022/05/image-25.png?resize=736%2C372&ssl=1)
In my case the problem Is causing metrics_page route, so the first thing to do is to temporarily disable it.
To disable a module from the database navigate to PHPMyAdmin and inside the ps_tab table for ps_metrics change the 1 to 0.
![Unable to generate a URL for the named route "metrics_page" as such route does not exist. image 28 1024x676 - Unable to generate a URL for the named route "metrics_page" as such route does not exist.](https://i0.wp.com/pcx3.com/wp-content/uploads/2022/05/image-28.png?resize=736%2C486&ssl=1)
To disable a module from the file manager, navigate to modules directory and rename the module name: ps_metrics
![Unable to generate a URL for the named route "metrics_page" as such route does not exist. image 29 - Unable to generate a URL for the named route "metrics_page" as such route does not exist.](https://i0.wp.com/pcx3.com/wp-content/uploads/2022/05/image-29.png?resize=694%2C521&ssl=1)
Then clear the cache by deleting/renaming the folders var/cache folder:
![Unable to generate a URL for the named route "metrics_page" as such route does not exist. image 30 - Unable to generate a URL for the named route "metrics_page" as such route does not exist.](https://i0.wp.com/pcx3.com/wp-content/uploads/2022/05/image-30.png?resize=690%2C413&ssl=1)
I can now access the admin section after deactivating the module that was generating the problem.
Why is the root-cause of the error?
I’ve seen a lot of other PrestaShop users talking about the same issues on forums, but the root cause is well explained here: HOW TO PREVENT ISSUES OF PRESTASHOP METRICS MODULE WHEN UPGRADING TO PRESTASHOP 1.7