News:

Wondering if this will always be free?  See why free is better.

Main Menu

Database Error for Guests: Site not showing

Started by John Connors, May 11, 2021, 06:42:42 PM

Previous topic - Next topic

John Connors

Hi there,

I am running an instance of SMF 2.15, using the Flexive template as my forum theme.
Over the last 24 hours, myself and other forum members are having issues accessing the forum. We are getting an error message:

Database Error
Please try again. If you come back to this error screen, report the error to an administrator.


I cannot login normally, but when I utilise a VPN, I am able to access the site and thus the error log. The most consistent error I see is the code below:

8: Undefined index: special_title
File: /home/celebrit/public_html/Sources/Load.php
Line: 1158


I am not sure what special_title is but I have included the entire error code below.

Thanks for any help you can give.

1138:
1139: // We can't load guests or members not loaded by loadMemberData()!
1140: if ($user == 0)
1141: return false;
1142: if (!isset($user_profile[$user]))
1143: {
1144: trigger_error('loadMemberContext(): member id ' . $user . ' not previously loaded by loadMemberData()', E_USER_WARNING);
1145: return false;
1146: }
1147:
1148: // Well, it's loaded now anyhow.
1149: $dataLoaded[$user] = true;
1150: $profile = $user_profile[$user];
1151:
1152: // Censor everything.
1153: censorText($profile['signature']);
1154: censorText($profile['personal_text']);
1155: censorText($profile['location']);
1156:
1157: // Set things up to be used before hand.
==>1158: $profile['special_title'] = str_replace(array("\n", "\r"), array('<br />', ''), $profile['special_title']);
1159: $profile['special_title'] = parse_bbc($profile['special_title']);
1160: $gendertxt = $profile['gender'] == 2 ? $txt['female'] : ($profile['gender'] == 1 ? $txt['male'] : '');
1161: $profile['signature'] = str_replace(array("\n", "\r"), array('<br />', ''), $profile['signature']);
1162: $profile['signature'] = parse_bbc($profile['signature'], true, 'sig' . $profile['id_member']);
1163:
1164: $profile['is_online'] = (!empty($profile['show_online']) || allowedTo('moderate_forum')) && $profile['is_online'] > 0;
1165: $profile['stars'] = empty($profile['stars']) ? array('', '') : explode('#', $profile['stars']);
1166: // Setup the buddy status here (One whole in_array call saved :P)
1167: $profile['buddy'] = in_array($profile['id_member'], $user_info['buddies']);
1168: $buddy_list = !empty($profile['buddy_list']) ? explode(',', $profile['buddy_list']) : array();
1169:
1170: // If we're always html resizing, assume it's too large.
1171: if ($modSettings['avatar_action_too_large'] == 'option_html_resize' || $modSettings['avatar_action_too_large'] == 'option_js_resize')
1172: {
1173: $avatar_width = !empty($modSettings['avatar_max_width_external']) ? ' width="' . $modSettings['avatar_max_width_external'] . '"' : '';
1174: $avatar_height = !empty($modSettings['avatar_max_height_external']) ? ' height="' . $modSettings['avatar_max_height_external'] . '"' : '';
1175: }
1176: else
1177: {
1178: $avatar_width = '';

shadav

I am not sure about that error, but do you use the httpBL mod?
If so I had issues with it since it doesn't support ipv6, anyone that uses ipv6 could not access the forum
had to disable it and then uninstall it.

anyone using ipv6 would see the generic warning
Database Error
Please try again. If you come back to this error screen, report the error to an administrator.

anyone using ipv4 was able to access the forum

John Connors

#2
No, I am not using that one. 

I am using the following Mods.

I should also add, I am using PHP 5.6. When I have changed this to 7.0 or 7.1, the problem persists.


Kindred

1- upgrade SMF
2- upgrade php

3- if it just happens occasionally, talk to your host about why it would be dropping the connection
Сл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."

Aleksi "Lex" Kilpinen

Topic moved to 2.0.x support, based on the partial version number given by the OP this concerns 2.0.15.
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

John Connors

Quote from: Kindred on May 11, 2021, 09:46:00 PM
1- upgrade SMF
2- upgrade php

3- if it just happens occasionally, talk to your host about why it would be dropping the connection

Hi there and thanks for the response.

I've upgraded SMF to 2.0.18 and PHP to 7.4.
No luck when I try and get to the site. It still shows the same message.

Host has suggested coming here for a solution as they do not debug code as part of their Standard T&S.

If it is a mod issue, I may just start uninstalling them to see which one is causing the problem.

If anyone has any other suggestions, please let me know.

Thanks

Kindred

undefined index won't cause the database to fail to connect....

EITHER
The site failure is a bad configuration from you....   (but your ability to connect when you have a VPN suggests otherwise)
or
The site failure is a bad configuration from the host.... (and your ability to ONLY connect when you use a VPN suggests that this is the issue)


I understand that the host "won't debug scripts"   -- but a GOOD host would work with you to figure out where the issue is occurring.  Based on what you have said so far, we have no idea what is happening, other than the inability of SMF to connect to the database on your server when you attempt to access without a VPN.   Since SMF has no details which require a VPN, that is definitely a host issue.
Сл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."

John Connors

Thanks Kindred.

Really appreciate your help with that explanation.

I will go back to my host provider with it.

John Connors

Update from my host provider:

The errors that are accumulating are not related to the server, and don't appear to be related to the PHP environment. They appear to be related to packages that have been uninstalled in the past.

I've found these:

Package 1: special_title, there is a remnant in the package backups called backup_secondary_custom_title.tar.gz, which contains code referencing special_title in sources/load.php. This is not present in the core /sources/load.php from the official release, so this is a code remnant that was not removed when the package was removed. You can confirm this in the official files here.

Package 2: mods_cat_eucookie, I've noticed you have a package called EU Cookie, but it is not enabled. It is only installed. Perhaps this was installed, and uninstalled.

Cleaning up the remnant code will stop those errors. The only way to do this is to manually remove the code (if uninstalling didn't remove them), or to go through the steps earlier.

Any ideas the best way to do this?

Thanks.

Aleksi "Lex" Kilpinen

Anything in the package backups is simply a backup, and has no actual effect on the install.

That being said, you can check the manual install instructions for the mod Secondary Custom Title and see all the changes the install has made,
and if necessary should be able to follow them in reverse to find any leftovers there may be from a possibly failed uninstall.

But any DB errors that have only come up in the last day or so, would basically have to be caused by something that changed within that time as well - so if these mods weren't recently uninstalled, I'm doubtful following that advice would do much good.
What I would look at, is any mods that handle IP addresses - this could be an IPv6 issue.
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

John Connors

I think it may well be an IPV6 issue as when I have gone and edited the load.php file and taken out references to special_title and/or replaced the load.php file with a clean version, I am getting an error which states:

Database Error: Incorrect string value: '''' for function inet_aton
Sources/Subs.php

Any ideas the best way to correct this? I know there is a Mod available https://custom.simplemachines.org/mods/index.php?mod=3051 and you can emulate for 2.014. even on 2.018, but is there another way to do thi?

Thanks for all your help so far.

Aleksi "Lex" Kilpinen

That mod should install on a 2.0.18 without any tricks, as long as there aren't any code conflicts.
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

John Connors

Tests were successful, however when trying to install the file , I ended up with this error message

Too few arguments to function smf_db_change_column(), 2 passed in /home/celebrit/public_html/Packages/temp/jdarwood007-smfmod_ipv6-d375c37/database_install.php on line 49 and at least 3 expected

Aleksi "Lex" Kilpinen

Oh, that sucks - Just noticed someone else has seen that same issue before as well.
Maybe check out the support topic, and post in it if you don't find a solution there already https://www.simplemachines.org/community/index.php?topic=440357.
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

John Connors

Thanks, but that is not working.

If anyone is interested in helping me out with this, cleaning up coding that my web host has mentioned, DM me and we can discuss a fee for it.


KittyGalore

Quote from: John Connors on May 13, 2021, 04:24:58 AM
Thanks, but that is not working.

If anyone is interested in helping me out with this, cleaning up coding that my web host has mentioned, DM me and we can discuss a fee for it.
Have you tried creating a test forum and using the database with fresh files to see what happens and you can play around with it without effecting the main forum. Just create a new folder in the main forum and call it test forum or something and create a second database and test it out.
SMF Curve 2.0x

John Connors

I haven't tried that, Kitty.

Do you mean create a test folder in the public_html folder on the site or CPanel?

Or something else?

Thanks

KittyGalore

Quote from: John Connors on May 13, 2021, 07:37:55 PM
I haven't tried that, Kitty.

Do you mean create a test folder in the public_html folder on the site or CPanel?

Or something else?

Thanks
Yes sorry i should have said the main public_html folder
SMF Curve 2.0x

John Connors

Thanks Kitty.

So just an update on this issue. I did a clean re-install of SMF 2.015 and that did not work.
I was receiving an error:

Database Error: Incorrect string value: '''' for function inet_aton
Sources/Subs.php

Went back to my host provider explaining what I had done, and they tweaked SQL settings, and voila.
The forum is back working.  :)

Thanks all for your help and advice here.

It was greatly appreciated.

Advertisement: