Forums | Mahara Community

News /
Mahara 1.1.0 Released


This topic is closed. Only moderators and the group administrators can post new replies.
anonymous profile picture
Account deleted
Posts: 13

26 February 2009, 13:03

I've had the same problem, see

https://eduforge.org/tracker/?func=detail&aid=3165&group_id=176&atid=739

 

Using MySQL 5.0.24a

anonymous profile picture
Account deleted
Posts: 808

26 February 2009, 16:58

Hi Dave,

It looks like you might not have a 'root' user with id=0 in your database (we're using that user to own system-wide things like the default profile view).

Could you post the output of something like this:

SELECT  id, username FROM mah_usr WHERE id < 5 OR username = 'root';

If you can remember, could you also let me know what version of Mahara you used for your original install (or the approximate date).  Nigel reckons there was a time when the root user was being created on MySQL with id = 1 instead of 0, and if your database still has that problem it means we will need to change the id in the upgrade.

anonymous profile picture
Account deleted
Posts: 1643

26 February 2009, 17:45

Hi - one other thing, you're using an unsupported version of MySQL. Mahara doesn't quite run properly on versions before 5.0.25. I don't think it's related to your problem, but you might want to consider upgrading at some point (and you'll have to if you try and install a new 1.1 from scratch).

27 February 2009, 22:23

I guess it's a problem with foreigh keys dependence. It looks like the table can't be altered because his value is bound to another one into another table so that this first should be altered.

Actually i didn't look the details but an easy workaround could be to 

SET FOREIGN_KEY_CHECKS = 0;
lauch the upgrade to 1.1.0
SET FOREIGN_KEY_CHECKS = 1;
 
I didn't test this so it may be wrong, but I guess it can help. 
anonymous profile picture
Account deleted
Posts: 1643

28 February 2009, 3:30

Hi - if you need to do that, it's a bug in the upgrade process. If you can nail it down, let us know what the problem is so we can fix it Smile
anonymous profile picture
Account deleted
Posts: 13

05 March 2009, 18:49

Thanks for all the comments and suggestions. Just upgraded to MySQL 5.1.32, and tried running the Mahara 1.1.1 upgrade on a fresh copy of the old 1.0.9 database, but still get this:

Failed to get a recordset: mysql error: [1452: Cannot add or update a child row: a foreign key constraint fails ("mahara111"."mah_view", CONSTRAINT "mah_view_own_fk" FOREIGN KEY ("owner") REFERENCES "mah_usr" ("id"))] in adodb_throw(INSERT INTO "mah_view" ("title", "description", "owner", "ownerformat", "ctime", "mtime", "atime", "numcolumns", "template", "type") VALUES ('Profile view', '', 0, 4, '2009-03-05 16:44:23', '2009-03-05 16:44:23', '2009-03-05 16:44:23', 2, 1, 'profile'), ) Command was: INSERT INTO "mah_view" ("title", "description", "owner", "ownerformat", "ctime", "mtime", "atime", "numcolumns", "template", "type") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and values was (Profile view,,0,4,2009-03-05 16:44:23,2009-03-05 16:44:23,2009-03-05 16:44:23,2,1,profile)

Call stack (most recent first):
  • insert_record("view", object(stdClass), "id", true) at /Library/WebServer/Documents/mahara111/lib/db/upgrade.php:575
  • xmldb_core_upgrade("2008040218") at /Library/WebServer/Documents/mahara111/lib/upgrade.php:271
  • upgrade_core(object(stdClass)) at /Library/WebServer/Documents/mahara111/admin/upgrade.json.php:71
 

 

anonymous profile picture
Account deleted
Posts: 808

05 March 2009, 20:00

Hi Dave,

The upgrade inserts a new view which is owned by a user with id=0, and the most likely reason that you are getting that foreign key error is that your database doesn't have a user with id=0.  I'd really like to find out if that's true, and if so, how it happened. Could you check the 'mah_usr' table from your old 1.0.9 database (by running the query from my previous post)?  That would help us to make a fix for any other people who might have the same problem.

 

But if you think it's something peculiar with your database, then you could just insert a system user into your 1.0.9 database and try again:

Restore your 1.0.9 db, run this sql command:

INSERT INTO mah_usr (id, password, salt, firstname, lastname, email, quota, username, authinstance) VALUES (0, '*', '*', 'System', 'User', '[email protected]', 10485760, 'root', 1);

And then try the upgrade again.

Richard.

anonymous profile picture
Account deleted
Posts: 13

06 March 2009, 11:18

Sorry, I forgot to mention, I did check that out from your previous post.  When I first checked, root originally had an id of 463, but I changed it to 0 about a week ago, and since then root has an id of 0 in the working 1.0.9 database, and in all the clones in which I've been testing the upgrade.
anonymous profile picture
Account deleted
Posts: 808

08 March 2009, 18:06

So if you restore the 1.0.9 db, set root's id to 0, and then do the upgrade from there, are you still getting exactly the same foreign key error that you posted above?
David Mudrák's profile picture
Posts: 45

09 March 2009, 5:27

Guys, can this thread be split off into another forum instead of "Mahara News"? IMO News is not a good place to discuss installation/upgrade problems. Think of subscribers, rss feeds etc. Thanks.