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
Apache SSI Enabled hangs Blitz CP interface #575
Comments
Can you do a test to confirm that SSI has been enabled and is working by manually including an SSI tag and pointing it to a <!--#include virtual="/test.html" --> |
Welp... interestingly — I just updated No idea what the issue was. Closing this question. |
Update: everything works, except the Blitz CP interface still hangs. The Blitz CP interface loads once, but then refreshes of the page seem to hang. |
It almost looks like the Blitz CP interface is redirecting back to the main settings page but hangs the browser. I tried it on 2 other Craft sites. One on the same server, and another on a different server, and all the Blitz installs seem to have this issue. |
Hmm, this must be something to do with your environment setup, as you’re the first person to report this. I’ve attempted a fix in 709d84c, though not sure if this will make any difference. You can test this by running Is your CP site available at the root domain, so at |
Sadly, I tried the fix and doesn't seem to help. :( If Tried it on 2 different servers running the same CraftCMS version, but each with slightly different versions of Apache (2.4.58 and 2.4.52), and and PHP (8.2.x and the other 8.1.x) CraftCMS logs record nothing because the browser locks up before writing to the log file. I might be completely wrong about this, but is there a way to temporarily disable/comment out the code for the SSI detection to see if that's even the issue? |
Another update.
|
Just to confirm, have you enabled SSI by following the instructions at https://putyourlightson.com/plugins/blitz#ssi-enabled? Also, in what specific scenarios does the CP load without any delays and in what does it not? |
You can remove the SSI include in the settings page to test what difference it makes. craft-blitz/src/templates/_settings.twig Line 343 in baeffba
|
I do have all the redirects in place - and I should say, on the front end, SSI all works totally fine now. It's now just the Blitz CP interface that's locking up. I'll try disabling the code for the Blitz CP SSO setting to see if it has an effect. |
THIS DOES have a positive effect! Removing the SSI, allows the Blitz CP to load without issue. I noticed that
And the SSI include code is:
Which means when rendered is:
This is now beyond my knowledge, but could the URL being a query be an issue? But then I checked and that URL does return your js constant:
Could the javascript be somehow looping and not getting what it needs and then just times out after 5 mins? |
I changed that include line to a test file and it loads the Blitz CP just fine:
So there's something about including the javascript that's loading and hanging the page. |
With the change in 709d84c, Can you also test a few variations of the include URI?
craft-blitz/src/templates/_settings.twig Line 343 in baeffba
|
Applying the change in 709d84c Causes I tried both paths you suggest — hard coding them into the Example: Here's the strange thing.... So it seems on "second visit" of the Blitz CP page, it hangs. Is it possible that somehow the Thank you so much for hanging in here on this with me. |
Can you try a using a different web browser? The fact that restarting the browser sometimes solves this might point to a client-side issue rather than a server-side one. I don’t see how or why a JavaScript variable would cause issues for the browser. |
That was my first thought as well - so I tried it in Firefox, Safari, and even on MS Edge in an off-site Windows VM to rule out my home network. All behaves the same way. First load is fine, second load hangs for five or so minutes and comes back showing that SSI is not available (even tho it is) I even tried it on 2 other CraftCMS installs - one on the same LAMP server and one on another LAMP server. Seems odd but must be something I am doing... can't think of what tho. Maybe there is no solution and I can just remember to comment out the BlitzCP SSI tag in the settings template when there is an plugin update. Selfishly ... I could ask for a non JavaScript way to report to users that SSI is enabled or not, but sounds like I'm an edge case so maybe wait and see if anyone else has these issues. |
Have you determined that the JS code is the cause of the issue? |
So this was a good question — I investigated and it seems it's not related to JS code.
So it's not the JS code that's causing the issue. Then I thought....
|
It’s very unlikely that the Twig tag is at fault. I’m almost certain that it is a server config issue. Can you show me the Apache config you used to enabled SSI? I assume you followed the instructions at https://putyourlightson.com/plugins/blitz#ssi-enabled? |
Here's my vhost config.
|
Doing more testing today. I now feel like I have idea what I am talking about anymore... But ... when I do this:
and yet these don't work on refresh:
So whereas the If all this script is meant to do is just prove that SSI works, could it not be just a static file in the blitz plugin that has the JS code? Tho.. it's a far less sexy solution than the Not sure what else I can try. Aside from declaring my own function that overrides the Blitz function of |
My guess is that this specific server-side include is causing an endless redirect due to the action URL format Looking at your Apache configuration, where is the redirect to |
Interesting -- could be!?
The redirect to |
Please share your |
Here's my
|
I’m not sure what to suggest. I could add a config setting to prevent detecting whether SSI is enabled, but only as a last resort. Are you able to replicate this in a local development environment, and if so, can you set up a repo for me to test with? |
No no — I wouldn't ask to make a check box only for me. Yup I'll spool up a dev environment that you can access — I'll try it with a vanilla install of CraftCMS and Blitz and go from there. Give me a day or so. |
Any update on this, @adrianjean? |
I just released 4.8.0 with a small improvement to the SSI detection process. It would be great if you could test and let me know the general status of this issue. |
Apologies — was trying to get that dev server going and got pulled into squashing other bugs on the site. I'll get that dev server up so you can see what's going on — that might help. |
Sounds good! |
Ok!... I managed to isolate the problem... but I still have no idea how/what it could be. Here's what I did:
Next:
Next:
Next - just to confirm:
SO... somehow, on a few sites now — all the ones I tested, I managed to configure them in such a way that it is creating this issue — but I have no clue now what it could be. Could I send you the problem project config and the list of plugins from composer.json to see if this happens to you as well? |
A database dump and the composer files would be great, to support@putyourlightson.com |
Sent! |
I just made a tweak in 0cc030a, which is very unlikely to help, but may still be worth a shot. |
I’ve also added a new config setting that will allow you to override the SSI tag format, which may help with troubleshooting // Default value:
'ssiTagFormat' => '<!--#include virtual="{uri}" -->',
// For troubleshooting:
'ssiTagFormat' => '<!--Placeholder for an SSI tag -->', You can test this by running |
Update: 0cc030a — sadly doesn't have an effect. The include statement itself is where it fails. Configuration setting:
I think with the config setting as a workaround, I'd say this issue is resolved. |
Small note: The |
Please elaborate. |
Ah — ok I was confused about the |
Yeah, it’s a real mystery. I’ve added a new |
Released in 4.9.1. |
Amazing — thank you SO much. If I every find out what's going on I'll update this here. |
I'm having a strange issue.
When I enable Apache Server Side Includes
a2enmod include
, and turn SSI on in the Blitz CP interface (after updating my vhost to process html/php +includes), subsequent refreshes of the Blitz CP interface hang the server. I have to restart Apache to unlock it.I check the running processes on the server and see there's nothing taking up the CPU.
I wonder, if when SSI is checked on, the SSI "confirmation tip" feature is somehow locking the server while it's trying to check if SSI is available, while SSI is enabled?
I also noticed that when I do manage to enable SSI, my site shows in the browser as if it's loading a binary file instead of actual HTML — I turned off gzip in Blitz CP, thinking it was related, but no effect.
I am using a few calls to
craft.blitz.includeCached()
to bring in cached content, so not caching the whole site.Apache: 2.4.5
PHP: 8.2.11
MySQL 8.0.30
Linux 5.15.0-87-generic
CraftCMS: Pro 4.5.9
Blitz: 4.6.0
The text was updated successfully, but these errors were encountered: