HTTP error 500 (General)

by Tommy Nilsson ⌂, Saturday, August 12, 2023, 12:02 (259 days ago)

After I changed PHP version from 8.0 to 8.1, the forum on my website throws a “HTTP error 500” for foreign IP-numbers. A handful of users in Denmark also reports this error. The rest of the website works normal for all users. I can´t reproduce the error as I don´t get it:
https://www.jernbanen.dk/forum2/

Exact same problem on my swedish website, where the forum is blocked for a handful of users after switching to PHP 8.1:
https://www.svenska-lok.se/forum/

I have asked my webhotel (One.com) but with no reply yet.
Why do a handful of users get “HTTP error 500” just because I change PHP version from 8.0 to 8.1?

/Tommy

Avatar

HTTP error 500

by Micha ⌂, Saturday, August 12, 2023, 12:14 (259 days ago) @ Tommy Nilsson

Hej Tommy,

I can confirm this issue for both websites. Are you able to provide more information i.e. error logs? Maybe a required PHP module is missing.

/Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Avatar

HTTP error 500

by Auge ⌂, Sunday, August 13, 2023, 19:57 (257 days ago) @ Tommy Nilsson

Hello

After I changed PHP version from 8.0 to 8.1, the forum on my website throws a “HTTP error 500” for foreign IP-numbers. A handful of users in Denmark also reports this error. The rest of the website works normal for all users. I can´t reproduce the error as I don´t get it:
https://www.jernbanen.dk/forum2/

Exact same problem on my swedish website, where the forum is blocked for a handful of users after switching to PHP 8.1:
https://www.svenska-lok.se/forum/

There was a few reports about cases of HTTP-status 500 in the nearer past. One is yours from march 2023, the other report (in German language) is from february 2023. Yours was about unregistered visitors not being able to send e-mails over the forums own contact form and the one was about users (the author means logged in users) not being able to creating new entries but admins are.

After re-reading the old threads I would like to summarise as follows.

- Both reports are about MLF version 20220803.1.
- The PHP version was 8.0 in your report and 8.1 in the other report, but the problem seems to be only indirectly related to the PHP-version.
- Both reports was about features, which involves spam checks.
- You deactivated the setting akismet_mail_check and your problem disappeared.
- BlindFish1003 deactivated the spam check of new entries and that solved his issue.
- Micha said, that he has no such problems with PHP 8.0, 8.1 and 8.2 but he also stated, that he does not use Akismet and Stop Forum Spam in his forum.

In the other reports the issue was obviously the Akismet spam check. When it was deactivated, the issues didn't occure.

My assumption is now, that your acute issue is kind of related to the old reports even the problem is not nearly the same. I have a question about your report. What do you mean with "foreign IP-numbers"? IPs from foreign countries? Is it "foreign" in the meaning of not from the country, where the server resides or what the top level domain (in your cases .dk and .se) is for? Or in another meaning?

As far as I remember the forum script does not actively evaluate the IP of the visitor with the exception of the spam checks a forum operator can activate.

I have asked my webhotel (One.com) but with no reply yet.

I hope, that clarifies things a bit more.

I hope, we can solve these annoying issues.

So far from me and tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

HTTP error 500

by Tommy Nilsson ⌂, Wednesday, August 16, 2023, 13:29 (255 days ago) @ Auge

A short heads-up:
Still nothing from One.com.
Users are reporting problems when using IPv6 and no problems when using lower versions.

Avatar

HTTP error 500

by Auge ⌂, Thursday, August 17, 2023, 06:40 (254 days ago) @ Tommy Nilsson

Hello Tommy

Can you please answer my question about the meaning of "foreign" IPs? Is the Akismet service acivated for any purpose in your instances?

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

HTTP error 500

by Tommy Nilsson ⌂, Thursday, August 17, 2023, 07:57 (254 days ago) @ Auge

On my danish domain Jernbanen.dk, at least 2 german users gets HTTP error 500. I´ve asked them, if they use IPv6 but no reply yet.

A dane has tried using IPv6 and gets HTTP error 500. When connecting without IPv6, the forum works as expected.

You can check your IP-version here: https://test-ipv6.com/

I connect through IPv4 and everything works on my pc.

All Akismet is turned off in all forums.

Avatar

HTTP error 500

by Auge ⌂, Thursday, August 17, 2023, 09:15 (254 days ago) @ Tommy Nilsson

Hello

On my danish domain Jernbanen.dk, at least 2 german users gets HTTP error 500. I´ve asked them, if they use IPv6 but no reply yet.

A dane has tried using IPv6 and gets HTTP error 500. When connecting without IPv6, the forum works as expected.

You can check your IP-version here: https://test-ipv6.com/

I connect through IPv4 and everything works on my pc.

All Akismet is turned off in all forums.

Ahh, slowly a suspicion is growing. At the time, the code base of MLF2 was developed, IP-v6 was no thing. Same goes for the Akismet service class, the forum software uses. The forum script saves the IP of the authors of entries. The forum script saves the IP of visitors to prevent high fequency spamming and double entries as well as to calculate the number of current visits.

I checked the CREATE-TABLE-statements in the file install.sql and found four statements where a column for IPs exist. These are the statements for the tables mlf2_entries, mlf2_userdata, mlf2_useronline and mlf2_logincontrol.

While the length of the columns in the tables mlf2_entries, mlf2_userdata and mlf2_logincontrol is sufficient (first two named tables 128 and the last table 255 chars (128 chars is enough)), the column ip in the table mlf2_useronline provides only a string length of 15 chars.

 
CREATE TABLE mlf2_useronline (
 ip CHAR(15) NOT NULL DEFAULT '', /*<=== this has to be changed */
 TIME INT(14) NOT NULL DEFAULT '0',
 user_id INT(11) DEFAULT '0'
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci;

I expect, that you have enough experience with MySQL/MariaDB to alter the column definition for mlf2_useronline.ip yourself from the length of 15 to 128 characters. Please report, if this changes anything.

Checking the Akismet-class for possible issues is my task.

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

HTTP error 500

by Tommy Nilsson ⌂, Thursday, August 17, 2023, 14:37 (254 days ago) @ Auge

I expect, that you have enough experience with MySQL/MariaDB to alter the column definition for mlf2_useronline.ip yourself from the length of 15 to 128 characters. Please report, if this changes anything.

YES!
Here is a Google translated version of a text, I have written for the users of my forum:

—--------------------------------

The error has been found!
Originally, an IP number was a maximum of 15 characters, e.g. 12.128.230.100.
In the latest version (IPv6), the number is significantly longer, e.g. 2a03:8108:1200:4f78:37bd:163:b3f6:41df.
Far down in the forum's database is a table called "useronline", which contains the IP number and time of all users who are online in the forum.
The length of this field was set to 15 characters and when I changed it to 128 - bingo! Then the forum worked again for the users who previously got the error "HTTP error 500".
This error has always existed so why it only activates when I switch from PHP 8.0 to PHP 8.1 is unknown. Perhaps PHP 8.0 simply ignored the error.
It was also the same error that blocked a number of users in the Signalposten.dk forum, and it has now also been corrected.
Anyways - I hope everyone is back, and I´m sorry for the downtime. Thanks to everyone who contributed with error messages, solution suggestions, etc.

—--------------------------------

Thx for finding this pesky bugger. 🙂

/Tommy

Avatar

HTTP error 500

by Auge ⌂, Thursday, August 17, 2023, 18:45 (253 days ago) @ Tommy Nilsson

I expect, that you have enough experience with MySQL/MariaDB to alter the column definition for mlf2_useronline.ip yourself from the length of 15 to 128 characters. Please report, if this changes anything.

YES!

The error has been found!

Sometimes it pays to stare at goats … errr … at code. 😆👍

So for everyone. Please run the following SQL query once.

ALTER TABLE mlf2_useronline
CHANGE `ip` `ip` VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

Avatar

HTTP error 500

by Micha ⌂, Saturday, August 19, 2023, 07:43 (252 days ago) @ Auge

Hej,

So for everyone. Please run the following SQL query once.

ALTER TABLE mlf2_useronline
CHANGE `ip` `ip` VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''

Good job! :clap:

/Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Avatar

HTTP error 500

by Auge ⌂, Thursday, August 17, 2023, 19:04 (253 days ago) @ Auge

Hello

Checking the Akismet-class for possible issues is my task.

I took a look into the code of the Akismet class. The request includes the users IP but there is nothing, that would prevent the submission of a IPv6. So there seems to be nothing to do about.

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

RSS Feed of thread