Forums | Mahara Community

Support /
Login Problem


07 July 2016, 3:16

Hello Mahara

I did a upgrade from 15.10 to 16.04.1.

Since then the Site loops after Login. After setting 

$cfg->ajaxifyblocks = false;

it is ok. But

I have to Login for each action. I'm getting this error the first time I try:
(The Site is still closed in the moment)

[WAR] bf (auth/session.php:312) Undefined index: messages
Call stack (most recent first):
  • log_message("Undefined index: messages", 8, true, true, "/home/imthurn/www/mahara/auth/session.php", 312) at/home/imthurn/www/mahara/lib/errors.php:489
  • error(8, "Undefined index: messages", "/home/imthurn/www/mahara/auth/session.php", 312, array(size 3)) at /home/imthurn/www/mahara/auth/session.php:312
  • Session->render_messages("messages") at /home/imthurn/www/mahara/auth/session.php:472
  • insert_messages() at /home/imthurn/maharadata/dwoo/compile/default/home/imthurn/www/mahara/theme/default/templates/header.tpl.d17.php:179
  • include("/home/imthurn/maharadata/dwoo/compile/default/home...") at /home/imthurn/www/mahara/lib/dwoo/dwoo/Dwoo/Core.php:374
  • Dwoo_Core->get(object(Dwoo_Template_File), array(size 35)) at /home/imthurn/www/mahara/lib/dwoo/dwoo/plugins/builtin/functions/include.php:66
  • Dwoo_Plugin_include(object(Dwoo_Mahara), "header.tpl", null, null, null, "_root", null) at/home/imthurn/maharadata/dwoo/compile/default/home/imthurn/www/mahara/theme/raw/templates/login.tpl.d17.php:10
  • include("/home/imthurn/maharadata/dwoo/compile/default/home...") at /home/imthurn/www/mahara/lib/dwoo/dwoo/Dwoo/Core.php:374
  • Dwoo_Core->get(object(Dwoo_Template_File), array(size 35)) at /home/imthurn/www/mahara/lib/dwoo/mahara/Dwoo_Mahara.php:123
  • Dwoo_Mahara->fetch("login.tpl") at /home/imthurn/www/mahara/lib/dwoo/mahara/Dwoo_Mahara.php:107
  • Dwoo_Mahara->display("login.tpl") at /home/imthurn/www/mahara/auth/lib.php:1145
  • auth_draw_login_page(null, object(Pieform)) at /home/imthurn/www/mahara/auth/lib.php:521
  • auth_setup() at /home/imthurn/www/mahara/init.php:386
  • require("/home/imthurn/www/mahara/init.php") at /home/imthurn/www/mahara/admin/index.php:19
[WAR] bf (auth/session.php:312) Invalid argument supplied for foreach()
Call stack (most recent first):
  • log_message("Invalid argument supplied for foreach()", 8, true, true, "/home/imthurn/www/mahara/auth/session.php", 312) at/home/imthurn/www/mahara/lib/errors.php:489
  • error(2, "Invalid argument supplied for foreach()", "/home/imthurn/www/mahara/auth/session.php", 312, array(size 3)) at/home/imthurn/www/mahara/auth/session.php:312
  • Session->render_messages("messages") at /home/imthurn/www/mahara/auth/session.php:472
  • insert_messages() at /home/imthurn/maharadata/dwoo/compile/default/home/imthurn/www/mahara/theme/default/templates/header.tpl.d17.php:179
  • include("/home/imthurn/maharadata/dwoo/compile/default/home...") at /home/imthurn/www/mahara/lib/dwoo/dwoo/Dwoo/Core.php:374
  • Dwoo_Core->get(object(Dwoo_Template_File), array(size 35)) at /home/imthurn/www/mahara/lib/dwoo/dwoo/plugins/builtin/functions/include.php:66
  • Dwoo_Plugin_include(object(Dwoo_Mahara), "header.tpl", null, null, null, "_root", null) at/home/imthurn/maharadata/dwoo/compile/default/home/imthurn/www/mahara/theme/raw/templates/login.tpl.d17.php:10
  • include("/home/imthurn/maharadata/dwoo/compile/default/home...") at /home/imthurn/www/mahara/lib/dwoo/dwoo/Dwoo/Core.php:374
  • Dwoo_Core->get(object(Dwoo_Template_File), array(size 35)) at /home/imthurn/www/mahara/lib/dwoo/mahara/Dwoo_Mahara.php:123
  • Dwoo_Mahara->fetch("login.tpl") at /home/imthurn/www/mahara/lib/dwoo/mahara/Dwoo_Mahara.php:107
  • Dwoo_Mahara->display("login.tpl") at /home/imthurn/www/mahara/auth/lib.php:1145
  • auth_draw_login_page(null, object(Pieform)) at /home/imthurn/www/mahara/auth/lib.php:521
  • auth_setup() at /home/imthurn/www/mahara/init.php:386
  • require("/home/imthurn/www/mahara/init.php") at /home/imthurn/www/mahara/admin/index.php:19

Cookies:

I need some help. Thank you

Best Wishes Gabriel

Aaron Wells's profile picture
Posts: 896

07 July 2016, 10:44

Hi Gabriel,

Sorry to hear about your upgrade problems! We've been having some difficult bugs relating to sessions lately, and this sounds like it may be related. (See https://bugs.launchpad.net/mahara/+bug/1592236 ).

Kristina asked me on IRC about your problem a couple of days ago, and it was I who suggested that you try the workaround of setting $cfg->ajaxifyblocks = false;, because that earlier problem you were having looked a lot like another bug ( https://bugs.launchpad.net/mahara/+bug/1544424 ) caused when an Ajax-loaded block's ajax script errors out and returns an error response, and then the error response contained code that recursively caused the ajax block to be reloaded over and over again. I thought we had that one fixed, but it looks like there may be a variant of it that can still pop up.

Anyway, regarding the current issue. I can see from that error stack that it's certainly a problem relating to sessions. And (using the login that Kristina gave me earlier), I noticed that you only seem to get logged out when you go from a page with a path component (like /admin/index.php) to a page without one (like /index.php). So I think specifically this problem may be due to a bug in how Mahara handles a wwwroot that doesn't have a trailing slash at the end. ( https://bugs.launchpad.net/mahara/+bug/1599404 )

If that's the case, you should be able to work around the problem by setting your wwwroot with a trailing slash in your config.php, like this:

$cfg->wwwroot = 'http://www.e-pf.ch/';

Please give that a try. :)

Also, could you please tell me your web server's operating system, and PHP version? It might help us in pinning down why this session issue only happens on some sites and not on others.

Cheers,

Aaron

07 July 2016, 17:27

Dear Aaron

Thank you for answering that fast. I'm not under pressure for the next two weeks.

www.e-pf.ch/info.php - here you get all the infos about the system.

I already red the discussions about the trailing slash.

$cfg->wwwroot = 'http://www.e-pf.ch/'; 

Does not help, sorry.

If you'd like to take a look at my files I can send you the login to your mail.

Thank you anyway for you help.

Kind Regards Gabriel

 

09 August 2016, 20:58

Dear Aaron

I would like to solve my problems after my summer break. So here are the data you wanted last time:

System: FreeBSD s11.server.hostpoint.ch 10.3-RELEASE-p3 FreeBSD 10.3-RELEASE-p3 #12 r300097M: Wed May 18 00:39:17 UTC 2016 [email protected]:/usr/obj/usr/src/sys/HOSTPOINT amd64

php: 5.6.24

my SQL: mysqlnd 5.0.11-dev

www.e-pf.ch/info.php

Mahara: 16.4.3

I just took a look at the database: I have to login each time and it creates a new session each time.

1

3207b665a218bfa8a494a8f3af051b95

2016-08-09 10:41:47

2016-08-09 10:41:47

1

774c8a839c54ed6a007590cdfb8b9be0

2016-08-09 10:41:30

2016-08-09 10:41:30

1

cb30fe18cb5880fe6d7d7f6054ed50d2

2016-08-09 10:40:58

2016-08-09 10:40:58

1

6b7037768ef95db76d569c3771a1375c

2016-08-09 10:40:49

2016-08-09 10:40:4

Thank you for your support.

Kind Regards Gabriel

Aaron Wells's profile picture
Posts: 896

10 August 2016, 18:41

Hi Gabriel,

Yep, getting a different session on each page load would cause exactly the problem you're describing. If things were working correctly, that would be the same one on each page load after you've logged in (indeed, that's how it's able to track you from one page to the next).

FreeBSD and MySQL 5.0 is a bit different platform from what I'm used to. But I doubt that's what's causing this problem. The important thing is that your PHP version is up to date, and yours is (5.6).

The question is, why is it sending you a new session ID each time? In practice, the way it should work is that the session ID gets sent to you via a cookie in an HTTP response header, and then on your next page request your browser sends it back again in the HTTP request. PHP sees the ID in the request, and that's how it knows you're the same person who just logged in, so it lets you continue using that same session ID until you log out.

Unfortunately, I can't think of any good way to investigate that, other than debugging the PHP code line by line. :(

Cheers,

Aaron

10 August 2016, 21:00

Dear Aaron

 

thank you for answering. I will do a fresh install on a apache server. This is the only option for me. I hope this will help.

Cheers

Gabriel

Aaron Wells's profile picture
Posts: 896

11 August 2016, 10:50

If I were debugging this issue firsthand, another thing I might try is to determine whether there's a specific version of Mahara where the bug appears. This technique could be kind of labor intensive, though.

For instance, if your site contains customizations to the code, then install a new copy of Mahara from scratch on the same server, and see if it exhibits the bug. And if so, then try installing an older copy of Mahara (say, 1.9), and see if that exhibits the bug. And then if it works in 1.9.9 but is broken in 1.10.10, see if it works in 1.10.0, 1.10.5, etc, until you find the specific minor release where it broke.

(I do this fairly often when trying to find the cause of new bugs in Mahara. On my dev machine I use a git utility called "git bisect" that helps you do a binary search between a known "good" and "bad" version of the code, until it finds the specific commit where the bug appears. But for me it's a fast process because I've got scripts that automate several of the steps on my dev machine.)

Your idea of trying it on a different server, is probably going to be easier, though. ;) At Catalyst we run our hosted Mahara sites on Ubuntu 14.04, with some testing on Ubuntu 16.04, so if you can use one of those OS'es it'll be pretty solid.

Cheers,

Aaron

7 results