Skip to content

Save session to redis error when configured on php level (Exception' with message 'Warning: SessionHandler::read()) #1735

Closed
@biotech

Description

@biotech

If php configured to save session on Redis instead of files - error below appear during the installation process. I use PHP 5.6 and https://github.com/phpredis/phpredis for store session in Redis, after change storage to files - everything works well. It looks like Magento not check if php session storage configured as files and trying to write sessions there. In my case this pretty confusing because i have configured like that

session.save_handler = redis
session.save_path = "/tmp/redis.sock"

So save_patch in that case it's location of Redis socket and Magento trying to write sessions just around that which is for sure cause error. This can cause issue with any other session storage like Memcached etc. I suppose Magento should check session storage type during the installation before write there and maybe support Redis and Memcached by default or if it's not possible (?) - recommend set files as save_handler in php.

nbhjxzx4ogqs3pz9pvs2vpzwbwtecl5cx0pcgh8hfxo

Installing user configuration...
[ERROR] exception 'Exception' with message 'Warning: SessionHandler::read(): open(/tmp/php-sessions/sess_sbiru6o2s28e3b0gq6v6hhlp83, O_RDWR) failed: No such file or directory (2) in /var/www/magento2demo.firebearstudio.com/magento2/lib/internal/Magento/Framework/Session/SaveHandler.php on line 74' in /var/www/magento2demo.firebearstudio.com/magento2/lib/internal/Magento/Framework/App/ErrorHandler.php:67
Stack trace: #0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'SessionHandler:...', '/var/www/magent...', 74, Array)
#1 /var/www/magento2demo.firebearstudio.com/magento2/lib/internal/Magento/Framework/Session/SaveHandler.php(74): SessionHandler->read('sbiru6o2s28e3b0...')
#2 [internal function]: Magento\Framework\Session\SaveHandler->read('sbiru6o2s28e3b0...')
#3 /var/www/magento2demo.firebearstudio.com/magento2/lib/internal/Magento/Framework/Session/SessionManager.php(189): session_start()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for development

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions