Page 1 of 1

Site broken

Posted: Fri Feb 07, 2020 11:42 pm
by SYSTEM
See the screenshot below. It's the entire main page. It shows only two programs. Other pages are similarly broken as well - they abruptly end after showing a couple of entries.
2020-02-08 09.39.18 www.portablefreeware.com 0f9f7a3e866d.png

Re: Site broken

Posted: Sat Feb 08, 2020 3:36 am
by Andrew Lee
Working on it..

Update: Fixed.

Wow, I certainly wasn't ready to chase down this rabbit hole..

After putting up cli.portablefreeware.com, I had a little time on my hand. So I decided to work on something I have been putting off for a long time: upgrading PHP to the latest version.

Now since this is a minor version upgrade i.e 7.x to 7.y, I wasn't expecting much of a problem. phpBB worked. A few direct listings worked. I was ready to call it a night when I saw what had happened.

Trouble was, nothing was logged to the error logs! Normally when you have a PHP error, it is plainly visible in the error log and you just have to do a bit of fixing up..

But in this case, there was nothing. So I was going around in circles trying out various things, it was pretty stressful.

To cut a long story short, I finally managed to narrow it down to a third party library that we are using that converts bbcode in the database entries to HTML. Further sleuthing led me to nail down the issue and fixed the one single line that was causing the problem.

There are a few dimensions to this. I think (but have not confirmed) that the new version of PHP imposes stricter rules on a syntactical format that was permitted in the past. So it should have thrown out an error. But the library author for whatever reason used an obscure operator (the '@' symbol, go look it up) that disables error reporting for that particular line! It was as if he foresaw this line would become a problem, so he just turned off error reporting for just that line. So despite me turning on all the error reporting to trace the error, nothing was logged. Like I said, it was a deep deep rabbit hole!

I really need my sleep now after all this. I hope there are no other issues with this upgrade (which we needed to have anyway because the old PHP version is no longer supported). If there are, I will tackle them after a good night's sleep! :D

Re: Site broken

Posted: Sat Feb 08, 2020 5:28 am
by vevy
Andrew Lee wrote: Sat Feb 08, 2020 3:36 am...But the library author for whatever reason used an obscure operator (the '@' symbol, go look it up) that disables error reporting for that particular line! It was as if he foresaw this line would become a problem, so he just turned off error reporting for just that line.
LOL! Probably just to spite you! I hope you will have an uninterrupted sleep with non-php dreams!

Re: Site broken

Posted: Sat Feb 08, 2020 5:36 am
by SYSTEM
Andrew Lee wrote: Sat Feb 08, 2020 3:36 am So it should have thrown out an error. But the library author for whatever reason used an obscure operator (the '@' symbol, go look it up) that disables error reporting for that particular line!
Ouch. Ability to disable error reporting is dangerous for exactly this reason. :( Thanks for fixing the issue!

Re: Site broken

Posted: Sat Feb 08, 2020 7:44 am
by __philippe
Motion moved before the honourable TPFC's members general assembly :

To put out a contract on those F*** third party library's programmers and teach them about sloppy coding tricks ! :twisted:

(BTW, I had to clear TPFC's browser cookies in order to log in, anyone else ?)

Re: Site broken

Posted: Sat Feb 08, 2020 8:30 am
by dtoxic
__philippe wrote: Sat Feb 08, 2020 7:44 am (BTW, I had to clear TPFC's browser cookies in order to log in, anyone else ?)
yeap me also

Re: Site broken

Posted: Sat Feb 08, 2020 8:58 am
by vevy
See here: viewtopic.php?t=24767 by Andrew

Re: Site broken

Posted: Sat Feb 08, 2020 2:28 pm
by Midas
I was unable to login with either Seamonkey Portable v2.49.5 or my installed instance of Firefox v72.0.2.

Then I managed to get in with Firefox -- which hasn't liked the toolbar options of the posting form since before this.

Still out in the cold with Seamonkey, my TPFC browser of choice. Let me see if the cookie cleaning trick works...

EDIT: yep, that did it. Yhew!

Had a really long minute there, wondering if somehow I had got myself banned. :dizzy_face:

Re: Site broken

Posted: Sun Feb 09, 2020 8:12 am
by bitcoin
Midas wrote: Sat Feb 08, 2020 2:28 pm I was unable to login with either Seamonkey Portable v2.49.5 or my installed instance of Firefox v72.0.2.

Then I managed to get in with Firefox -- which hasn't liked the toolbar options of the posting form since before this.

Still out in the cold with Seamonkey, my TPFC browser of choice. Let me see if the cookie cleaning trick works...

EDIT: yep, that did it. Yhew!

Had a really long minute there, wondering if somehow I had got myself banned. :dizzy_face:
me too

i thought a hacker had got my username + password and posted something obnoxious and got me banned, lol

Re: Site broken

Posted: Sun Feb 09, 2020 9:52 am
by __philippe
This litany of login aggravation is no doubt an unfortunate side-effect of the initial problem Andrew had to fight long and hard needlessly,
because some third party sloppy coding habits suppressed the creation of an error log... :roll:

More reason to ferret out and terminate the bastards with extreme prejudice! :mrgreen:

Re: Site broken

Posted: Sun Feb 09, 2020 10:00 am
by SYSTEM
__philippe wrote: Sun Feb 09, 2020 9:52 am This litany of login aggravation is no doubt an unfortunate side-effect of the initial problem Andrew had to fight long and hard needlessly,
because some third party sloppy coding habits suppressed the creation of an error log... :roll:
Nah, judging from his thread it's far more likely a known side effect caused by creation of the CLI database.

Re: Site broken

Posted: Sun Feb 09, 2020 10:06 am
by __philippe
Could be...yet wondering what's Andrew's take about it ? :?

Re: Site broken

Posted: Sun Feb 09, 2020 1:20 pm
by Andrew Lee
Nah, judging from his thread it's far more likely a known side effect caused by creation of the CLI database.
Astute observation. I had to integrate the new subdomain with the forum which runs on the main domain, so I had to modify the phpBB cookie domain slightly in order to accommodate for this. Good news is, if we ever need to create another subdomain again, we don't have to change anything.
More reason to ferret out and terminate the bastards with extreme prejudice!
Come, come. Who amongst us who code have not made stupid decisions and came up with embarrassingly bad code? Programmers like to bitch about other programmers, but fact is, we are all bad coders! :D

Re: Site broken

Posted: Sun Feb 09, 2020 2:46 pm
by __philippe
Thanks for chiming in, Andrew.

One must admire your tolerance towards the rascals who kept you up till the wee hours chasing a white rabbit... :roll:
Too indulgent by half, I'd say... :wink:

Anyway, hats off for your dedication in keeping TPFC running smoothly !

Re: Site broken

Posted: Mon Feb 10, 2020 5:43 am
by Midas
Andrew Lee wrote: We are all bad coders! :D

I, for one, will raise my glass to chase that piece of the proverbial humble pie... :wine_glass: :man_shrugging: