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:
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)
I can then see - after login - the session in redis
jfwbuncla9rhl0ab7d5i1hhutrbjo
joomla|s:772:"TzoyNDoiSm9vbWxhXFJlZ2lzdHJ5XFJlZ2lzdHJ5IjozOntzOjc6IgAqAGRhdGEiO086ODoic3RkQ2xhc3MiOjM6e3M6Nzoic2Vzc2lvbiI7Tzo4OiJzdGRDbGFzcyI6NDp7czo3OiJjb3VudGVyIjtpOjE7czo1OiJ0aW1lciI7Tzo4OiJzdGRDbGFzcyI6Mzp7czo1OiJzdGFydCI7aToxNjMwODY0MzY0O3M6NDoibGFzdCI7aToxNjMwODY0MzY0O3M6Mzoibm93IjtpOjE2MzA4NjQzNjQ7fXM6NjoiY2xpZW50IjtPOjg6InN0ZENsYXNzIjoxOntzOjc6ImFkZHJlc3MiO3M6MTA6IjE3Mi4xOS4wLjEiO31zOjU6InRva2VuIjtzOjMyOiIwNGQxZjliNDU0Y2I4MWI0MTNhZDM3ZTc0Y2I3OTUyOSI7fXM6ODoicmVnaXN0cnkiO086MjQ6Ikpvb21sYVxSZWdpc3RyeVxSZWdpc3RyeSI6Mzp7czo3OiIAKgBkYXRhIjtPOjg6InN0ZENsYXNzIjowOnt9czoxNDoiACoAaW5pdGlhbGl6ZWQiO2I6MDtzOjk6InNlcGFyYXRvciI7czoxOiIuIjt9czo0OiJ1c2VyIjtPOjIwOiJKb29tbGFcQ01TXFVzZXJcVXNlciI6MTp7czoyOiJpZCI7aTowO319czoxNDoiACoAaW5pdGlhbGl6ZWQiO2I6MDtzOjk6InNlcGFyYXRvciI7czoxOiIuIjt9";
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)
Labels |
Added:
No Code Attached Yet
|
didn't checked it by myself, but maybe give it a try
follow this tip
joomla-cms/installation/configuration.php-dist
Lines 9 to 23 in 1a6f5ae
didn't checked it by myself, but maybe give it a try
...
I have tried that with no effect.
It reads like some important tricks are hidden somewhere in text file.
Its not hidden, its the manual way to install Joomla
If you are happy to, Please send me your complete site details, including FTP, using the form at https://fix.mySites.guru/now and I'll take a look for FREE to better understand your specific environment and why Joomla is causing an error.
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.
so not a Joomla issue at all then ?
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!
I will try the manual install when I am at the computer on monday. Will report back then.
@kamzar1 well unless you can provide the accurate information then this cannot be resolved. Joomla is installed on nginx on (I guess) millions of sites, including all mine, and I have never had issues with installation process for Joomla 4. In fact 100% of my development for Joomla 4 has been with nginx in dockerised containers.
@tholden92 Im not sure that will fix your issue, which seems unrelated, and might be a genuine issue to resolve
@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.
But you have failed to give even basic information about your environment. I offered to personally look at your environment to understand the issue you have and so far you have not taken up that offer.
One of the reasons that Joomla doesn’t provide a standard development environment (unlike say laravel) is so that differences in environments windows/Linux/mac browsers, versions etc can be random and highlight issues early on in the development - I use nginx redis mysql and docker based containers day in and day out and 8 different PHP versions - others use apache windows Postgres and have never heard of docker, many use real webhosts with cPanel and Plesk for development - by having this we can flag issues with environments early
If you can’t log a highly detailed bug report then we cannot be expected to guess what is different in your environment when it works for millions of others. If we can identify that, and if it’s something within the scope of a mass market open source cms to fix, then it can be fixed in Joomla core.
I offered to look at your specific environment - or even a replicated test case, a specific configuration you say doesn’t work - but you have so far declined to provide that
99% of the time though it’s not a Joomla issue.
Have you read https://docs.joomla.org/Nginx ?
@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?
@tholden92 sorry two totally different conversations. No I don't use php.ini to set a redis session handler at the PHP level. Also, This is extremely rare to see in mainstream web hosting. I hope to personally investigate this issue you reported (which is totally different root issue than the other guy) (and as I have an interest in redis and use it in production every day) as soon as I can, for you, and the Joomla project.
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.
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.
Which is about the only reason ever to do this :-) but as Joomla itself is not horizontally aware, installing a new plugin or anything that modifies files like image uploads, will just simply cause issues, as the files will be uploaded on one instance only, unless you have some kind of file replication
That is true. We use a common NFS share mounted by all the kubernetes pods :-)
Just because you have redis set in php.ini, doesnt mean that Joomla will use that - in my tests, once Joomla is installed, Joomla sessions are ONLY stored in the configured session storage that you configure in Joomla Global Config (configuration.php). EVEN IF YOU HAVE redis configured as a session save path and handler in php.ini
But back to the problem: 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:
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...
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)
I canthen see - after login - the session in redis
jfwbuncla9rhl0ab7d5i1hhutrbjo
joomla|s:772:"TzoyNDoiSm9vbWxhXFJlZ2lzdHJ5XFJlZ2lzdHJ5IjozOntzOjc6IgAqAGRhdGEiO086ODoic3RkQ2xhc3MiOjM6e3M6Nzoic2Vzc2lvbiI7Tzo4OiJzdGRDbGFzcyI6NDp7czo3OiJjb3VudGVyIjtpOjE7czo1OiJ0aW1lciI7Tzo4OiJzdGRDbGFzcyI6Mzp7czo1OiJzdGFydCI7aToxNjMwODY0MzY0O3M6NDoibGFzdCI7aToxNjMwODY0MzY0O3M6Mzoibm93IjtpOjE2MzA4NjQzNjQ7fXM6NjoiY2xpZW50IjtPOjg6InN0ZENsYXNzIjoxOntzOjc6ImFkZHJlc3MiO3M6MTA6IjE3Mi4xOS4wLjEiO31zOjU6InRva2VuIjtzOjMyOiIwNGQxZjliNDU0Y2I4MWI0MTNhZDM3ZTc0Y2I3OTUyOSI7fXM6ODoicmVnaXN0cnkiO086MjQ6Ikpvb21sYVxSZWdpc3RyeVxSZWdpc3RyeSI6Mzp7czo3OiIAKgBkYXRhIjtPOjg6InN0ZENsYXNzIjowOnt9czoxNDoiACoAaW5pdGlhbGl6ZWQiO2I6MDtzOjk6InNlcGFyYXRvciI7czoxOiIuIjt9czo0OiJ1c2VyIjtPOjIwOiJKb29tbGFcQ01TXFVzZXJcVXNlciI6MTp7czoyOiJpZCI7aTowO319czoxNDoiACoAaW5pdGlhbGl6ZWQiO2I6MDtzOjk6InNlcGFyYXRvciI7czoxOiIuIjt9";
Ive updated the opening text of the issue to reflect the true nature of the problem
It actually looks like this was set by @wilsonge and @infograf768 here 2924002 in relation to this release blocker #27439
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.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-09-06 17:44:49 |
Closed_By | ⇒ | PhilETaylor |
well I'll close this now, as it looks like it was hard coded this way for a reason and if @wilsonge or @infograf768 have comments, or think that reason now is wrong we can revisit this later.
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.