No Code Attached Yet
avatar BlackBrix
BlackBrix
17 Aug 2021

Steps to reproduce the issue

  • use 4.0 release 2021-08-17
  • use default template "Cassiopeia"
  • use firefox browser 91.x
  • go to admin backend and activate "system cache" -> "conservative caching"
  • go to frontend again and reload the page (F5 or CTRL-F5)
  • the main menu disappears after some clicks on F5 or CTRL-F5
  • ....
  • go to admin backend again and deactivate "system cache"
  • go to frontend again and reload the page (F5 or CTRL-F5)
  • the main menu appears correctly again immediately

Expected result

  • see above

Actual result

  • see above

System information (as much as possible)

server: --------------------

  • "shared" hosting (using Plesk-Onyx)*
  • server: Apache*
  • sapi_name: cgi-fcgi
  • PHP 7.4.22
  • mySQL 5.7.33
  • PHP-setting: output_buffering: true (I can not change that due to shared hosting)
  • *(Plesk-Onyx-Feature: "intelligent nginx proxy" is active for static files)
  • see attachment:
    systeminfo-2021-08-17T15 03 56+02 00.txt

client: -------------------

  • Windows 10 professional 64bit
  • firefox 91.x

Additional comments

  • "system cache" -> "conservative caching" works perfect on the same server with Joomla 3.10.x
avatar BlackBrix BlackBrix - open - 17 Aug 2021
avatar joomla-cms-bot joomla-cms-bot - change - 17 Aug 2021
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 17 Aug 2021
avatar BlackBrix BlackBrix - change - 17 Aug 2021
The description was changed
avatar BlackBrix BlackBrix - edited - 17 Aug 2021
avatar BlackBrix BlackBrix - change - 17 Aug 2021
The description was changed
avatar BlackBrix BlackBrix - edited - 17 Aug 2021
avatar PhilETaylor
PhilETaylor - comment - 17 Aug 2021

I am unable to replicate this at all.

Tested with output_buffering on/off/4096

Tested with PHP 7.4.22 & 8.09

Even with firefox 91, although the browser is irrelevant for this kind of issue.

avatar brianteeman
brianteeman - comment - 17 Aug 2021

Also see #34568

avatar PhilETaylor
PhilETaylor - comment - 17 Aug 2021

Also see #34568

Strange, but cant fix what I cannot replicate

avatar BlackBrix
BlackBrix - comment - 17 Aug 2021

@PhilETaylor :
I can give you the backend credentials of my joomla 4.0 installation,
so you can replicate it by yourself
(you can not damage anything because it's just a test installation of Joomla 4.x)

I'm almost sure that it has to do with this kind of shared hosting ...

avatar richard67
richard67 - comment - 17 Aug 2021

I don't think it's related, but who knows, so it's worth a try.

@BlackBrix Do you use the htaccess.txt file shipped with Joomla 4? With "use" i mean having copied it to ".htaccess".

If this is the case, edit .htaccess and go to the end. There is following section:

## These directives are only enabled if the Apache mod_headers module is enabled.
## This section will check if a .gz file exists and if so will stream it
##     directly or fallback to gzip any asset on the fly
## If your site starts to look strange after enabling this, and you see
##     ERR_CONTENT_DECODING_FAILED in your browser console network tab,
##     then your server is already gzipping css and js files and you don't need this
##     block enabled in your .htaccess
<IfModule mod_headers.c>
	# Serve gzip compressed CSS files if they exist
	# and the client accepts gzip.
	RewriteCond "%{HTTP:Accept-encoding}" "gzip"
	RewriteCond "%{REQUEST_FILENAME}\.gz" -s
	RewriteRule "^(.*)\.css" "$1\.css\.gz" [QSA]

	# Serve gzip compressed JS files if they exist
	# and the client accepts gzip.
	RewriteCond "%{HTTP:Accept-encoding}" "gzip"
	RewriteCond "%{REQUEST_FILENAME}\.gz" -s
	RewriteRule "^(.*)\.js" "$1\.js\.gz" [QSA]

	# Serve correct content types, and prevent mod_deflate double gzip.
	RewriteRule "\.css\.gz$" "-" [T=text/css,E=no-gzip:1]
	RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1]

	<FilesMatch "(\.js\.gz|\.css\.gz)$">
		# Serve correct encoding type.
		Header append Content-Encoding gzip

		# Force proxies to cache gzipped &
		# non-gzipped css/js files separately.
		Header append Vary Accept-Encoding
	</FilesMatch>
</IfModule>

Can you remove that and check if it works after that?

As said, I don't really think it is related, but I'm not 100% sure.

avatar HLeithner
HLeithner - comment - 17 Aug 2021

@BlackBrix I can't reproduce it on my system if you send me credentials @ harald.leithner@community.joomla.org I can have a look. thx

avatar BlackBrix
BlackBrix - comment - 17 Aug 2021

@richard67 :

"Do you use the htaccess.txt file shipped with Joomla 4?"

no, it's not "in use" = (it's not renamed to ".htaccess")

@HLeithner :
yes, I will send an E-Mail.

avatar BlackBrix
BlackBrix - comment - 17 Aug 2021

I forgot to mention,
that the error appears only, if you are NOT logged in (as an admin) to the front-end.
If I am logged in to the front-end as a superuser I can see all menu items
so please visit the front-end as a guest to see this error

avatar HLeithner
HLeithner - comment - 17 Aug 2021

I think I broke the page... it happens after the cache has been created, when joomla want's to load the cache. Initial it didn't wrote into the /cache directory. I set the cache directly and it got filled but error still exists. Could you check the file permission and maybe setup a new joomla installation :-(

avatar BlackBrix
BlackBrix - comment - 17 Aug 2021

@HLeithner : I set up a new joomla installation -> same credentials

avatar TLWebdesign
TLWebdesign - comment - 17 Aug 2021

I've got the same issue. It needs 2 page refreshes for the menu to disappear. Then after couple minutes it came back again.
j4.tlwebdesign.nl

avatar PhilETaylor
PhilETaylor - comment - 17 Aug 2021

Server: nginx

Are you using Plesk ?

Please upload your system information file downloadable from https://j4.tlwebdesign.nl/administrator/index.php?option=com_admin&view=sysinfo

avatar TLWebdesign
TLWebdesign - comment - 17 Aug 2021

No it's a directadmin server.

systeminfo-2021-08-17T20_35_25+02_00.txt

avatar TLWebdesign
TLWebdesign - comment - 17 Aug 2021

I don't think it's related, but who knows, so it's worth a try.

@BlackBrix Do you use the htaccess.txt file shipped with Joomla 4? With "use" i mean having copied it to ".htaccess".

If this is the case, edit .htaccess and go to the end. There is following section:

## These directives are only enabled if the Apache mod_headers module is enabled.
## This section will check if a .gz file exists and if so will stream it
##     directly or fallback to gzip any asset on the fly
## If your site starts to look strange after enabling this, and you see
##     ERR_CONTENT_DECODING_FAILED in your browser console network tab,
##     then your server is already gzipping css and js files and you don't need this
##     block enabled in your .htaccess
<IfModule mod_headers.c>
	# Serve gzip compressed CSS files if they exist
	# and the client accepts gzip.
	RewriteCond "%{HTTP:Accept-encoding}" "gzip"
	RewriteCond "%{REQUEST_FILENAME}\.gz" -s
	RewriteRule "^(.*)\.css" "$1\.css\.gz" [QSA]

	# Serve gzip compressed JS files if they exist
	# and the client accepts gzip.
	RewriteCond "%{HTTP:Accept-encoding}" "gzip"
	RewriteCond "%{REQUEST_FILENAME}\.gz" -s
	RewriteRule "^(.*)\.js" "$1\.js\.gz" [QSA]

	# Serve correct content types, and prevent mod_deflate double gzip.
	RewriteRule "\.css\.gz$" "-" [T=text/css,E=no-gzip:1]
	RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1]

	<FilesMatch "(\.js\.gz|\.css\.gz)$">
		# Serve correct encoding type.
		Header append Content-Encoding gzip

		# Force proxies to cache gzipped &
		# non-gzipped css/js files separately.
		Header append Vary Accept-Encoding
	</FilesMatch>
</IfModule>

Can you remove that and check if it works after that?

As said, I don't really think it is related, but I'm not 100% sure.

I tried this and it didn't do anything. Same behaviour still.

avatar PhilETaylor
PhilETaylor - comment - 17 Aug 2021

Well the only way we are going to get to the bottom of this is for someone to debug it live on a server that exhibits and can replicate the issue over and over again. I cannot replicate it on any PHP version or dev or cPanel servers with either apache or nginx...

The common bits so far are

phpversion: 7.4.22 or 7.3.28
server: Apache
sapi_name: cgi-fcgi

If anyone is willing to provide a test site then 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 so that we can identify the root cause and fix it.

avatar TLWebdesign
TLWebdesign - comment - 17 Aug 2021

Will do Phil.

avatar Johanv74
Johanv74 - comment - 17 Aug 2021

Ik have this issue also.
The testwebsite is running on DirectAdmin.
In FireFox and Chrome

etting Value
PHP Version 7.4.22
Web Server Apache/2
WebServer to PHP Interface fpm-fcgi
Joomla! Version Joomla! 4.0.0 Stable [ Furaha ] 17-August-2021 12:30 GMT
User Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36

When I disable the Conservative caching, the problem is gone.
When I enable the Conservative caching, the problem is back, after 1 of 2 times refreshing

avatar rachelwalraven
rachelwalraven - comment - 17 Aug 2021

I can reproduce the issue. Both in Firefox and Chrome.

avatar PhilETaylor
PhilETaylor - comment - 17 Aug 2021

This will not be a browser issue.

I can now replicate "something" - one moment

avatar TLWebdesign
TLWebdesign - comment - 17 Aug 2021

If anyone is willing to provide a test site then 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 so that we can identify the root cause and fix it.

You should've received an e-mail. I run my own webserver so we can try out a lot of stuff.

avatar PhilETaylor
PhilETaylor - comment - 17 Aug 2021

Well I can replicate it and i can see it and I know its because somewhere deep in rendering the modules it loses the $attribs for "style" => "card" but I cannot find the exact needle in the haystack with the current level of caffine in my blood system

@wilsonge This needs a Release Blocker label please :)

avatar Quy Quy - change - 17 Aug 2021
Labels Added: ?
avatar Quy Quy - labeled - 17 Aug 2021
avatar joeforjoomla
joeforjoomla - comment - 17 Aug 2021

I'm almost sure that this happened to me too while testing previous RCs. I've noticed modules randomly disappear on the frontend, i've not digged too much but i was under the impression that the issue was related to a self modification of records in the database. Indeed restoring the database from an original backup had the effect to recover all visible modules.

avatar HLeithner
HLeithner - comment - 18 Aug 2021

@PhilETaylor did you actually find the reason? I only checked the admin interface but it was a bit hard without file access to find the real reason...

avatar PhilETaylor
PhilETaylor - comment - 18 Aug 2021

Sorry no, I got lost in all the render methods...got sleepy and gave up after a 2 hours trying to understand it.

I do not understand the various layers of rendering modules and got lost, but its quite easy to replicate and there is a hard coded "style" => "raw" in one of the render methods (but thats not the root reason)

The issue is deep in Joomla PHP rendering modules code, having admin interface access only is not going to help you find it sorry.

avatar BlackBrix
BlackBrix - comment - 18 Aug 2021

@HLeithner
You have File Access cause I gave you an extra FTP Login,
didn't that Work ?

avatar PhilETaylor
PhilETaylor - comment - 18 Aug 2021

Its also something you dont want to be debugging on a live site ;-)

avatar HLeithner
HLeithner - comment - 18 Aug 2021

@HLeithner
You have File Access cause I gave you an extra FTP Login,
didn't that Work ?

Yes wouldhelp.

@PhilETaylor can you replicate it locally?

avatar Fedik
Fedik - comment - 18 Aug 2021

I can replicate it on 4.0 branch,

The menu does not disappears, it just rendered without correct chrome style.

But other menus rendered correctly.

avatar PhilETaylor
PhilETaylor - comment - 18 Aug 2021

Yes I can replicate it every time locally - yes it just loses its style/chrome it doesn't completely disappear but the surrounding "card" html is lost

avatar HLeithner
HLeithner - comment - 18 Aug 2021

oh on my updated site it didn't happens but with the sample data it did, ok so I can replicate it too.

That makes it easier...

avatar Fedik
Fedik - comment - 18 Aug 2021

and I found ,
cache ID does not count [style => raw] attribute, so on second call it rendered without chrome

$module->id . $view_levels . $app->input->getInt('Itemid', null),

if try to make cache ID like

$module->id . $view_levels . $app->input->getInt('Itemid', null) . md5(serialize($cacheparams->methodparams)),

it works again.

hmhm, but this not a right fix

avatar Fedik
Fedik - comment - 18 Aug 2021

I think changing this

{
// Default to itemid creating method and workarounds on
$cacheparams = new \stdClass;
$cacheparams->cachemode = $cachemode;
$cacheparams->class = ModuleHelper::class;
$cacheparams->method = 'renderModule';
$cacheparams->methodparams = array($module, $attribs);
return ModuleHelper::moduleCache($module, $params, $cacheparams);

to something like:

if (isset($attribs['style']) && $attribs['style'] === 'raw')
{
	$cachemode = 'static';
}

// Default to itemid creating method and workarounds on
$cacheparams = new \stdClass;
$cacheparams->cachemode = $cachemode;
$cacheparams->class = ModuleHelper::class;
$cacheparams->method = 'renderModule';
$cacheparams->methodparams = array($module, $attribs);

$result = ModuleHelper::moduleCache($module, $params, $cacheparams);

if (isset($attribs['style']) && $attribs['style'] === 'raw')
{
	$module->content = $result;
	$module->contentRendered = true;
}

return $result;

Should be good.

I will do PR tomorrow, if no one will find something better

avatar Fedik Fedik - change - 19 Aug 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-08-19 08:10:51
Closed_By Fedik
Labels Added: ?
Removed: ?
avatar Fedik Fedik - close - 19 Aug 2021
avatar Fedik
Fedik - comment - 19 Aug 2021

please test #35225

avatar richard67 richard67 - change - 22 Aug 2021
Labels Removed: ?
avatar richard67 richard67 - unlabeled - 22 Aug 2021

Add a Comment

Login with GitHub to post a comment