Installing Moodle for First Time got this error

Installing Moodle for First Time got this error

by Ogas on top -
Number of replies: 6
During the installation process, I got an upgrade moodle database message and when i hit upgrade i got the error below

Upgrading to new version

mod_feedback

DDL sql execution error

More information about this error

It is usually not possible to recover from errors triggered during installation, you may need to create a new database or use a different database prefix if you want to retry the installation.

×Debug info: Table 'mdl_feedback' already exists
CREATE TABLE mdl_feedback (
id BIGINT(10) NOT NULL auto_increment,
course BIGINT(10) NOT NULL DEFAULT 0,
name VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
intro LONGTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
introformat SMALLINT(4) NOT NULL DEFAULT 0,
anonymous TINYINT(1) NOT NULL DEFAULT 1,
email_notification TINYINT(1) NOT NULL DEFAULT 1,
multiple_submit TINYINT(1) NOT NULL DEFAULT 1,
autonumbering TINYINT(1) NOT NULL DEFAULT 1,
site_after_submit VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
page_after_submit LONGTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
page_after_submitformat TINYINT(2) NOT NULL DEFAULT 0,
publish_stats TINYINT(1) NOT NULL DEFAULT 0,
timeopen BIGINT(10) NOT NULL DEFAULT 0,
timeclose BIGINT(10) NOT NULL DEFAULT 0,
timemodified BIGINT(10) NOT NULL DEFAULT 0,
completionsubmit TINYINT(1) NOT NULL DEFAULT 0,
CONSTRAINT PRIMARY KEY (id)
, KEY mdl_feed_cou2_ix (course)
)
ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE = utf8_unicode_ci
COMMENT='all feedbacks'
;
CREATE TABLE mdl_feedback_template (
id BIGINT(10) NOT NULL auto_increment,
course BIGINT(10) NOT NULL DEFAULT 0,
ispublic TINYINT(1) NOT NULL DEFAULT 0,
name VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
CONSTRAINT PRIMARY KEY (id)
, KEY mdl_feedtemp_cou2_ix (course)
)
ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE = utf8_unicode_ci
COMMENT='templates of feedbackstructures'
;
CREATE TABLE mdl_feedback_item (
id BIGINT(10) NOT NULL auto_increment,
feedback BIGINT(10) NOT NULL DEFAULT 0,
template BIGINT(10) NOT NULL DEFAULT 0,
name VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
label VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
presentation LONGTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
typ VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
hasvalue TINYINT(1) NOT NULL DEFAULT 0,
position SMALLINT(3) NOT NULL DEFAULT 0,
required TINYINT(1) NOT NULL DEFAULT 0,
dependitem BIGINT(10) NOT NULL DEFAULT 0,
dependvalue VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
options VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
CONSTRAINT PRIMARY KEY (id)
, KEY mdl_feeditem_fee2_ix (feedback)
, KEY mdl_feeditem_tem2_ix (template)
)
ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE = utf8_unicode_ci
COMMENT='feedback_items'
;
CREATE TABLE mdl_feedback_completed (
id BIGINT(10) NOT NULL auto_increment,
feedback BIGINT(10) NOT NULL DEFAULT 0,
userid BIGINT(10) NOT NULL DEFAULT 0,
timemodified BIGINT(10) NOT NULL DEFAULT 0,
random_response BIGINT(10) NOT NULL DEFAULT 0,
anonymous_response TINYINT(1) NOT NULL DEFAULT 0,
courseid BIGINT(10) NOT NULL DEFAULT 0,
CONSTRAINT PRIMARY KEY (id)
, KEY mdl_feedcomp_use2_ix (userid)
, KEY mdl_feedcomp_fee2_ix (feedback)
)
ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE = utf8_unicode_ci
COMMENT='filled out feedback'
;
CREATE TABLE mdl_feedback_completedtmp (
id BIGINT(10) NOT NULL auto_increment,
feedback BIGINT(10) NOT NULL DEFAULT 0,
userid BIGINT(10) NOT NULL DEFAULT 0,
guestid VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
timemodified BIGINT(10) NOT NULL DEFAULT 0,
random_response BIGINT(10) NOT NULL DEFAULT 0,
anonymous_response TINYINT(1) NOT NULL DEFAULT 0,
courseid BIGINT(10) NOT NULL DEFAULT 0,
CONSTRAINT PRIMARY KEY (id)
, KEY mdl_feedcomp_use3_ix (userid)
, KEY mdl_feedcomp_fee3_ix (feedback)
)
ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE = utf8_unicode_ci
COMMENT='filled out feedback'
;
CREATE TABLE mdl_feedback_value (
id BIGINT(10) NOT NULL auto_increment,
course_id BIGINT(10) NOT NULL DEFAULT 0,
item BIGINT(10) NOT NULL DEFAULT 0,
completed BIGINT(10) NOT NULL DEFAULT 0,
tmp_completed BIGINT(10) NOT NULL DEFAULT 0,
value LONGTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
CONSTRAINT PRIMARY KEY (id)
, KEY mdl_feedvalu_cou2_ix (course_id)
, UNIQUE KEY mdl_feedvalu_comitecou2_uix (completed, item, course_id)
, KEY mdl_feedvalu_ite2_ix (item)
)
ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE = utf8_unicode_ci
COMMENT='values of the completeds'
;
CREATE TABLE mdl_feedback_valuetmp (
id BIGINT(10) NOT NULL auto_increment,
course_id BIGINT(10) NOT NULL DEFAULT 0,
item BIGINT(10) NOT NULL DEFAULT 0,
completed BIGINT(10) NOT NULL DEFAULT 0,
tmp_completed BIGINT(10) NOT NULL DEFAULT 0,
value LONGTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
CONSTRAINT PRIMARY KEY (id)
, KEY mdl_feedvalu_cou3_ix (course_id)
, UNIQUE KEY mdl_feedvalu_comitecou3_uix (completed, item, course_id)
, KEY mdl_feedvalu_ite3_ix (item)
)
ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE = utf8_unicode_ci
COMMENT='values of the completedstmp'
;
CREATE TABLE mdl_feedback_sitecourse_map (
id BIGINT(10) NOT NULL auto_increment,
feedbackid BIGINT(10) NOT NULL DEFAULT 0,
courseid BIGINT(10) NOT NULL DEFAULT 0,
CONSTRAINT PRIMARY KEY (id)
, KEY mdl_feedsitemap_cou2_ix (courseid)
, KEY mdl_feedsitemap_fee2_ix (feedbackid)
)
ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE = utf8_unicode_ci
COMMENT='feedback sitecourse map'
Error code: ddlexecuteerror
×Stack trace:
  • line 492 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
  • line 1072 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 77 of /lib/ddl/database_manager.php: call to mysqli_native_moodle_database->change_database_structure()
  • line 425 of /lib/ddl/database_manager.php: call to database_manager->execute_sql_arr()
  • line 370 of /lib/ddl/database_manager.php: call to database_manager->install_from_xmldb_structure()
  • line 790 of /lib/upgradelib.php: call to database_manager->install_from_xmldb_file()
  • line 532 of /lib/upgradelib.php: call to upgrade_plugins_modules()
  • line 1877 of /lib/upgradelib.php: call to upgrade_plugins()
  • line 694 of /admin/index.php: call to upgrade_noncore()

Average of ratings: -
In reply to Ogas on top

Re: Installing Moodle for First Time got this error

by Ken Task -
Picture of Particularly helpful Moodlers

Am confused ... subject line of this posting says 'installing ...' but your posting is about upgrading???!!!

Please see:

https://docs.moodle.org/310/en/Installing_Moodle

The link to more information about this error:

https://docs.moodle.org/38/en/error/moodle/ddlexecuteerror

Shows you are installing a 3.8 version of Moodle ... on what platform?  with what provider?   How installing?

If it is showing the correct linked version for help, then look at

https://docs.moodle.org/38/en/Installing_Moodle

Also, the attempt to upgrade shows DB server is using utf8 character set ... which should be utf8mb4 and the collation would also be utf8mb4_general_ci

'SoS', Ken

In reply to Ken Task

Re: Installing Moodle for First Time got this error

by Ogas on top -
Apologies I was installing moodle on a nas synology. It was a fresh installation i got from the package center. During the installation process it got to a point where it needed to upgrade the database and alot of parts where picked to be upgraded like feedback, assignment and many more. I clicked on update the database and got this error. The moodle version was the latest
In reply to Ogas on top

Re: Installing Moodle for First Time got this error

by Ken Task -
Picture of Particularly helpful Moodlers

If you want to install a moodle, follow the link given for installing from moodle.org docs.   Your package manager attempted to update a 3.8 and we know that by the copied and pasted error screen you put into your posting ... it had a link that went to Moodle help for version 3.8 ... not a 3.9.

In a typical install following Moodle docs, one does not get a screen which allows selection of core modules to install.   You package manager installer apparently tries, but fails.

These forums are for Moodle - using the official moodle docs - not a nas synology package manager installer.

IF you want help with that, suggest finding a synology forum that assist with their package manager installer issues and strike up a conversation there.

Best of luck!

'SoS', Ken


Average of ratings: Useful (1)
In reply to Ken Task

Re: Installing Moodle for First Time got this error

by Ogas on top -
The solution was to change the collation to utf8mb4_general_ci
In reply to Ogas on top

Re: Installing Moodle for First Time got this error

by Ken Task -
Picture of Particularly helpful Moodlers

Congrats!  Glad you were able to resolve.

Now a word of caution ... before you update via your package manager make sure you have a site backup of code directory, data directory, and an sql dump of DB.   Package Manger isn't aware of checks/etc that moodle code does ... nor might it follow archiving config.php file + other addons, etc.

From this point forward with your Moodle, use official Moodle docs for updating and upgrading.

I say above from an 'unpleasant experience' with Fedora's package manager (rpm at the time) and moodle.   Fedora's rpm update wrecked my moodle. :|  Because I did not have the knowledge about moodle at the time (something one acquires over time), that was painful ... 6 months of work ... gone.

But, lesson learned ... the hard way! sad

'SoS', Ken

Average of ratings: Useful (1)