Advertisement:

Author Topic: 512: loadMemberContext()  (Read 1434 times)

Offline -christian

  • Semi-Newbie
  • *
  • Posts: 50
  • Gender: Male
    • vitalogy.de
512: loadMemberContext()
« on: January 30, 2019, 03:17:40 AM »
Hi everybody,
I just got tons of error messages in my log. All of them complaining about

Code: [Select]
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.

Online Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 18,287
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
Re: 512: loadMemberContext()
« Reply #1 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?
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.
  Fooling around with an i7 990X @ 3,47Ghz / 12Gb / Win 10 x64 / 3840x2160


How you can help SMF

"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

Offline -christian

  • Semi-Newbie
  • *
  • Posts: 50
  • Gender: Male
    • vitalogy.de
Re: 512: loadMemberContext()
« Reply #2 on: March 01, 2019, 02:38:26 AM »
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.

Code: [Select]
// 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']);

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,267
  • Gender: Male
    • Kindred-999 on GitHub
Re: 512: loadMemberContext()
« Reply #3 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?

 
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline -christian

  • Semi-Newbie
  • *
  • Posts: 50
  • Gender: Male
    • vitalogy.de
Re: 512: loadMemberContext()
« Reply #4 on: March 06, 2019, 02:37:16 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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,028
    • StoryBB/StoryBB on GitHub
Re: 512: loadMemberContext()
« Reply #5 on: March 06, 2019, 02:48:53 AM »
If you look in the members table, does id 84 exist?
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline -christian

  • Semi-Newbie
  • *
  • Posts: 50
  • Gender: Male
    • vitalogy.de
Re: 512: loadMemberContext()
« Reply #6 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.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,028
    • StoryBB/StoryBB on GitHub
Re: 512: loadMemberContext()
« Reply #7 on: March 08, 2019, 05:35:36 AM »
Ok, what happens with the following query:

SELECT COUNT(*) FROM smf_messages WHERE id_member = 84;
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline -christian

  • Semi-Newbie
  • *
  • Posts: 50
  • Gender: Male
    • vitalogy.de
Re: 512: loadMemberContext()
« Reply #8 on: March 08, 2019, 05:45:31 AM »
Ok, what happens with the following query:

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

Code: [Select]
SELECT COUNT(*) FROM yabbse_messages WHERE id_member = 84
in our case, but the result is:

Code: [Select]
COUNT(*) 0

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,028
    • StoryBB/StoryBB on GitHub
Re: 512: loadMemberContext()
« Reply #9 on: March 08, 2019, 05:50:24 AM »
Then I don’t understand why you get the error you get.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline -christian

  • Semi-Newbie
  • *
  • Posts: 50
  • Gender: Male
    • vitalogy.de
Re: 512: loadMemberContext()
« Reply #10 on: March 25, 2019, 03:41:08 AM »
Then I don’t understand why you get the error you get.
Me either. But it is in our logs, thousand times  >:(

Offline doug_ips

  • Jr. Member
  • **
  • Posts: 297
Re: 512: loadMemberContext()
« Reply #11 on: March 25, 2019, 08:52:54 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?

Code: [Select]
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.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,028
    • StoryBB/StoryBB on GitHub
Re: 512: loadMemberContext()
« Reply #12 on: March 25, 2019, 06:37:22 PM »
But we established that the relevant member didn't have any entries in the messages table...
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline shawnb61

  • Support Specialist
  • Sophist Member
  • *
  • Posts: 1,217
    • sbulen on GitHub
Re: 512: loadMemberContext()
« Reply #13 on: March 25, 2019, 08:23:35 PM »
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

Offline doug_ips

  • Jr. Member
  • **
  • Posts: 297
Re: 512: loadMemberContext()
« Reply #14 on: March 26, 2019, 04:18:31 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.

Offline -christian

  • Semi-Newbie
  • *
  • Posts: 50
  • Gender: Male
    • vitalogy.de
Re: 512: loadMemberContext()
« Reply #15 on: May 07, 2019, 02:37:34 AM »
That was a nice idea, worth a try but:

Code: [Select]
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]