Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug session_storage = redis #6888

Closed
klukaszczyk opened this issue Aug 12, 2019 · 7 comments
Closed

Bug session_storage = redis #6888

klukaszczyk opened this issue Aug 12, 2019 · 7 comments

Comments

@klukaszczyk
Copy link

Hi,
There is a bug on Debian 10.x OS after latest update with redis session enabled in config (config['session_storage'] = 'redis';)
Error details from log file:

[12-Aug-2019 21:13:19 Europe/Berlin] PHP Fatal error: Uncaught Error: Call to a member function get() on bool in /var/www/roundcube/program/lib/Roundcu
be/session/redis.php:102
Stack trace:
#0 [internal function]: rcube_session_redis->read('lca99h4luovpf2u...')
#1 /var/www/roundcube/program/lib/Roundcube/rcube_session.php(138): session_start()
#2 /var/www/roundcube/program/lib/Roundcube/rcube.php(519): rcube_session->start()
#3 /var/www/roundcube/program/include/rcmail.php(487): rcube->session_init()
#4 /var/www/roundcube/program/include/rcmail.php(106): rcmail->session_init()
#5 /var/www/roundcube/program/include/rcmail.php(78): rcmail->startup()
#6 /var/www/roundcube/index.php(43): rcmail::get_instance(0, NULL)
#7 {main}
thrown in /var/www/roundcube/program/lib/Roundcube/session/redis.php on line 102
[12-Aug-2019 21:22:50 +0200]: PHP Error: Request security check failed (POST /?_task=mail&_action=refresh)

Installed redis packages versions as follows:

libhiredis0.14/stable,now 0.14.0-3 amd64 [installed,automatic]
php-redis/unknown,now 5.0.2+4.3.0-2+020190809.14+debian101.gbp070358 amd64 [installed]
redis-server/stable,now 5:5.0.3-4+deb10u1 amd64 [installed]
redis-tools/stable,now 5:5.0.3-4+deb10u1 amd64 [installed,automatic]

OS version:
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian

@alecpl
Copy link
Member

alecpl commented Aug 14, 2019

Indeed that may happen when connection to redis fails (using ping() method). In case of the cache it's not a problem we just work without cache, but we should handle that case better for session.

@alecpl alecpl added this to the later milestone Aug 14, 2019
@alecpl alecpl modified the milestones: later, 1.4.0 Aug 28, 2019
@freultwah
Copy link

Exactly the same error here after upgrading pecl-redis to 5.0.2. Roundcube displays a blank page. Downgrading to pecl-redis 4.2.0 makes the error go away.

@alecpl
Copy link
Member

alecpl commented Sep 23, 2019

Using redis-5.0.2 on roundcube 1.4rc2 I cannot reproduce the error by simply stopping redis server. Could you provide steps to reproduce?

@freultwah
Copy link

freultwah commented Sep 23, 2019

The version of Redis does not really matter that much. The version of the PHP Redis interface extension module makes all the difference here. I am running Redis 5.0.5 and pecl-redis 4.2.0 (that's how the package is called on FreeBSD). Its latest version, 5.0.2, is what makes Roundcube go haywire. Something must have changed when they bumped from 4.3.0 to 5.0.

@HansVanEijsden
Copy link

HansVanEijsden commented Sep 23, 2019

I also have problems with the upgrade from pecl-redis 4.2.0 to pecl-redis 5.0.2. Here's what my PHP error log tells me:

[17-Sep-2019 01:30:50 Europe/Amsterdam] PHP Warning:  session_start(): Failed to read session data: user (path: unix:///var/run/redis.sock) in /home/andstuff/webmail/program/lib/Roundcube/rcube_session.php on line 138
[17-Sep-2019 01:30:50 Europe/Amsterdam] PHP Fatal error:  Uncaught Error: Call to a member function get() on bool in /home/andstuff/webmail/program/lib/Roundcube/session/redis.php:102
Stack trace:
#0 [internal function]: rcube_session_redis->read('f8slj7tnh905jif...')
#1 /home/andstuff/webmail/program/lib/Roundcube/rcube_session.php(138): session_start()
#2 /home/andstuff/webmail/program/lib/Roundcube/rcube.php(477): rcube_session->start()
#3 /home/andstuff/webmail/program/include/rcmail.php(487): rcube->session_init()
#4 /home/andstuff/webmail/program/include/rcmail.php(103): rcmail->session_init()
#5 /home/andstuff/webmail/program/include/rcmail.php(78): rcmail->startup()
#6 /home/andstuff/webmail/index.php(43): rcmail::get_instance(0, NULL)
#7 {main}
  thrown in /home/andstuff/webmail/program/lib/Roundcube/session/redis.php on line 102

In the Roundcube config my session storage was set to redis.

Currently I have set my Roundcube session storage to php. And the session storage of my PHP is also Redis, which works great.
Roundcube 1.4rc1 worked with no errors though.

@alecpl
Copy link
Member

alecpl commented Sep 24, 2019

I identified a couple of places when we can improve the error handling and I found that phpredis's ping() method result has changed in 5.0. I'm working on this. Thanks.

@alecpl
Copy link
Member

alecpl commented Sep 24, 2019

Fixed.

@alecpl alecpl closed this as completed Sep 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants