Forums | Mahara Community

Support /
Logout error - Call to a member function logout() on a non-object in /public_html/auth/lib.php on line 349


steve P's profile picture
Posts: 122

12 October 2009, 23:55

Not sure if this is a bug or a server configuration problem.

 I found the same error in Mahara 1.1.2 and 1.1.6, Apache 2.2.11, MySQL 5.1.30, PHP 5.2.4

 The error only seems to regularly occur when I:

1. Login as administrator

2. Choose a student and then login as that user (while still logged in as admin)

3. Return back to the administrator role

4. Logout.

 

Any clues?

anonymous profile picture
Account deleted
Posts: 1643

13 October 2009, 18:13

Hi - that's a strange problem, I tried duplicating it without success so far.

If you can duplicate it repeatedly, I think this means you have some corrupt data in your database, relating to the authinstances used by your users.

Could you open auth/lib.php, and at just before line 349, add the following lines:

log_debug($authobj);

log_debug($authinstance);

log_debug($SESSION);

log_debug($USER);

So they should all appear just before $authobj->logout().

Once you have done that, make the bug happen again, then go into your apache error log and get the lines out that appeared as a result of those log_debug calls, and paste them here (or preferrably to a paste service and link to them here Wink). They will give more clues as to what might be wrong.

steve P's profile picture
Posts: 122

15 October 2009, 18:46

Thanks Nigel.

I tried your suggestion but unfortunately the errors don't appear  in the logs I have access to (I should add that this problem is occurring on a Mahara instance on shared hosting, so I understand if you don't want to pursue this issue). Is there a way I can get the errors to output to a log file other than the Apache one? I tried getting the errors out to screen but that doesn't work.Frown

I also tried a fresh install with 1.2 beta, and got the same problem...

 

anonymous profile picture
Account deleted
Posts: 1643

15 October 2009, 19:44

If you try with the beta, you can get them to go to a file of your choosing instead of the apache error log. In your config.php, add this line:

$cfg->log_dbg_targets = LOG_TARGET_ERRORLOG | LOG_TARGET_FILE; 

Then, with those log_debug() lines in place, trigger the error again. Then, have a look in your dataroot directory - there should be an error.log file that you can open and view, which will have the lines in it.

If you could get that file and post a link to it here, that would be great Smile. And you'll be the first person to have used the new LOG_TARGET_FILE to assist debugging on shared hosting too Wink 

steve P's profile picture
Posts: 122

15 October 2009, 21:25

Hi Nigel,

I couldn't use that method in 1.2 beta3 (because LOG_TARGET_FILE is not defined) so I installed 1.2 beta4, and what would you know, I can't reproduce the error there! So something must have changed between betas 3 and 4 that has fixed the issue?

P.S. The new method of error logging works great, btw!Smile

anonymous profile picture
Account deleted
Posts: 1643

15 October 2009, 22:09

Hm, can't think of anything that changed.. but oh well, if it's working, don't sweat too hard about it! Wink

Good to hear the logging method works.. should save a lot of hassle for shared host users in 1.2 Smile 

steve P's profile picture
Posts: 122

15 October 2009, 23:44

Looks like I spoke too soon.Sealed

 This error log came from the 1.2 beta 4 installation:

http://pastie.org/657145

steve P's profile picture
Posts: 122
anonymous profile picture
Account deleted
Posts: 1643

20 October 2009, 22:58

Hi, sorry for the slow reply, have been very busy fixing bugs Wink

That's kind of strange. Like the auth instance in your session is an entire object rather than just the ID of it. I wonder why that is happening.. are you loggin in via MNET?

Could you try this patch for me, and see if it works?: http://paste.dollyfish.net.nz/6acc94

And if that doesn't work, what happens if you log out, clear your cookies, then try again? 

steve P's profile picture
Posts: 122

21 October 2009, 0:05

Well, I've tried and tried, but with that patch in place I can't reproduce the error.

Thanks a million!Smile

12 results