News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

512: loadMemberContext()

Started by -christian, January 30, 2019, 03:17:40 AM

Previous topic - Next topic

-christian

Hi everybody,
I just got tons of error messages in my log. All of them complaining about

https://www.pearl-jam.de/index.php?&threadid=2466%3bstart=45
512: loadMemberContext(): member id 84 not previously loaded by loadMemberData()
Datei: /[path]/Sources/Load.php
Zeile: 1138

Installed mods:

  • Stop Spammer
  • Global Headers Footers
Any help appreciated.

Aleksi "Lex" Kilpinen

Did this just start suddenly, or did you do something just before?
Could you post the mentioned line, plus a few lines before and after, from your Load.php?
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

-christian

Quote from: Aleksi "Lex" Kilpinen on February 08, 2019, 04:12:03 PM
Did this just start suddenly, or did you do something just before?
Could you post the mentioned line, plus a few lines before and after, from your Load.php?
We performed an update coming from 1.x SMF. After that, the errors started popping up in our logs.

// Loads the user's basic values... meant for template/theme usage.
function loadMemberContext($user, $display_custom_fields = false)
{
global $memberContext, $user_profile, $txt, $scripturl, $user_info;
global $context, $modSettings, $board_info, $settings;
global $smcFunc;
static $dataLoaded = array();

// If this person's data is already loaded, skip it.
if (isset($dataLoaded[$user]))
return true;

// We can't load guests or members not loaded by loadMemberData()!
if ($user == 0)
return false;
if (!isset($user_profile[$user]))
{
trigger_error('loadMemberContext(): member id ' . $user . ' not previously loaded by loadMemberData()', E_USER_WARNING);
return false;
}

// Well, it's loaded now anyhow.
$dataLoaded[$user] = true;
$profile = $user_profile[$user];

// Censor everything.
censorText($profile['signature']);
censorText($profile['personal_text']);
censorText($profile['location']);


Kindred

1- so, what version did you run before?
2- You did the whole upgrade, per this? https://wiki.simplemachines.org/smf/Upgrading
3- you removed your 1.1.x theme and set a 2.0.x theme?

 
Сл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."

-christian

Quote from: Kindred on March 01, 2019, 08:20:59 AM
1- so, what version did you run before?
2- You did the whole upgrade, per this? https://wiki.simplemachines.org/smf/Upgrading
3- you removed your 1.1.x theme and set a 2.0.x theme?
1- We came from the last 1.1.x
2- yes
3- yes

Arantor

If you look in the members table, does id 84 exist?

-christian

Nope, it does not exists in the database. The db maintenance and the repair routines of SMF are running and completing without any error.

Arantor

Ok, what happens with the following query:

SELECT COUNT(*) FROM smf_messages WHERE id_member = 84;

-christian

Quote from: Arantor on March 08, 2019, 05:35:36 AM
Ok, what happens with the following query:

SELECT COUNT(*) FROM smf_messages WHERE id_member = 84;
Must be

SELECT COUNT(*) FROM yabbse_messages WHERE id_member = 84

in our case, but the result is:

COUNT(*) 0

Arantor

Then I don't understand why you get the error you get.

-christian

Quote from: Arantor on March 08, 2019, 05:50:24 AM
Then I don't understand why you get the error you get.
Me either. But it is in our logs, thousand times  >:(

Doug Heffernan

Quote from: -christian on March 08, 2019, 05:28:38 AM
Nope, it does not exists in the database. The db maintenance and the repair routines of SMF are running and completing without any error.

Your error is occuring because of the members being deleted, but the posts remaining. Can you run this query to update the message tables so the posts can have a corresponding member ID for deleted users as well?

UPDATE smf_messages SET id_member = 0 WHERE NOT EXISTS
(SELECT id_member FROM smf_members WHERE smf_messages.id_member = smf_members.id_member )



P.s. Make a backup of the database first before you run the query.

Arantor

But we established that the relevant member didn't have any entries in the messages table...

shawnb61

Random thought...  Is it possible the reference to user 84 is coming from a stored session?  Maybe accessed via a bot?
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Doug Heffernan

Quote from: Arantor on March 25, 2019, 06:37:22 PM
But we established that the relevant member didn't have any entries in the messages table...

That is correct, however I think that said member has been deleted at some point but his/her posts remained in the database and for some reason are not correspoding. Running the query I posted will update the posts table and make sure that posts will have a corresponding member ID for deleted users. It is worth a shot imho.

-christian

That was a nice idea, worth a try but:

UPDATE yabbse_messages SET id_member = 0 WHERE NOT EXISTS (SELECT id_member FROM yabbse_members WHERE yabbse_messages.id_member = yabbse_members.id_member )
[b]Gefundene Zeilen: 0[/b]

Advertisement: