Forums | Mahara Community

Support /
Site Unavailable to new people only


Peter Easton's profile picture
Posts: 17

24 September 2010, 7:35

I hope someone here can help.

We recently moved our mahara 1.2.2 to a new box configured with the same php, mysql, apache and now when new people try to enter the system they get:

"Pratt ePortfolio: Site unavailable

A nonrecoverable error occured. This probably means you have encountered a bug in the system"

I've check the db and the data storage and everything seems fine, and the user has clean LDAP record.

i'm stuck, I saw on another post that had luck finding some corrupted so i've started reviewing the files but if some can put out where to look it would sure make it go alot faster.

 

Thanks

Pete

 

Peter Easton's profile picture
Posts: 17

24 September 2010, 8:21

I've tracked it back to a mysql error by look at the logs but i'm not sure what's causing it?

here's the logs, maybe some who knows more will see something i'm missing:

[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136] [WAR] 9f (lib/errors.php:738) Failed to get a recordset: mysql error: [1452: Cannot add or update a child row: a foreign key constraint fails ("mahara"."artefact", CONSTRAINT "arte_own_fk" FOREIGN KEY ("owner") REFERENCES "usr" ("id"))] in adodb_throw(INSERT INTO "artefact" ("artefacttype", "owner", "ctime", "mtime", "atime", "title") VALUES ('firstname', 0, '2010-09-24 09:09:02', '2010-09-24 09:09:02', '2010-09-24 09:09:02', 'Test'), ), referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136] [WAR] 9f (lib/errors.php:738) Command was: INSERT INTO "artefact" ("artefacttype", "owner", "ctime", "mtime", "atime", "title") VALUES (?, ?, ?, ?, ?, ?) and values was (firstname,0,2010-09-24 09:09:02,2010-09-24 09:09:02,2010-09-24 09:09:02,Test), referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136] Call stack (most recent first):, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136]   * log_message("Failed to get a recordset: mysql error: [1452: Can...", 8, true, true) at /usr/local/www/apache22/data/lib/errors.php:111, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136]   * log_warn("Failed to get a recordset: mysql error: [1452: Can...") at /usr/local/www/apache22/data/lib/errors.php:738, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136]   * SQLException->__construct("Failed to get a recordset: mysql error: [1452: Can...") at /usr/local/www/apache22/data/lib/dml.php:1048, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136]   * insert_record("artefact", object(stdClass), "id", true) at /usr/local/www/apache22/data/artefact/lib.php:397, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136]   * ArtefactType->commit() at /usr/local/www/apache22/data/artefact/internal/lib.php:495, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136]   * ArtefactTypeCachedProfileField->commit() at /usr/local/www/apache22/data/lib/user.php:228, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136]   * set_profile_field(0"firstname", "Test") at /usr/local/www/apache22/data/auth/ldap/lib.php:136, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136]   * AuthLdap->authenticate_user_account(object(LiveUser), "xxxxxx") at /usr/local/www/apache22/data/auth/lib.php:1167, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136]   * login_submit(object(Pieform), array(size 6)) at Unknown:0, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136]   * call_user_func_array("login_submit", array(size 2)) at /usr/local/www/apache22/data/lib/pieforms/pieform.php:430, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136]   * Pieform->__construct(array(size 8)) at /usr/local/www/apache22/data/auth/lib.php:470, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136]   * auth_setup() at /usr/local/www/apache22/data/init.php:239, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136]   * require("/usr/local/www/apache22/data/init.php") at /usr/local/www/apache22/data/index.php:32, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136] , referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136] [WAR] 9f (lib/dml.php:1048) Failed to get a recordset: mysql error: [1452: Cannot add or update a child row: a foreign key constraint fails ("mahara"."artefact", CONSTRAINT "arte_own_fk" FOREIGN KEY ("owner") REFERENCES "usr" ("id"))] in adodb_throw(INSERT INTO "artefact" ("artefacttype", "owner", "ctime", "mtime", "atime", "title") VALUES ('firstname', 0, '2010-09-24 09:09:02', '2010-09-24 09:09:02', '2010-09-24 09:09:02', 'Test'), ), referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136] [WAR] 9f (lib/dml.php:1048) Command was: INSERT INTO "artefact" ("artefacttype", "owner", "ctime", "mtime", "atime", "title") VALUES (?, ?, ?, ?, ?, ?) and values was (firstname,0,2010-09-24 09:09:02,2010-09-24 09:09:02,2010-09-24 09:09:02,Test), referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136] Call stack (most recent first):, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136]   * insert_record("artefact", object(stdClass), "id", true) at /usr/local/www/apache22/data/artefact/lib.php:397, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136]   * ArtefactType->commit() at /usr/local/www/apache22/data/artefact/internal/lib.php:495, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136]   * ArtefactTypeCachedProfileField->commit() at /usr/local/www/apache22/data/lib/user.php:228, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136]   * set_profile_field(0"firstname", "Test") at /usr/local/www/apache22/data/auth/ldap/lib.php:136, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136]   * AuthLdap->authenticate_user_account(object(LiveUser), "xxxxxx") at /usr/local/www/apache22/data/auth/lib.php:1167, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136]   * login_submit(object(Pieform), array(size 6)) at Unknown:0, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136]   * call_user_func_array("login_submit", array(size 2)) at /usr/local/www/apache22/data/lib/pieforms/pieform.php:430, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136]   * Pieform->__construct(array(size 8)) at /usr/local/www/apache22/data/auth/lib.php:470, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136]   * auth_setup() at /usr/local/www/apache22/data/init.php:239, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136]   * require("/usr/local/www/apache22/data/init.php") at /usr/local/www/apache22/data/index.php:32, referer: http://eportfolio.test.edu/
[Fri Sep 24 09:09:02 2010] [error] [client 172.16.98.136] , referer: http://eportfolio.test.edu/
$

anonymous profile picture
Account deleted
Posts: 808

26 September 2010, 21:13

Peter,

This looks to me like a bug that was fixed after 1.2.2 was released:

  https://bugs.launchpad.net/mahara/+bug/536959

If you can, upgrade to 1.2.6 and see if that fixes the problem.

Peter Easton's profile picture
Posts: 17

27 September 2010, 7:49

Ok Did the upgrades and installed the fileinfo extension and that fixed the search problem i was having but still new users are getting the error. Any other ideas? the only difference i can find in the two boxes is the version of mySQL

New Box:
PHP Version 5.3.3
Apache 2.2.16
mySQL 5.1.50

Old Box
PHP Version 5.3.3
Apache 2.2.16
mySQL 5.0.90

Are there any now problems mySQL 5.1.50?
Here a dump of the log for a new user trying to log in:

[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187] [WAR] 79 (lib/errors.php:738) Failed to get a recordset: mysql error: [1452: Cannot add or update a child row: a foreign key constraint fails ("mahara"."artefact", CONSTRAINT "arte_own_fk" FOREIGN KEY ("owner") REFERENCES "usr" ("id"))] in adodb_throw(INSERT INTO "artefact" ("artefacttype", "owner", "ctime", "mtime", "atime", "title") VALUES ('firstname', 0, '2010-09-27 08:30:39', '2010-09-27 08:30:39', '2010-09-27 08:30:39', 'Test'), ), referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187] [WAR] 79 (lib/errors.php:738) Command was: INSERT INTO "artefact" ("artefacttype", "owner", "ctime", "mtime", "atime", "title") VALUES (?, ?, ?, ?, ?, ?) and values was (firstname,0,2010-09-27 08:30:39,2010-09-27 08:30:39,2010-09-27 08:30:39,Test), referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187] Call stack (most recent first):, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187]   * log_message("Failed to get a recordset: mysql error: [1452: Can...", 8, true, true) at /usr/local/www/apache22/data/lib/errors.php:111, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187]   * log_warn("Failed to get a recordset: mysql error: [1452: Can...") at /usr/local/www/apache22/data/lib/errors.php:738, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187]   * SQLException->__construct("Failed to get a recordset: mysql error: [1452: Can...") at /usr/local/www/apache22/data/lib/dml.php:1048, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187]   * insert_record("artefact", object(stdClass), "id", true) at /usr/local/www/apache22/data/artefact/lib.php:397, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187]   * ArtefactType->commit() at /usr/local/www/apache22/data/artefact/internal/lib.php:495, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187]   * ArtefactTypeCachedProfileField->commit() at /usr/local/www/apache22/data/lib/user.php:228, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187]   * set_profile_field(0"firstname", "Test") at /usr/local/www/apache22/data/auth/ldap/lib.php:135, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187]   * AuthLdap->authenticate_user_account(object(LiveUser), "xxxxxx") at /usr/local/www/apache22/data/auth/lib.php:1181, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187]   * login_submit(object(Pieform), array(size 6)) at Unknown:0, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187]   * call_user_func_array("login_submit", array(size 2)) at /usr/local/www/apache22/data/lib/pieforms/pieform.php:430, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187]   * Pieform->__construct(array(size 8)) at /usr/local/www/apache22/data/auth/lib.php:474, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187]   * auth_setup() at /usr/local/www/apache22/data/init.php:239, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187]   * require("/usr/local/www/apache22/data/init.php") at /usr/local/www/apache22/data/index.php:32, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187] , referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187] [WAR] 79 (lib/dml.php:1048) Failed to get a recordset: mysql error: [1452: Cannot add or update a child row: a foreign key constraint fails ("mahara"."artefact", CONSTRAINT "arte_own_fk" FOREIGN KEY ("owner") REFERENCES "usr" ("id"))] in adodb_throw(INSERT INTO "artefact" ("artefacttype", "owner", "ctime", "mtime", "atime", "title") VALUES ('firstname', 0, '2010-09-27 08:30:39', '2010-09-27 08:30:39', '2010-09-27 08:30:39', 'Test'), ), referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187] [WAR] 79 (lib/dml.php:1048) Command was: INSERT INTO "artefact" ("artefacttype", "owner", "ctime", "mtime", "atime", "title") VALUES (?, ?, ?, ?, ?, ?) and values was (firstname,0,2010-09-27 08:30:39,2010-09-27 08:30:39,2010-09-27 08:30:39,Test), referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187] Call stack (most recent first):, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187]   * insert_record("artefact", object(stdClass), "id", true) at /usr/local/www/apache22/data/artefact/lib.php:397, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187]   * ArtefactType->commit() at /usr/local/www/apache22/data/artefact/internal/lib.php:495, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187]   * ArtefactTypeCachedProfileField->commit() at /usr/local/www/apache22/data/lib/user.php:228, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187]   * set_profile_field(0"firstname", "Test") at /usr/local/www/apache22/data/auth/ldap/lib.php:135, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187]   * AuthLdap->authenticate_user_account(object(LiveUser), "xxxxxx") at /usr/local/www/apache22/data/auth/lib.php:1181, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187]   * login_submit(object(Pieform), array(size 6)) at Unknown:0, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187]   * call_user_func_array("login_submit", array(size 2)) at /usr/local/www/apache22/data/lib/pieforms/pieform.php:430, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187]   * Pieform->__construct(array(size 8)) at /usr/local/www/apache22/data/auth/lib.php:474, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187]   * auth_setup() at /usr/local/www/apache22/data/init.php:239, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187]   * require("/usr/local/www/apache22/data/init.php") at /usr/local/www/apache22/data/index.php:32, referer: http://eportfolio.test.edu/
[Mon Sep 27 08:30:39 2010] [error] [client 172.16.98.187] , referer: http://eportfolio.test.edu/

Peter Easton's profile picture
Posts: 17

27 September 2010, 11:00

Here's the errors we are gettingerrors we are getting

anonymous profile picture
Account deleted
Posts: 808

27 September 2010, 17:26

Peter,

This looks pretty bad to me; I think it may be a bug that's been hanging around for quite a while (since 1.2.0 at least: https://bugs.launchpad.net/mahara/+bug/547779).  It seems to be trying to update profile fields for users who haven't been created yet.

Can you confirm that on your old box you had both "We auto-create users" and "Update user info on login" turned on?  Because if you had both of those on, I'm surprised this bug hasn't always been an issue for you.

For a quick fix, I think you should try turning off "Update user info on login" in your ldap auth configuration.

For a slightly less quick fix, change line 121 of htdocs/auth/ldap/lib.php from:

if ($update) {

to

if ($user->id && $update) {

I haven't tested that yet, but it's probably the fix I'll end up committing.

Peter Easton's profile picture
Posts: 17

27 September 2010, 21:04

unchecking "Update user info on login" did the trick.

i'll try the code adjustments tomorrow morning.

i did have both checked and it works, go figure.

i'll post back after i do the code tweak and let you know ho it goes

 

thanks again

Pete

anonymous profile picture
Account deleted
Posts: 808

04 October 2010, 21:21

Hi Peter,

Have you had a chance to try the code changes out?

8 results