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

[4] Cannot install Joomla 4 when using redis as a session store in php.ini #35471

Closed
PhilETaylor opened this issue Sep 3, 2021 · 22 comments
Closed

Comments

@PhilETaylor
Copy link
Contributor

PhilETaylor commented Sep 3, 2021

It seems you cannot install Joomla 4 on a server with this configuration:

session.save_path = "tcp://redis:6379"
session.save_handler = redis

I can replicate the issue.

When going to /installation you get a red screen of death, manually edit /installation/includes/framework.php and set const JDEBUG = true; on line 16 and then you get:

Screenshot 2021-09-05 at 18 45 25

and then if you edit libraries/vendor/joomla/session/src/Storage/NativeStorage.php and add around line 477

error_reporting(E_ALL);
ini_set('display_errors',1);

You can then force the real error:

Warning: SessionHandler::read(): open(tcp://redis:6379/sess_3hhbdjou4hp09aof7355baur7k, O_RDWR) failed: No such file or directory (2) in /application/libraries/vendor/joomla/session/src/Storage/NativeStorage.php on line 480

Warning: session_start(): Failed to read session data: user (path: tcp://redis:6379) in /application/libraries/vendor/joomla/session/src/Storage/NativeStorage.php on line 480

doing some more dumping and you realise the problem is that Joomla is trying to use the FileSystemHandler to read/write to Joomla\CMS\Session\Storage\JoomlaStorage by default and doesnt try to read/write to redis until after Joomla is installed and then configured to use the redis session handler in Joomla Global Config...

This is because JOOMLA doesnt actually know at this point that you want to use redis, because - there is no configuration.php when you first go to /installation out of the box.

I dont have a fix for this, and it doesnt appear "broken" but more "overlooked" during development.

For now, you should be able to remove your php.ini session configuration - install Joomla with no issues - and then USE JOOMLA to configure where to store the Joomla sessions (you can select redis here)

Screenshot 2021-09-05 at 18 52 40

I can then see - after login - the session in redis

jfwbuncla9rhl0ab7d5i1hhutrbjo

joomla|s:772:"TzoyNDoiSm9vbWxhXFJlZ2lzdHJ5XFJlZ2lzdHJ5IjozOntzOjc6IgAqAGRhdGEiO086ODoic3RkQ2xhc3MiOjM6e3M6Nzoic2Vzc2lvbiI7Tzo4OiJzdGRDbGFzcyI6NDp7czo3OiJjb3VudGVyIjtpOjE7czo1OiJ0aW1lciI7Tzo4OiJzdGRDbGFzcyI6Mzp7czo1OiJzdGFydCI7aToxNjMwODY0MzY0O3M6NDoibGFzdCI7aToxNjMwODY0MzY0O3M6Mzoibm93IjtpOjE2MzA4NjQzNjQ7fXM6NjoiY2xpZW50IjtPOjg6InN0ZENsYXNzIjoxOntzOjc6ImFkZHJlc3MiO3M6MTA6IjE3Mi4xOS4wLjEiO31zOjU6InRva2VuIjtzOjMyOiIwNGQxZjliNDU0Y2I4MWI0MTNhZDM3ZTc0Y2I3OTUyOSI7fXM6ODoicmVnaXN0cnkiO086MjQ6Ikpvb21sYVxSZWdpc3RyeVxSZWdpc3RyeSI6Mzp7czo3OiIAKgBkYXRhIjtPOjg6InN0ZENsYXNzIjowOnt9czoxNDoiACoAaW5pdGlhbGl6ZWQiO2I6MDtzOjk6InNlcGFyYXRvciI7czoxOiIuIjt9czo0OiJ1c2VyIjtPOjIwOiJKb29tbGFcQ01TXFVzZXJcVXNlciI6MTp7czoyOiJpZCI7aTowO319czoxNDoiACoAaW5pdGlhbGl6ZWQiO2I6MDtzOjk6InNlcGFyYXRvciI7czoxOiIuIjt9";

Related History

It actually looks like this was set by @wilsonge and @infograf768 here 2924002 in relation to this release blocker #27439

Originally posted by @tholden92 in #30377 (comment)

@tholden92
Copy link

tholden92 commented Sep 3, 2021

More information:

Redis version: 6.0.0
PHP version: 7.4
Joomla version: 4.0.2

Setup is running in Kubernetes cluster.

PHP communicates with Redis using TCP

Please let me know if there is any tests you want me to run.

@alikon
Copy link
Contributor

alikon commented Sep 3, 2021

didn't checked it by myself, but maybe give it a try
follow this tip

* THIS SHOULD ONLY BE USED AS A LAST RESORT WHEN THE WEB INSTALLER FAILS
*
* If you are installing Joomla! manually ie not using the web browser installer
* then rename this file to configuration.php eg
*
* UNIX -> mv configuration.php-dist configuration.php
* Windows -> rename configuration.php-dist configuration.php
*
* Now edit this file and configure the parameters for your site and
* database.
*
* Finally move this file to the root folder of your Joomla installation eg
*
* UNIX -> mv configuration.php ../
* Windows -> copy configuration.php ../

@kamzar1
Copy link

kamzar1 commented Sep 4, 2021

didn't checked it by myself, but maybe give it a try
...

I have tried that with no effect.

@PhilETaylor

This comment was marked as abuse.

@kamzar1
Copy link

kamzar1 commented Sep 4, 2021

One issue is the include ../
In my case it rendered the server root incorrectly, so those included couldn't locate the files.
Somehow i managed to fix the document root by multiple nginx and php-fpm configuration.

@PhilETaylor

This comment was marked as abuse.

@kamzar1
Copy link

kamzar1 commented Sep 4, 2021

No way!
Joomla is perfect!
The standard nginx has worked on 100 other apps.
But hey, you want the most desired, you need to work an little bit harder!

@tholden92
Copy link

I will try the manual install when I am at the computer on monday. Will report back then.

@PhilETaylor

This comment was marked as abuse.

@kamzar1
Copy link

kamzar1 commented Sep 4, 2021

@PhilETaylor
It is a great piece of software, contains decades of work of contributors and one of the reasons it is great, is people like you and me, who care, take their times, and report issues and work to resolve it.
You haven't got those issues. Lucky you.
But every environment is different and eventually needs attention.

@PhilETaylor

This comment was marked as abuse.

@PhilETaylor

This comment was marked as abuse.

@tholden92
Copy link

@PhilETaylor: You are running Joomla 4 with Redis as session store configured in php.ini ? I`m curious as to which version of Redis, PHP and Nginx version you are using if that is the case? Have you configured PHP -> Redis communication using sockets or hostname/ip address and port?

@PhilETaylor

This comment was marked as abuse.

@tholden92
Copy link

tholden92 commented Sep 4, 2021

Thanks. The reason we are doing this is that we are scaling PHP horizontally, so we need session handling across several PHP instances, and Redis acomplishes this for us.

@PhilETaylor

This comment was marked as abuse.

@tholden92
Copy link

tholden92 commented Sep 5, 2021

That is true. We use a common NFS share mounted by all the kubernetes pods :-)

@PhilETaylor

This comment was marked as abuse.

@PhilETaylor

This comment was marked as abuse.

@PhilETaylor

This comment was marked as abuse.

@tholden92
Copy link

That worked perfectly! :-)

Though, it would be great to be able to use Redis from PHP as we have other applications depending on Redis on the PHP level, but I think we can get around that by hosting these somewhere else. At least now we can start testing Joomla 4.

@PhilETaylor

This comment was marked as abuse.

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

5 participants