Installation fails (Moodle 3.2.2)
Submitted by mjroberts on Mon, 03/27/2017 - 13:51
I'm quite new to Moodle and trying to install H5P on there but getting errors. Could someone a bit more knowledgable have a look and give some hints as to where it's going wrong?
I've attached the error output.
Tue, 03/28/2017 - 09:57
Hi, this is a product of your
Hi, this is a product of your database character settings and a rather large index on our part in the following table definition:
The given key in this definition is 268bytes, however your error message says that it exceeds 767bytes. The problem arises when the character setting is utf8, then the max number of bytes turns to 255bytes, you can read more about it here.
Anyway, the quickest fix for you would be to add the "Innodb_large_prefix" to your database settings, and we will look into what can be done to improve the size of the index on the plugin end. I have created an issue for it at the H5P public issue tracker.
Could you provide some more info on which database you're using and with what settings ?
Thanks for the report,
Tue, 03/28/2017 - 14:10
Thanks for the guidance, got
Thanks for the guidance, got it fixed now.
My database was a mySQL, using innodb (anaconda?). I performed an update to baracuda using the moodle instructions, then edited the my.cnf file to add the setting above. The only other issue I kept getting was that upon a failed installation, it left behind the old mood_hvp table which then needed to be manually dropped.
(If I sound like I know what I'm talking about, I'm winging it... this is my first time setting up databases and the like. It's a major learning curve!)
Fri, 03/31/2017 - 16:33
This is a tricky one ;-)
This is a tricky one ;-) From Moodle 3.1.5 and 3.2.2 onwards, the MySQL database in new installations will add the large_prefix option and use the "better" utf8mb4_unicode_ci" collation (4 bytes per character, allowing emojis). For existing installations, the recommendation will be to upgrade the database. However, the H5P plugin should also work on Moodle installations who choose not to upgrade their database. This would mean either shortening column machine_name to 191 characters (191 x 4 = 764 < 767 characters, which is the default maximum length), or using a prefix for this column in the key definition.
Mon, 04/03/2017 - 09:23
Thank you for your insight,
Thank you for your insight, it is very valuable. I guess this should work for most people who follow the recommendations for Moodle databases, but we'll make sure to support those who choose not to, it will be addressed in the public issue tracker, and we'll make sure to pay closer attention to this restraint in following releases.
Mon, 04/03/2017 - 09:41
(I was just starting to
(I was just starting to correct my post when I received your answer !) As you said, people following Moodle recommendations should be fine :
But problems may arise for people using utf8mb4_unicode_ci without the large_prefix option (as was the case above). And it would be good if the H5P plugin would check this.