Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Mark S on October 19, 2013, 06:36:02 PM

Title: Website being knocked off-line by cache file?
Post by: Mark S on October 19, 2013, 06:36:02 PM
Twice in 2 days.  I had to go into the forum/cahce folder and manually delete the files in order to bring my website back on-line.

Here's the browser's error message:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE in /home/classig8/public_html/forum/cache/data_da970e2da8edfdf1b5562a2b426c7b03-SMF-modSettings.php on line 1

How can I correct this?
Title: Re: Website being knocked off-line by cache file?
Post by: Bigguy on October 19, 2013, 07:02:30 PM
There could be an error in the modsettings.php file. If it keeps getting cached with that error the problem would repeat itself. Can you post that file.
Title: Re: Website being knocked off-line by cache file?
Post by: Arantor on October 19, 2013, 07:22:12 PM
There would be no point in attaching the file. There is a long standing bug in the caching mechanism in 2.0 that cannot be fixed without breaking other things.
Title: Re: Website being knocked off-line by cache file?
Post by: Bigguy on October 19, 2013, 07:58:40 PM
Does the bug interfere with that file. ?? I'm just saying that I have never had this problem with my site going offline and doing this manually. (Just asking, not arguing ;) )
Title: Re: Website being knocked off-line by cache file?
Post by: Mark S on October 19, 2013, 07:59:16 PM
I've never had this problem before.  It just started like 2 days ago but, I'm wondering if it isn't also tied in with the other issue I posted.  Maybe a result of a cyber-attack on the server?
Title: Re: Website being knocked off-line by cache file?
Post by: Kindred on October 19, 2013, 08:06:47 PM
nah...   it happens - there is a bug somewhere - but the fix is easy.   delete the cache file - it will be regenerated correctly and you'll be all set
Title: Re: Website being knocked off-line by cache file?
Post by: Arantor on October 19, 2013, 08:08:58 PM
Quote from: Bigguy on October 19, 2013, 07:58:40 PM
Does the bug interfere with that file. ?? I'm just saying that I have never had this problem with my site going offline and doing this manually. (Just asking, not arguing ;) )

In 2.0 there is no file called ModSettings.php, it is a file generated when $modSettings is cached. If the settings table is too big, it will not be cached properly because there is a bug in the cache system where the file is only partially emitted causing this.

I know exactly what the bug is, I know exactly how to fix it but we can't do so in 2.0 because of compatibility with hosts. 2.1 has higher requirements, and 2.1 already has it fixed but the fix can't be safely backported to 2.0 at this time.
Title: Re: Website being knocked off-line by cache file?
Post by: Colin on October 19, 2013, 08:09:52 PM
I wasn't aware of this being a known bug. Thanks Arantor.
Title: Re: Website being knocked off-line by cache file?
Post by: Bigguy on October 19, 2013, 08:12:50 PM
Thanks Arantor. That pretty much scratches what I was going to say I guess. :)
Title: Re: Website being knocked off-line by cache file?
Post by: Arantor on October 19, 2013, 08:17:36 PM
Quote from: Colin on October 19, 2013, 08:09:52 PM
I wasn't aware of this being a known bug. Thanks Arantor.

It's been known for literally years now :(
Title: Re: Website being knocked off-line by cache file?
Post by: Mark S on October 19, 2013, 10:09:08 PM
QuoteIn 2.0 there is no file called ModSettings.php, it is a file generated when $modSettings is cached. If the settings table is too big, it will not be cached properly because there is a bug in the cache system where the file is only partially emitted causing this.

Okay, this isn't something I can just "live with" doing every time it happens and have my website off-line every time it happens so, whether or not anyone knew this was an issue doesn't help with the problem so...
... what am I supposed to do about it?

QuoteI know exactly what the bug is, I know exactly how to fix it but we can't do so in 2.0 because of compatibility with hosts. 2.1 has higher requirements, and 2.1 already has it fixed but the fix can't be safely backported to 2.0 at this time.

So, what does that have to do with the problem now?
Title: Re: Website being knocked off-line by cache file?
Post by: Mark S on October 19, 2013, 10:15:41 PM
Quote from: Kindred on October 19, 2013, 08:06:47 PM
nah...   it happens - there is a bug somewhere - but the fix is easy.   delete the cache file - it will be regenerated correctly and you'll be all set

That's what I did, Kindred and it worked like a charm... but then, it happened again.  I'm going to go bonkers if I have to do this every day.
Title: Re: Website being knocked off-line by cache file?
Post by: Arantor on October 19, 2013, 10:17:38 PM
Turn caching off.

QuoteSo, what does that have to do with the problem now?

Um, 2.1 had the same problem but because of the requirements of 2.0 (still supports PHP 4) we can't backport it (since 2.1's fix requires a higher PHP version)

I shouldn't have said anything.
Title: Re: Website being knocked off-line by cache file?
Post by: vbgamer45 on October 19, 2013, 10:25:25 PM
What about just removing the cache  for modSettings in SMF 2.0 in a patch since it doesn't work right anyway.
Title: Re: Website being knocked off-line by cache file?
Post by: Arantor on October 19, 2013, 10:28:07 PM
Well... here's the thing... it's not just modSettings that's actually a potential problem. ALL of the caching potentially could screw up. If the resultant cache file would be more than 8KB, it's going to cause it to fail.

It just so happens that modSettings is the most likely case - and cleaning up the table would also fix that problem.
Title: Re: Website being knocked off-line by cache file?
Post by: Mark S on October 19, 2013, 10:47:24 PM
Thank you.  I turned-off caching.  What effect does this have on forum users.  Is it really something of significant benefit to have caching or is it something of minor convenience?
Title: Re: Website being knocked off-line by cache file?
Post by: Arantor on October 19, 2013, 10:49:54 PM
It is primarily a performance thing, your users are unlikely to notice a significant difference.
Title: Re: Website being knocked off-line by cache file?
Post by: Mark S on October 20, 2013, 09:35:00 AM
Appreciated.   :D