redirect login loop - moodle 1.9 beta4

redirect login loop - moodle 1.9 beta4

by Anthony David -
Number of replies: 5
Successfully installed Moodle 1.8. Colleague created exam questions as admin user. Upgraded successfully? to Moodle 1.9 beta4 for extra features (larger fields for certain question types). After some time, admin required to login again. login/index.php click on browser (IE, Opera and Firefox tried by colleague - obvious that was not a browser bug) led to browser interrupting a "redirect storm" (see tcpdump extracts below).

First-time moodle user/admin so would appreciate any pointers to look in database and/or code where this fault may be originating from.


Diagnosis steps:

1) tcpdump (complete supplied/generated on request)

sample packets:

GET /moodle/login/index.php HTTP/1.1
Host: iped-editors.org
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9b3) Gecko
/2008020511 Firefox/3.0b3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: PHPSESSID=10a16ff29d29251bc6348c25c5c624cc; MOODLEID_=%25ED%25C3%251CC%2
5B7d; MoodleSession=95c33088a8ac46f583759266bda52497; MoodleSessionTest=J8oCjtuJ
uI

...

HTTP/1.1 303 See Other
Date: Sun, 17 Feb 2008 10:48:15 GMT
Server: Apache/2.0.52 (CentOS)
X-Powered-By: PHP/4.3.9
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Location: http://iped-editors.org/moodle/mod/resource/view.php?id=13
Content-Length: 244
Connection: close
Content-Type: text/html; charset=utf-8

<meta http-equiv="refresh" content="0; url=http://iped-editors.org/moodle/mod/re
source/view.php?id=13" /><script type="text/javascript">
//<![CDATA[
location.replace('http://iped-editors.org/moodle/mod/resource/view.php?id=13');

...

GET /moodle/mod/resource/view.php?id=13 HTTP/1.1
Host: iped-editors.org
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9b3) Gecko
/2008020511 Firefox/3.0b3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: PHPSESSID=10a16ff29d29251bc6348c25c5c624cc; MOODLEID_=%25ED%25C3%251CC%2
5B7d; MoodleSession=95c33088a8ac46f583759266bda52497; MoodleSessionTest=J8oCjtuJ
uI

...

HTTP/1.1 303 See Other
Date: Sun, 17 Feb 2008 10:48:16 GMT
Server: Apache/2.0.52 (CentOS)
X-Powered-By: PHP/4.3.9
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Location: http://iped-editors.org/moodle/login/index.php
Content-Length: 220
Connection: close
Content-Type: text/html; charset=utf-8

<meta http-equiv="refresh" content="0; url=http://iped-editors.org/moodle/login/
index.php" /><script type="text/javascript">
//<![CDATA[
location.replace('http://iped-editors.org/moodle/login/index.php');

...

And thus the loop is complete!

2) Got weirded out by the Expires Date: and restarted the Apache server - figure that was there to make sure it is never cached. Fault remained.

3) Deleted sessions in moodledata/sessions . Fault remained.

4) set mdl_config.forcelogin to '1'. Fault remained.

5) Installed moodle on another server (Ubuntu 7.10, apache2, php5, mysql5 ...). Copied over and hand-edited config.php, dump/restored moodle database, copied over moodledata, deleting sessions directory contents. Fault remained.


Average of ratings: -
In reply to Anthony David

Re: redirect login loop - moodle 1.9 beta4

by Anthony David -
I think I now understand moodle enough to know that the module that my colleague installed (resource) is probably a more likely candidate as the source of our troubles and I will take this question to the correct forum.

In reply to Anthony David

Re: redirect login loop - moodle 1.9 beta4

by Anthony David -
Still talking to myself here smile

Module was not the problem.

Ran this query:

mysql> select * from mdl_config where value like '%iped%';

which reported (among other rows):

| 127 | alternateloginurl | http://iped-editors.org/moodle/mod/resource/view.php?id=13 |

Which looked suspiciously like the culprit.

ran this:

mysql> update mdl_config set value = NULL where id = '127';

And login works!

Now to find out how this got set in the first place.
In reply to Anthony David

Re: redirect login loop - moodle 1.9 beta4

by Matt Campbell -
This is set in Admin->Users->Authentication->Manage Authentication - it would seem that someone set this value - possibly as part of the resource modification you were doing?

Thanks,
Matt
In reply to Matt Campbell

Re: redirect login loop - moodle 1.9 beta4

by Anthony David -
Thanks Matt.

That would make sense. I suspect that is what the admin did.
In reply to Anthony David

Re: redirect login loop - moodle 1.9 beta4

by Dicker Bub -

After installing 2.0.2 and setting it up, I experience the same problem.

The solution described here worked for me, too! Thanks a million!

It seems that problem was cause by acitivating the e-mail registration plugin.