News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

access array offset value of type null (500 error message)

Started by sbartelski, June 02, 2023, 02:28:22 PM

Previous topic - Next topic

sbartelski

Today I got messages that people cannot access the forum. When I checked we are getting a 500 message. I looked in the server logs and see that the "access array offset value of type null" message and two others are occurring.

My version of SMF 2.1.3 (updated a month ago)
PHP is 7.4.33

Not sure about which extensions as I cannot access the forum. I know I have one Spammer tool, and I think a menu tool.

* Function to save errors in database in a safe way
 *
 * @param array with keys in this order id_member, log_time, ip, url, message, session, error_type, file, line
 * @return void
 */
function smf_db_error_insert($error_array)
{
global $db_prefix, $db_connection;
static $mysql_error_data_prep;

// without database we can't do anything
if (empty($db_connection))
return;

if (empty($mysql_error_data_prep))
$mysql_error_data_prep = mysqli_prepare($db_connection,
'INSERT INTO ' . $db_prefix . 'log_errors
(id_member, log_time, ip, url, message, session, error_type, file, line, backtrace)
VALUES( ?, ?, unhex(?), ?, ?, ?, ?, ?, ?, ?)'
);

if (filter_var($error_array[2], FILTER_VALIDATE_IP) !== false)
$error_array[2] = bin2hex(inet_pton($error_array[2]));
else
$error_array[2] = null;
mysqli_stmt_bind_param($mysql_error_data_prep, 'iissssssis',
$error_array[0], $error_array[1], $error_array[2], $error_array[3], $error_array[4], $error_array[5], $error_array[6],
**Line 1027** $error_array[7], $error_array[8], $error_array[9]);
**Line 1028** mysqli_stmt_execute($mysql_error_data_prep);
}
The image below shows one set of messages, there are more and, as far as I can see, they all reference the same topic ID. If this is the problem, is there clean way, using my cPanel, to delete that topic, without blowing up the whole database?

Thanks in advance to any one who can help

You cannot view this attachment.
Stefan Bartelski
Webmaster for the Cadillac LaSalle Discussion forums

Doug Heffernan

Quote from: sbartelski on June 02, 2023, 02:28:22 PMToday I got messages that people cannot access the forum. When I checked we are getting a 500 message. I looked in the server logs and see that the "access array offset value of type null" message and two others are occurring.

What was the latest change/modification made to the forum prior to this happening?

sbartelski

Quote from: Doug Heffernan on June 02, 2023, 04:01:56 PM
Quote from: sbartelski on June 02, 2023, 02:28:22 PMToday I got messages that people cannot access the forum. When I checked we are getting a 500 message. I looked in the server logs and see that the "access array offset value of type null" message and two others are occurring.

What was the latest change/modification made to the forum prior to this happening?

Update from 2.1.2 to 2.1.3 one month ago. It has been running smoothly until today.

(BTW, thanks for replying so quickly, much appreciated)

Stefan
Stefan Bartelski
Webmaster for the Cadillac LaSalle Discussion forums

Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

sbartelski

Thnank you for the heads up, very interesting, I wonder how that happened.

DStefan
Stefan Bartelski
Webmaster for the Cadillac LaSalle Discussion forums

sbartelski

Unfortunately, it seems that this problem is back. The error messages seem to be from yesterday, but accessing the site now still gives the '500' error message and no new error messages in the log. Can anyone help me with suggestions for troubleshooting, please?
I have tried the cPanel/Database Check & Repair but that did not help. Below is the latest log file which seems to be very similar to the previous error messages. See OP for other images and info.
Stefan Bartelski
Webmaster for the Cadillac LaSalle Discussion forums

Aleksi "Lex" Kilpinen

A 500 error is an internal server error. A 500 error loosely translates to the webserver saying, "WTF?" and dying.
For this exact reason, each 500 error should be logged in the server error log, so you can see what caused it.
If nothing gets logged, reach out to your host.
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

sbartelski

My hosting provider is asking wheter we have a concat form on the site. Does SMF use this facility?
Stefan Bartelski
Webmaster for the Cadillac LaSalle Discussion forums

Aleksi "Lex" Kilpinen

I am quite honestly unsure what they mean, if that isn't simply meant to ask about a contact form - which would imply that they are simply giving you a run around instead of answering the actual issue at hand.

The actual issue at hand is not what is on the website, the actual issue is the HTTP 500 you are unable to diagnose because you have no logs at your disposal.
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

sbartelski

Quote from: Aleksi "Lex" Kilpinen on June 12, 2023, 03:02:26 PMI am quite honestly unsure what they mean, if that isn't simply meant to ask about a contact form - which would imply that they are simply giving you a run around instead of answering the actual issue at hand.

The actual issue at hand is not what is on the website, the actual issue is the HTTP 500 you are unable to diagnose because you have no logs at your disposal.

So yes, I will be taking this further with their support staff, even though the the forums 'magically' started working again.  Thanks for your assistance, it is much appreciated.
Stefan Bartelski
Webmaster for the Cadillac LaSalle Discussion forums

sbartelski

Quote from: Sir Osis of Liver on June 12, 2023, 08:36:28 PMOnce again, loading and working normally.


Is it Groundhog Day?  ;)

Thanks anyway for letting me know, and see my reply to lex above. I am going to try to get to the bottom of this
Stefan Bartelski
Webmaster for the Cadillac LaSalle Discussion forums

sbartelski

Quote from: Aleksi on June 12, 2023, 03:02:26 PMI am quite honestly unsure what they mean, if that isn't simply meant to ask about a contact form - which would imply that they are simply giving you a run around instead of answering the actual issue at hand.

The actual issue at hand is not what is on the website, the actual issue is the HTTP 500 you are unable to diagnose because you have no logs at your disposal.

Here we go, both sides pointing their finger at the other side. After requesting more detailed log information, this is what they replied and sent me
Quote from: HostGator_supportFrom your last reply, I understand that you are receiving an intermittent 500 error while
accessing the website forums.cadillaclasalleclub.org on your end.
I'm sorry for the inconvenience that you have experienced with this.

I have carefully reviewed the website error_logs and found an issue with the
database configuration file 'Subs-Db-mysql.php', which was affecting the website functionality.
I am afraid we are unable to do much from our end since script related issues fall beyond
scope of our support. The best possible option is to contact developer to
investigate further on the issue by providing this error log:
https://privatebin.support-tools.com/?ef82d1cd16d787f0#QdQy3wFr2J/ZQ8f3mCsaxY0vfjNIG54nW0mJshyaFAI=

Does this give enough information for someone to look at? What concerns me the most is this starts happening for no obvious reason and then stops for no obvious reason.
Stefan Bartelski
Webmaster for the Cadillac LaSalle Discussion forums

Aleksi "Lex" Kilpinen

That's real funny. That log may indeed point to an issue, but it's not logging the HTTP 500.

The fatal error in that log, PHP Fatal error:  Uncaught Error: Call to undefined function set_magic_quotes_runtime() would make me think you have some code on the site that isn't up to date, if you don't need the /status.php you should probably remove it.

All the rest are warnings and notices, and they do not break things or stop the website from loading. Also none of that log accounts for your most recent HTTP 500, not even the same day.

You might want to ask your host directly if you are able to access your webserver's access and error logs some way.
There should be a log somewhere, EVERY webserver causes errors, and those should be logged so they can be minimized.
For example, trying to load a file that doesn't exist causes a 404 error, and normally this is logged along with the information on what file was requested so that if indeed something is missing you can add it (like a favicon or robots.txt).

And for the record, I'm not pointing fingers - I'm trying to figure out if there is something actually wrong with your forum, but it's difficult without logs.
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Doug Heffernan

Quote from: sbartelski on June 13, 2023, 01:46:17 PMI have carefully reviewed the website error_logs and found an issue with the
database configuration file 'Subs-Db-mysql.php', which was affecting the website functionality.

Can you please ask them to elaborate a bit further on this? To give an example of what they mean?

Quote from: sbartelski on June 13, 2023, 01:46:17 PMWhat concerns me the most is this starts happening for no obvious reason and then stops for no obvious reason.

This kind of behaviour points to the host/server being the cause rather than the script, smf in this case.

Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

sbartelski

Quote from: Aleksi "Lex" Kilpinen on June 13, 2023, 01:53:07 PMThat's real funny. That log may indeed point to an issue, but it's not logging the HTTP 500.

The fatal error in that log, PHP Fatal error:  Uncaught Error: Call to undefined function set_magic_quotes_runtime() would make me think you have some code on the site that isn't up to date, if you don't need the /status.php you should probably remove it.

All the rest are warnings and notices, and they do not break things or stop the website from loading. Also none of that log accounts for your most recent HTTP 500, not even the same day.

You might want to ask your host directly if you are able to access your webserver's access and error logs some way.
There should be a log somewhere, EVERY webserver causes errors, and those should be logged so they can be minimized.
For example, trying to load a file that doesn't exist causes a 404 error, and normally this is logged along with the information on what file was requested so that if indeed something is missing you can add it (like a favicon or robots.txt).

And for the record, I'm not pointing fingers - I'm trying to figure out if there is something actually wrong with your forum, but it's difficult without logs.
Thanks again for this quick reply. And my 'finger pointing' comment was not really a complaint to either side, just some frustration that I was getting bounced between the two sides. I do feel that I am getting better replies here; you guys, and gals, are doing an awesome job.

I will take some of your reply and see what the provider has to say about your suggestions. The lack of a full log and the missing 500 notification was something that I had noticed, even though I am  newb in this particular space.

Finally, I don't think that the /status.php is important, I did not add it but it could have come from one of the few mods that I loaded. Can I just delete the file without messing up the base system? I am not so worried about a mod not working correctly. And initially, I will not delete the file, just rename it.
Stefan Bartelski
Webmaster for the Cadillac LaSalle Discussion forums

sbartelski

Stefan Bartelski
Webmaster for the Cadillac LaSalle Discussion forums

sbartelski

Quote from: Doug Heffernan on June 13, 2023, 02:09:35 PM
Quote from: sbartelski on June 13, 2023, 01:46:17 PMI have carefully reviewed the website error_logs and found an issue with the
database configuration file 'Subs-Db-mysql.php', which was affecting the website functionality.

Can you please ask them to elaborate a bit further on this? To give an example of what they mean?

Quote from: sbartelski on June 13, 2023, 01:46:17 PMWhat concerns me the most is this starts happening for no obvious reason and then stops for no obvious reason.


This kind of behaviour points to the host/server being the cause rather than the script, smf in this case.

Regarding the start/stop, agreed, thanks for supporting my own suspicions. I am going to bring up this and the Subs-Db-mysql.php comment with HG
Stefan Bartelski
Webmaster for the Cadillac LaSalle Discussion forums

Aleksi "Lex" Kilpinen

Status.php isn't a part of the usual SMF codebase, it might be an old SMF tool though, and if it is then you shouldn't break anything by removing it - but I would make an offline copy as a backup just in case if I were you.
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Advertisement: