Magento – Magento 2.3 – Unexpected error Exception: Warning: SessionHandler::read()

centoserrorexception errormagento2.3nginx

I am getting Unexpected error,

Exception: Warning: SessionHandler::read(): open(/var/opt/remi/php72/lib/php/session/sess_5292j25aa4ugpdgrv9r6a3l3p8, O_RDWR) failed: Permission denied (13) in /usr/share/nginx/html/gta/vendor/magento/framework/Session/SaveHandler/Native.php on line 22 in /usr/share/nginx/html/gta/vendor/magento/framework/App/ErrorHandler.php:61

How to solve the error?

Best Answer

For me I have solved this problem by deleting the session that is causing the problem (it is indicated in the message Exception: Warning). Identify this problematic php session in the php session directory, with this command: sudo ls -la var/lib/php/sessions/ For me it's: sess_6uha84kjcvjmq6qjsh0ctee5ff, then simply delete it, being careful to run the rm command with sudo: sudo rm -rf var/lib/php/sessions/sess_6uha84kjcvjmq6qjsh0ctee5ff my site reloaded without problem. I hope this will help you. Made in magento 2.4.2