Error after upgrate

Error after upgrate

by Alejandro Rivera -
Number of replies: 6

Hi, everyone. I upgraded from 2.7 to 3.2.2, server is running php 5.6.3, mysql 5.6.23 (bitnami app) and i'm getting this errors.

This behaviour (manualgraded) cannot work with this question (qtype_missingtype_question)
Stack trace:
  • line 63 of /question/behaviour/behaviourbase.php: coding_exception thrown
  • line 236 of /question/engine/lib.php: call to question_behaviour->__construct()
  • line 1453 of /question/engine/questionattempt.php: call to question_engine::make_behaviour()
  • line 940 of /question/engine/questionusage.php: call to question_attempt::load_from_records()
  • line 469 of /question/engine/datalib.php: call to question_usage_by_activity::load_from_records()
  • line 84 of /question/engine/lib.php: call to question_engine_data_mapper->load_questions_usage_by_activity()
  • line 566 of /mod/quiz/attemptlib.php: call to question_engine::load_questions_usage_by_activity()
  • line 128 of /mod/quiz/attemptlib.php: call to quiz_attempt->__construct()
  • line 2222 of /mod/quiz/locallib.php: call to quiz->create_attempt_object()
  • line 68 of /mod/quiz/startattempt.php: call to quiz_validate_new_attempt(


It looks like there was an error on upgrate process but i couldn't see anything weird. what can i do?

Average of ratings: -
In reply to Alejandro Rivera

Re: Error after upgrate

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

It does. 

I'm thinking, restore your site from the backup I hope you took. Turn debugging all the way up and try again. Check your web server's error log carefully. Hopefully something will be logged.

In reply to Howard Miller

Re: Error after upgrate

by Alejandro Rivera -
I've restores everything and now i enabled the debug mode, and that's what i get:


Debug info: Table 'mdlese_qtype_ddimageortext' already exists
CREATE TABLE mdlese_qtype_ddimageortext (
id BIGINT(10) NOT NULL auto_increment,
questionid BIGINT(10) NOT NULL DEFAULT 0,
shuffleanswers SMALLINT(4) NOT NULL DEFAULT 1,
correctfeedback LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
correctfeedbackformat TINYINT(2) NOT NULL DEFAULT 0,
partiallycorrectfeedback LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
partiallycorrectfeedbackformat TINYINT(2) NOT NULL DEFAULT 0,
incorrectfeedback LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
incorrectfeedbackformat TINYINT(2) NOT NULL DEFAULT 0,
shownumcorrect TINYINT(2) NOT NULL DEFAULT 0,
CONSTRAINT PRIMARY KEY (id)
, KEY mdlese_qtypddim_que2_ix (questionid)
)
ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE = utf8_general_ci 
COMMENT='Defines drag and drop (text or images onto a background imag'
;
CREATE TABLE mdlese_qtype_ddimageortext_drops (
id BIGINT(10) NOT NULL auto_increment,
questionid BIGINT(10) NOT NULL DEFAULT 0,
no BIGINT(10) NOT NULL DEFAULT 0,
xleft BIGINT(10) NOT NULL DEFAULT 0,
ytop BIGINT(10) NOT NULL DEFAULT 0,
choice BIGINT(10) NOT NULL DEFAULT 0,
label LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
CONSTRAINT PRIMARY KEY (id)
, KEY mdlese_qtypddimdrop_que2_ix (questionid)
)
ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE = utf8_general_ci 
COMMENT='Drop boxes'
;
CREATE TABLE mdlese_qtype_ddimageortext_drags (
id BIGINT(10) NOT NULL auto_increment,
questionid BIGINT(10) NOT NULL DEFAULT 0,
no BIGINT(10) NOT NULL DEFAULT 0,
draggroup BIGINT(10) NOT NULL DEFAULT 0,
infinite SMALLINT(4) NOT NULL DEFAULT 0,
label LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
CONSTRAINT PRIMARY KEY (id)
, KEY mdlese_qtypddimdrag_que2_ix (questionid)
)
ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE = utf8_general_ci 
COMMENT='Images to drag. Actual file names are not stored here we use'
Error code: ddlexecuteerror
Stack trace:
  • line 485 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
  • line 1000 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 520 of /lib/upgradelib.php: call to database_manager->install_from_xmldb_file()
  • line 1748 of /lib/upgradelib.php: call to upgrade_plugins()
  • line 693 of /admin/index.php: call to upgrade_noncore()

What's next step?

In reply to Alejandro Rivera

Re: Error after upgrate

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
"Restore" means going back to a state which was working. It will never (try to) create new tables! You seem to have made a mess. Sorry, I know, that news is not very helpful. You should cautiously restore the site first.

What caught my eye, was the bump I had a two days ago: "Upgrade 2.7.19 > 3.1.5+ : qtype_ddimageortext " ddlexecuteerror" https://moodle.org/mod/forum/discuss.php?d=350361. No idea, whether they are related.
In reply to Visvanath Ratnaweera

Re: Error after upgrate

by Alejandro Rivera -

Yeah, it was a terrible mess, i restored the moodledata, db, and moodle files to the original state, but something was corrupted, don't know how could it happened wide eyes . 

In reply to Alejandro Rivera

Re: Error after upgrate

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Read this... but note that Emma's original advice is wrong: https://moodle.org/mod/forum/discuss.php?d=330815

If you don't use those optional plugins you could delete them before the upgrade

Essentially the problem is that the ddimageortext question type went from being optional to core and something has gone wrong with the upgrade. Most likely because it was in an incorrect state before the upgrade. It's very hard to say what. 

Average of ratings: Useful (2)
In reply to Howard Miller

Re: Error after upgrate

by Alejandro Rivera -

I've moved some directories and renamed some tables and finally it seems to work as expected; really, your answers were so helpful. 

Thanks.