Forum does not look right unless logged in

Started by jmille44, May 04, 2024, 08:22:30 AM

Previous topic - Next topic

jmille44

My forum does not look like it used to without being logged in.

Once you log in, the forum looks normal again.

Do you have any ideas what is breaking it?

Photos below.

Kindred

What is the url that you are using to access the forum?

What is the url setting in your server settings of smf?

They have to be the same. They currently are not
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Doug Heffernan

Can you run the What is repair_settings.php? and verify that all your forum's paths and urls point to the right location?

Arantor

It's not a repair settings problem, nor is it a domain problem. The domain in question has www defined and is loading the resources normally without a CORS problem. Nor is it HTTPS vs HTTP (because I see HSTS headers so it's explicitly and expressly HTTPS)

Nor is it the index.php problem we've seen before.

(By the way, how I found the site to go investigate... I used Google.)

No, this is *bizarre*. The minified files are requested as normal but the server returns a 0-byte response for them.

I'd say it was file permissions but that would give me a different situation and wouldn't explain why it works for logged-in users and not for guests.

Can you ask your host if they're using something like Varnish and ask them to turn it off? (I don't see the usual headers that would suggest it but I see something in the Server header that seems suggestive.)

Tyrsson

PM at your own risk, some I answer, if they are interesting, some I ignore.

Arantor

Quote from: Tyrsson on May 04, 2024, 12:52:36 PMWhat OS is the server running?

It claims to be something Unixy from the server headers; specifically it advertises itself with Apache/2.4.54 (Unix) and the version of mod_fastcgi is -SNAP-0910052141 so maybe a distro that uses snaps? (Less likely Ubuntu, this advertises itself normally)

Even if it were Unixish file permissions on the files, that wouldn't explain why it works for some users and not others; the writing of the minified JS/CSS isn't privileged in either direction.

Tyrsson

Quote from: Arantor on May 04, 2024, 03:37:48 PM
Quote from: Tyrsson on May 04, 2024, 12:52:36 PMWhat OS is the server running?

It claims to be something Unixy from the server headers; specifically it advertises itself with Apache/2.4.54 (Unix) and the version of mod_fastcgi is -SNAP-0910052141 so maybe a distro that uses snaps? (Less likely Ubuntu, this advertises itself normally)

Even if it were Unixish file permissions on the files, that wouldn't explain why it works for some users and not others; the writing of the minified JS/CSS isn't privileged in either direction.
Yea, but I have run into this in a windows environment due to the file permission handling that SMF does when it writes the minified file (at least that's what comes to mind, it's been awhile). It's been so long I don't recall all of the details :(

I wonder what would happen if those logged in users cleared their browser cache?
PM at your own risk, some I answer, if they are interesting, some I ignore.

Tyrsson

I wonder if its a server misconfiguration that is changing the ownership of that file when php wrote to it the first time?
PM at your own risk, some I answer, if they are interesting, some I ignore.

Arantor

Quote from: Tyrsson on May 04, 2024, 03:53:51 PMYea, but I have run into this in a windows environment due to the file permission handling that SMF does when it writes the minified file (at least that's what comes to mind, it's been awhile). It's been so long I don't recall all of the details :(

I wonder what would happen if those logged in users cleared their browser cache?

Doesn't matter. The file served to guests is zero bytes. I checked this earlier.

I've also spent more than enough time trouble-shooting Windows permissions errors over the years, it doesn't fit the described symptoms either.

Quote from: Tyrsson on May 04, 2024, 03:57:24 PMI wonder if its a server misconfiguration that is changing the ownership of that file when php wrote to it the first time?

If that were the case why would it work for logged-in users but not guest users when both seemingly request the same file?

Tyrsson

Quote from: Arantor on May 04, 2024, 04:19:53 PMDoesn't matter. The file served to guests is zero bytes. I checked this earlier.
I suppose it might matter if the user has the file cached in the browser.
PM at your own risk, some I answer, if they are interesting, some I ignore.

Arantor

Given that I was able to reproduce the broken state myself and verify that it was broken and in the manner in which it was broken... possibly not.

But even then, a cached file would *remain broken* for a logged in user, rather than being broken in the manner which it is currently.

Will be interesting to see if it remains broken tomorrow.

Tyrsson

I wonder if it could be due to it not being able to write to the temp file prior to be it being written out. @SleePy mentioned this to me when I asked if he remembered the issue I had with it awhile back.
PM at your own risk, some I answer, if they are interesting, some I ignore.

Arantor

Again, if that were the case why it would fail for logged out users and work for logged in users, who both request the same file?

Tyrsson

Now that is a great question. The only thing I can think of is that some users have it cached and other do not. It can given unpredictable results.

I wonder if this site is using something like cloudflare as well?
PM at your own risk, some I answer, if they are interesting, some I ignore.

Arantor

Quote from: Tyrsson on May 05, 2024, 03:43:55 AMThe only thing I can think of is that some users have it cached and other do not.

How did the OP produce screenshots before and after in that case?

Also, no CloudFlare. Again, I found the site (it's a trivial Google search away), I actually investigated some of the symptoms myself, though I haven't gone as far as registering an account at this point.

I suspect the host has something related to Varnish set up and the caching is based on whether certain cookies are submitted or not, so I asked the OP to ask their host and see what happens.

SleePy

Well, something like Varnish could do that.  SMF isn't designed to have bits and pieces of its HTML output cached.  It's intended only to cache database queries or complex logic.  Even then, you must properly handle the caching key if it contains user variable data.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Arantor

I know, this is why I asked the OP to talk to his host about it as a first line because while I don't see the usual headers for Varnish, that's not to say there isn't an intermediate caching layer like that.

jmille44

This is a macOS X hosting server.
Mamp Pro server.
It's been running for years without issue, and then the other day, I rebooted the server, and this problem happened.

jmille44

No CloudFlare or Varnish is in use.
I did the repair settings and that did not change anything.

Kindred

Quote from: jmille44 on May 05, 2024, 02:54:44 PMThis is a macOS X hosting server.
Mamp Pro server.


Dear gods... why would anyone ever do that?

Are you saying that you host this yourself?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: