Cannot add a SCORM

Cannot add a SCORM

by A Guy -
Number of replies: 8
I have a weird situation.

We have dev and prod environments. I just cloned prod into dev so ideally the two would be almost identical.

But a content creator could neither create a single activity scorm course nor a scorm activity in a course in our production environment. So I asked her to try in our dev environment. She was able to successfully create the SCORM activity/single activity course there. I was able to replicate this--could not create it in prod but could in dev.

So I looked at the files that were printed out in the error message on prod on the server--their last update date. They had not been updated on prod or dev recently. But I went ahead and copied the ones from dev to prod as dev was "working" but prod "was not working".

I still could not create the SCORM course on prod. I've cleared out the cache. I have made sure I could create another type of course with a file attachment. I have looked in the files table to see if there is a duplicate/orphaned file there of the same namae. There isn't one. I made sure that the slashes name setting was set.

The content creator said that when she originally tried to create the course it said the SCORM didn't have a manifest file. So she sent it back to the content developer to add one. She then tried again which is when she and I are now.

This is not a PHP max_upload_file error. We can upload the file and set the settings on that page. It is when we try to return to the course that it errors out and actually create the scorm by clicking the button at the bottom of the page that we get the error.

The error is :

Error writing to database

More information about this error

Debug info: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'manifest,organization,parent,identifier,launch,scormtype,title,sortorder,scorm) ' at line 1
INSERT INTO mdl_scorm_scoes (manifest,organization,parent,identifier,launch,scormtype,title,sortorder,scorm) VALUES(?,?,?,?,?,?,?,?,?)
[array (
0 => '_45YTIxIO_course_id',
1 => '',
2 => '/',
3 => 'My_Course_name',
4 => '',
5 => '',
6 => 'My_Course_name',
7 => '1',
8 => 441,
)]
Error code: dmlwriteexception
Stack trace:
line 446 of /lib/dml/moodle_database.php: dml_write_exception thrown
line 1164 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
line 1210 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
line 86 of /mod/scorm/backup/moodle2/restore_scorm_stepslib.php: call to mysqli_native_moodle_database->insert_record()
line 137 of /backup/util/plan/restore_structure_step.class.php: call to restore_scorm_activity_structure_step->process_scorm_sco()
line 103 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process()
line 178 of /backup/util/xml/parser/processors/grouped_parser_processor.class.php: call to restore_structure_parser_processor->dispatch_chunk()
line 91 of /backup/util/helper/restore_structure_parser_processor.class.php: call to grouped_parser_processor->postprocess_chunk()
line 148 of /backup/util/xml/parser/processors/simplified_parser_processor.class.php: call to restore_structure_parser_processor->postprocess_chunk()
line 92 of /backup/util/xml/parser/processors/progressive_parser_processor.class.php: call to simplified_parser_processor->process_chunk()
line 190 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser_processor->receive_chunk()
line 278 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->publish()
line ? of unknownfile: call to progressive_parser->end_tag()
line 179 of /backup/util/xml/parser/progressive_parser.class.php: call to xml_parse()
line 158 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->parse()
line 110 of /backup/util/plan/restore_structure_step.class.php: call to progressive_parser->process()
line 181 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute()
line 198 of /backup/moodle2/restore_activity_task.class.php: call to base_task->execute()
line 177 of /backup/util/plan/base_plan.class.php: call to restore_activity_task->execute()
line 167 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()
line 333 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
line 224 of /backup/util/ui/restore_ui.class.php: call to restore_controller->execute_plan()
line 111 of /backup/restore.php: call to restore_ui->execute()



Any ideas on what to look for? What to test for? What the problem would be? Thanks

Average of ratings: -
In reply to A Guy

Re: Cannot add a SCORM

by Ron Meske -
Picture of Particularly helpful Moodlers

Hello,

You said you cloned the prod site to the dev site so it would suggest we can eliminate the Moodle files themselves from the issue.  Assuming you also cloned the data from the database, given the error, I would look at:

  1. Is the database server running the same version?
  2. Is the PHP and all extensions/modules the same version?
  3. Does the database account for Moodle on both servers have the same permissions?
  4. Are the Moodle database tables on both servers using the same encoding?

Ron

In reply to Ron Meske

Re: Cannot add a SCORM

by A Guy -

Thanks, Ron, for your response. After checking none of those areas appear to be the problem.


So maybe I'm asking the question too specifically.


Is there a known reason that would cause any SCORM on any Moodle to throw that error and not create the SCORM as a single activity course or an activity inside a course?


Thanks.

In reply to A Guy

Re: Cannot add a SCORM

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

sounds like: https://tracker.moodle.org/browse/MDL-58541

(bug with AWS aurora 1.11 apparently fixed in 1.13)

In reply to Dan Marsden

Re: Cannot add a SCORM

by A Guy -

Makes sense as 1) we are using AWS and 2) our dev does not use the same database set up as our prod (we have a read/write slave/replication set up on prod now), which explains why it works on dev and not prod . So I will apply this fix and see it it works. Thanks for pointing it out.

In reply to A Guy

Re: Cannot add a SCORM

by A Guy -

Unfortunately this was not root cause/fix to our problem. I applied the patch to your production environment and it broke the system. I found a type and even corrected that to no avail.


So hopefully someone else can think of something else. Or I am going to have to take our production offline (which is not good) and do painful troubleshooting.


Thanks for all your help here.

In reply to A Guy

Re: Cannot add a SCORM

by Ken Task -
Picture of Particularly helpful Moodlers

Am confused ... you say cannot add SCORM ... don't doubt you ... but the debug output looks to be a backup of a scorm module in a course.   Is the scorm you are trying to add a compat version?  Moodle seems to be confused - does the .zip file used have a manifest file in it?   When un-zipped is that manifest file found at the root of the extracted files that comprise the scorm package?

In attempting to fix by moving files ... did you in-advertently copy files into the wrong directories?

Total guess!   But think back or look at your history if working from command line ... or anything you might have that would show you a review of what was done.

'spirit of sharing', Ken


In reply to Ken Task

Re: Cannot add a SCORM

by A Guy -

Thanks Ken. I cannot say what the process for adding a SCORM is in Moodle as I have not traced it to date. But I can say that this exact same pkg file was successfully added to our dev instance. So there must not be anything wrong with it. Our prod and dev are exactly the same except our databases. So it must be an issue somewhere in there. I will just roll up my sleeves and debug it the old fashion way today as it is Saturday and not many users are on that site. Since it is prod it has to be done today.


This company is doing something that most other companies are not--they are starting the migration away from Moodle to a fee-based system. So I cannot justify them spending money at this point in sync'ing up the dev and prod. I"m just trying to keep them limping along with until the switch over.


If I find something interesting I will report it here. Thanks for your feedback.

In reply to A Guy

Re: Cannot add a SCORM

by A Guy -

So after manually tracing the process from file to file and function to function I tried one more time to run the "problem" sql in workbench. MySQL didn't really give me a clue before. This time it said the error was "near" "manifest" in the fieldset values in the SQL. So I put the backticks on the SQL statement and it executed like the bug Dan pointed out above. So then I ran the patch itself instead of just trying to manually make the changes which "broke" Moodle. The patch failed on one point but I tried the SCORM pkg and it worked. They are going to regression test the site to make sure there are no other issues.


So thanks for this. BTW I asked AWS how much time/money it would cost to switch from Aurora to MySQL. They said there is not straightforward way to do that. That I would have to dump Aurora and then do a manual import set up into MySQL. If you went the other way (from MySQL to Aurora) there is a conversion tool to do it for you. Just FYI . . .


Thanks for all your help . . . I'm pretty sure I would have never figured out "manifest" was a reserved word in AWS Aurora DB. And if it is still a problem for us I would think the Moodle bug should be implemented. I saw it wasn't going to be because of a statement from AWS on their fix.