Information Required ?
avatar PhilETaylor
PhilETaylor
15 Aug 2020

Steps to reproduce the issue

Install Joomla 4.0-dev as normal
Provision a redis server (docker is easiest)
Change your Joomla Global Config to use Redis as a session handler with a known db (say, 2)
Click save and close.

Inspect your redis database - note that session metadata WAS written to db 2 correctly.

Attempt to login to Joomla admin again with correct credentials.

Expected result

Login as normal with no problem.

Actual result

Login fails with no error message
A new key is added to redis each login attempt

Screenshot 2020-08-15 at 13 38 54

avatar PhilETaylor PhilETaylor - open - 15 Aug 2020
avatar joomla-cms-bot joomla-cms-bot - change - 15 Aug 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 15 Aug 2020
avatar alikon
alikon - comment - 16 Aug 2020

confirmed on redis 5.0.7 too

avatar alikon
alikon - comment - 16 Aug 2020

off-topic
are you able to install j4 from github latest staging on docker ?
i'm experiencing npm issues......

avatar wilsonge
wilsonge - comment - 17 Oct 2020

Unable to reproduce with redis 4.0.1 & 6.0.3 and php redis 5.3.1 (i'm running redis directly on my macbook - just installed it with homebrew)

avatar Quy Quy - change - 24 Oct 2020
Labels Added: Information Required
avatar Quy Quy - labeled - 24 Oct 2020
avatar PhilETaylor
PhilETaylor - comment - 9 May 2021

Just replicated this again today in production.

avatar alikon
alikon - comment - 9 May 2021

me too my redis version is 6.0.9 , but that doesn't matter here

avatar PhilETaylor
PhilETaylor - comment - 9 May 2021

The problem is when a user logs in we fork the session, that calls session_regenerate_id which in turn is calling close() method in the redishandler.. then there is one call not prefixes with the SELECT 3 before the final one that is

1620577852.929944 [0 127.0.0.1:45328] "SELECT" "3"
1620577852.930576 [3 127.0.0.1:45328] "GET" "jfwq82eg5u74dbd04fgh403583uf9"
1620577853.013048 [3 127.0.0.1:45328] "SETEX" "jfwq82eg5u74dbd04fgh403583uf9" "900" "joomla|s:772:\"TzoyNDoiSm9vbWxhXFJlZ2lzdHJ5XFJlZ2lzdHJ5IjozOntzOjc6IgAqAGRhdGEiO086ODoic3RkQ2xhc3MiOjM6e3M6Nzoic2Vzc2lvbiI7Tzo4OiJzdGRDbGFzcyI6NDp7czo3OiJjb3VudGVyIjtpOjE7czo1OiJ0aW1lciI7Tzo4OiJzdGRDbGFzcyI6Mzp7czo1OiJzdGFydCI7aToxNjIwNTc3ODE2O3M6NDoibGFzdCI7aToxNjIwNTc3ODE2O3M6Mzoibm93IjtpOjE2MjA1Nzc4MTY7fXM6NjoiY2xpZW50IjtPOjg6InN0ZENsYXNzIjoxOntzOjc6ImFkZHJlc3MiO3M6MTA6IjE3Mi4xOS4wLjEiO31zOjU6InRva2VuIjtzOjMyOiJiM2JkZWJmODg3YjllZjJkNmI2YzMzNGY4N2I1NGM2NiI7fXM6ODoicmVnaXN0cnkiO086MjQ6Ikpvb21sYVxSZWdpc3RyeVxSZWdpc3RyeSI6Mzp7czo3OiIAKgBkYXRhIjtPOjg6InN0ZENsYXNzIjowOnt9czoxNDoiACoAaW5pdGlhbGl6ZWQiO2I6MDtzOjk6InNlcGFyYXRvciI7czoxOiIuIjt9czo0OiJ1c2VyIjtPOjIwOiJKb29tbGFcQ01TXFVzZXJcVXNlciI6MTp7czoyOiJpZCI7aTowO319czoxNDoiACoAaW5pdGlhbGl6ZWQiO2I6MDtzOjk6InNlcGFyYXRvciI7czoxOiIuIjt9\";"
# session_regenerate_id happens here
1620577853.013575 [0 127.0.0.1:45332] "GET" "jfw7hcnuunemq7cq4ook4s4fu29km"
1620577853.029165 [0 127.0.0.1:45332] "SETEX" "jfw7hcnuunemq7cq4ook4s4fu29km" "900" "joomla|s:776:\"TzoyNDoiSm9vbWxhXFJlZ2lzdHJ5XFJlZ2lzdHJ5IjozOntzOjc6IgAqAGRhdGEiO086ODoic3RkQ2xhc3MiOjM6e3M6Nzoic2Vzc2lvbiI7Tzo4OiJzdGRDbGFzcyI6NDp7czo3OiJjb3VudGVyIjtpOjI7czo1OiJ0aW1lciI7Tzo4OiJzdGRDbGFzcyI6Mzp7czo1OiJzdGFydCI7aToxNjIwNTc3ODE2O3M6NDoibGFzdCI7aToxNjIwNTc3ODUyO3M6Mzoibm93IjtpOjE2MjA1Nzc4NTM7fXM6NjoiY2xpZW50IjtPOjg6InN0ZENsYXNzIjoxOntzOjc6ImFkZHJlc3MiO3M6MTA6IjE3Mi4xOS4wLjEiO31zOjU6InRva2VuIjtzOjMyOiJiM2JkZWJmODg3YjllZjJkNmI2YzMzNGY4N2I1NGM2NiI7fXM6ODoicmVnaXN0cnkiO086MjQ6Ikpvb21sYVxSZWdpc3RyeVxSZWdpc3RyeSI6Mzp7czo3OiIAKgBkYXRhIjtPOjg6InN0ZENsYXNzIjowOnt9czoxNDoiACoAaW5pdGlhbGl6ZWQiO2I6MDtzOjk6InNlcGFyYXRvciI7czoxOiIuIjt9czo0OiJ1c2VyIjtPOjIwOiJKb29tbGFcQ01TXFVzZXJcVXNlciI6MTp7czoyOiJpZCI7aTo1MDt9fXM6MTQ6IgAqAGluaXRpYWxpemVkIjtiOjA7czo5OiJzZXBhcmF0b3IiO3M6MToiLiI7fQ==\";"

1620577853.037070 [0 127.0.0.1:45336] "SELECT" "3"
1620577853.037602 [3 127.0.0.1:45336] "GET" "jfw7hcnuunemq7cq4ook4s4fu29km"
1620577853.115258 [3 127.0.0.1:45336] "SETEX" "jfw7hcnuunemq7cq4ook4s4fu29km" "900" "joomla|s:772:\"TzoyNDoiSm9vbWxhXFJlZ2lzdHJ5XFJlZ2lzdHJ5IjozOntzOjc6IgAqAGRhdGEiO086ODoic3RkQ2xhc3MiOjM6e3M6Nzoic2Vzc2lvbiI7Tzo4OiJzdGRDbGFzcyI6NDp7czo3OiJjb3VudGVyIjtpOjE7czo1OiJ0aW1lciI7Tzo4OiJzdGRDbGFzcyI6Mzp7czo1OiJzdGFydCI7aToxNjIwNTc3ODUzO3M6NDoibGFzdCI7aToxNjIwNTc3ODUzO3M6Mzoibm93IjtpOjE2MjA1Nzc4NTM7fXM6NjoiY2xpZW50IjtPOjg6InN0ZENsYXNzIjoxOntzOjc6ImFkZHJlc3MiO3M6MTA6IjE3Mi4xOS4wLjEiO31zOjU6InRva2VuIjtzOjMyOiIzYzljMTA4ZDdlYTMzMDMzZTE2MjUyZmRkZGE2NjQ1MCI7fXM6ODoicmVnaXN0cnkiO086MjQ6Ikpvb21sYVxSZWdpc3RyeVxSZWdpc3RyeSI6Mzp7czo3OiIAKgBkYXRhIjtPOjg6InN0ZENsYXNzIjowOnt9czoxNDoiACoAaW5pdGlhbGl6ZWQiO2I6MDtzOjk6InNlcGFyYXRvciI7czoxOiIuIjt9czo0OiJ1c2VyIjtPOjIwOiJKb29tbGFcQ01TXFVzZXJcVXNlciI6MTp7czoyOiJpZCI7aTowO319czoxNDoiACoAaW5pdGlhbGl6ZWQiO2I6MDtzOjk6InNlcGFyYXRvciI7czoxOiIuIjt9\";"
avatar PhilETaylor
PhilETaylor - comment - 9 May 2021

Fix PRed upstream here joomla-framework/session#50

avatar PhilETaylor
PhilETaylor - comment - 10 May 2021

ok this PR upstream now works for login and logout joomla-framework/session#51

avatar PhilETaylor PhilETaylor - change - 14 May 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-05-14 19:56:24
Closed_By PhilETaylor
avatar PhilETaylor PhilETaylor - close - 14 May 2021
avatar PhilETaylor PhilETaylor - change - 14 May 2021
Status Closed New
Closed_Date 2021-05-14 19:56:24
Closed_By PhilETaylor
avatar PhilETaylor PhilETaylor - reopen - 14 May 2021
avatar PhilETaylor
PhilETaylor - comment - 14 May 2021

[4] Reminder to update joomla-framework/session #33778

avatar PhilETaylor PhilETaylor - change - 14 May 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-05-14 19:56:35
Closed_By PhilETaylor
avatar PhilETaylor PhilETaylor - close - 14 May 2021
avatar tholden92
tholden92 - comment - 3 Sep 2021

The installation of Joomla 4 is broken when using redis as a session manager for PHP.

PHP Warning: SessionHandler::read(): open(tcp://redis:6379/sess_nhqdh7rukrs8e9u44fi56hmmh6, O_RDWR) failed: No such file or directory (2) in /mnt/disks/nb-sites/www/xxx.xxx/libraries/vendor/joomla/session/src/Storage/NativeStorage.php

Works fine for Joomla 3

avatar PhilETaylor
PhilETaylor - comment - 3 Sep 2021

What EXACT configuration are you using in Joomla global Config? Also, are you configuring this in Joomla Global Config or php.ini?

avatar tholden92
tholden92 - comment - 3 Sep 2021

Steps to reproduce:

  • Configure Redis as a session store for PHP in php.ini
  • Download clean joomla installation from joomla.org
  • DonĀ“t alter anything in regards to Joomla. Configurations are default.
  • Navigate to the Joomla installation page

Instead of the installation view, you will be greated with this:

image

avatar PhilETaylor
PhilETaylor - comment - 3 Sep 2021

ok so you are configuring in php.ini and not in Joomla - got it.

Now enable debug mode in Joomla Global Config to convert your Red Page of Death to a stack trace and post that here.

avatar PhilETaylor
PhilETaylor - comment - 3 Sep 2021

If Im honest, the message leads me to believe your redis server is not running...

avatar tholden92
tholden92 - comment - 3 Sep 2021

It is running, as it is working fine for installation of Joomla 3 which I did five minutes ago. This is from our production environment were we are running about 70 different Joomla sites. Here is the stack trace:

RuntimeException:
Failed to start the session

at /mnt/disks/nb-sites/www/xxx.xxx/libraries/vendor/joomla/session/src/Storage/NativeStorage.php:480
at Joomla\Session\Storage\NativeStorage->start()
(/mnt/disks/nb-sites/www/xxx.xxx/libraries/src/Session/Storage/JoomlaStorage.php:305)
at Joomla\CMS\Session\Storage\JoomlaStorage->start()
(/mnt/disks/nb-sites/www/xxx.xxx/libraries/vendor/joomla/session/src/Session.php:405)
at Joomla\Session\Session->start()
(/mnt/disks/nb-sites/www/xxx.xxx/libraries/vendor/joomla/session/src/Session.php:332)
at Joomla\Session\Session->has()
(/mnt/disks/nb-sites/www/xxx.xxx/libraries/src/Session/Session.php:201)
at Joomla\CMS\Session\Session->get()
(/mnt/disks/nb-sites/www/xxx.xxx/libraries/src/Application/CMSApplication.php:532)
at Joomla\CMS\Application\CMSApplication->getMessageQueue()
(/mnt/disks/nb-sites/www/xxx.xxx/libraries/src/Document/Renderer/Html/MessageRenderer.php:77)
at Joomla\CMS\Document\Renderer\Html\MessageRenderer->getData()
(/mnt/disks/nb-sites/www/xxx.xxx/libraries/src/Document/Renderer/Html/MessageRenderer.php:38)
at Joomla\CMS\Document\Renderer\Html\MessageRenderer->render()
(/mnt/disks/nb-sites/www/xxx.xxx/libraries/src/Document/HtmlDocument.php:589)
at Joomla\CMS\Document\HtmlDocument->getBuffer()
(/mnt/disks/nb-sites/www/xxx.xxx/libraries/src/Document/HtmlDocument.php:895)
at Joomla\CMS\Document\HtmlDocument->_renderTemplate()
(/mnt/disks/nb-sites/www/xxx.xxx/libraries/src/Document/HtmlDocument.php:660)
at Joomla\CMS\Document\HtmlDocument->render()
(/mnt/disks/nb-sites/www/xxx.xxx/libraries/src/Document/ErrorDocument.php:140)
at Joomla\CMS\Document\ErrorDocument->render()
(/mnt/disks/nb-sites/www/xxx.xxx/libraries/src/Error/Renderer/HtmlRenderer.php:77)
at Joomla\CMS\Error\Renderer\HtmlRenderer->render()
(/mnt/disks/nb-sites/www/xxx.xxx/libraries/src/Exception/ExceptionHandler.php:128)
at Joomla\CMS\Exception\ExceptionHandler::render()
(/mnt/disks/nb-sites/www/xxx.xxx/installation/src/Application/InstallationApplication.php:268)
at Joomla\CMS\Installation\Application\InstallationApplication->execute()
(/mnt/disks/nb-sites/www/xxx.xxx/installation/includes/app.php:65)
at require_once('/mnt/disks/nb-sites/www/xxx.xxx/installation/includes/app.php')
(/mnt/disks/nb-sites/www/xxx.xxx/installation/index.php:36)

avatar PhilETaylor
PhilETaylor - comment - 3 Sep 2021

forked to #35471 as this issue is closed and is a different issue with a different root cause

Just because it worked in Joomla 3 doesnt mean it will in Joomla 4 - considerable changes have been made in Joomla 4.

Add a Comment

Login with GitHub to post a comment