Error during - Common Cartridge Package Restore

Error during - Common Cartridge Package Restore

by Nilesh Shinde -
Number of replies: 14

I a trying to restore the sample Common Cartridge Package into my Moodle course. The "Restore" feature available under the "Administration" block gives the following error during the restore process.

ERROR: course_header object missing from session

Does any one have any solutions for this error. I am using Moodle version 1.9.7 for restoring the CC package.

I have also attached the screengrab of the error with this post.

Attachment Moodle-CC-Restore-Error.JPG
Average of ratings: -
In reply to Nilesh Shinde

Re: Error during - Common Cartridge Package Restore

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Nilesh,

in theory that error isn't related with IMS-CC restore at all but with restore and sessions in general.

It seems that, for some cause, your (PHP) session isn't being able to store all the needed information needed by restore in order to success. So the restore process detects something is wrong and halts at early stages. This uses to happen with "big" courses (having a lot of activities).

So. if this is your problem, basically you can try, alternatively:

1) Use file-based sessions.
2) Fix your DB-based sessions.

You can find more information about this (it's another error but caused by the same problem) at this discussion.

Ciao smile
Average of ratings: Useful (1)
In reply to Eloy Lafuente (stronk7)

Re: Error during - Common Cartridge Package Restore

by Nilesh Shinde -

Thank you so much for a quick response, i noticed that i have not enabled the "Enable CC Import" option in my moodle instance. I did that and now i am able to proceed further where i am getting another error which says - the schema is not valid.

perhaps the CC sample i have do not have a valid schema references.

Is there any online repository/site from where i can download some samples for common cartridge to test on moodle. if these are available for download, it will be of really great help.

In reply to Nilesh Shinde

Re: Error during - Common Cartridge Package Restore

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi,

just pointing you too http://test.moodle.net/imscc/
(there you will find some links and... if you find more... plz, tell me, and they will be added there)

Ciao smile
Average of ratings: Useful (1)
In reply to Eloy Lafuente (stronk7)

Re: Error during - Common Cartridge Package Restore

by Ingo Dahn -

Hi,

I get the same Schema not Valid error on our site with Cartridge 1 V1.16 of the IMS Valid Test Cartridge set V1.28. Which of the many CC profile schemas does Moodle evaluate on restore and where does it search for them?

Kind regards

Ingo

In reply to Eloy Lafuente (stronk7)

Re: Error during - Common Cartridge Package Restore

by Ingo Dahn -
Would it be possible to get access, for demonstration purposes within the European project ASPECT (http://www.aspect-project.org), to a Moodle installation where we can test import of our cartridges? On test.moodle.net/imscc my account for the Moodle forum does not seem to work.
In reply to Ingo Dahn

Re: Error during - Common Cartridge Package Restore

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Ingo,

all the ims-cc schemas are in the "backup/cc/schemas" folder under your moodle installation.

For demonstration purposes, any current Moodle 1.9.x download contains the last version of the ims-cc importer. Isn't that enough for your demos?

In any case, I'd recommend you to, also, create a new bug in the tracker, providing as much info as possible, so people in charge of the ims-cc import functionality, will be able to test/reproduce/fix any problem. If so, don't forget to cross-link between the tracker and this discussion in order to have all the key information available.

Ciao smile
Average of ratings: Useful (1)
In reply to Eloy Lafuente (stronk7)

Re: Error during - Common Cartridge Package Restore

by Ingo Dahn -
Hi, Eloy,
we have the ims-cc schemas, in fact I created them for IMS big grin. Unfortunately Moodle does not tell us which schema it has problems with. The cartridge I was using had in the manifest the schemalocation

xsi:schemaLocation="
http://www.imsglobal.org/xsd/imscc/imscp_v1p1 http://www.imsglobal.org/profile/cc/ccv1p0/derived_schema/imscp_v1p2_localised.xsd
http://ltsc.ieee.org/xsd/LOM http://www.imsglobal.org/profile/cc/ccv1p0/derived_schema/domainProfile_2/lomLoose_localised.xsd
http://ltsc.ieee.org/xsd/imscc/LOM http://www.imsglobal.org/profile/cc/ccv1p0/derived_schema/domainProfile_1/lomLoose_localised.xsd"

and I checked that all these schemas are in place (though having schemaLocations set is not a requirement for cartridges). I haven't checked which other schemas (QTI profile etc.) might be used in addition.

Yes, we have the ims-cc importer, it just doesn't work and hence is not enough for our demo.
I set a tracker issue with a link back to this discussion.
In reply to Ingo Dahn

Re: Error during - Common Cartridge Package Restore

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Thanks Ingo,

for reference, this is being handled in the Tracker at MDL-21750.

Ciao smile
In reply to Eloy Lafuente (stronk7)

Re: Error during - Common Cartridge Package Restore

by Ingo Dahn -

I got the patch from the tracker and it works! THANKS!

Just if others need to apply the same patch the following comment of our admin may be worth knowing: I had to fix the files manually because there was some error with the patch file.

Now we can successfully import cartridges and get only the warnings:

Warning: DOMDocument::schemaValidate() [function.DOMDocument-schemaValidate]: Element '{http://www.w3.org/2001/XMLSchema}import': Skipping import of schema located at 'http://www.w3.org/2001/xml.xsd' for the namespace 'http://www.w3.org/XML/1998/namespace', since this namespace was already imported with the schema located at '/localhost/home/httpdata/public_html/moodleAspect/backup/cc/schemas/xml.xsd'. in /localhost/home/httpdata/public_html/moodleAspect/backup/cc/restore_cc.php on line 70

Warning: DOMDocument::schemaValidate() [
function.DOMDocument-schemaValidate]: Element '{http://www.w3.org/2001/XMLSchema}import': Skipping import of schema located at 'http://www.w3.org/2001/xml.xsd' for the namespace 'http://www.w3.org/XML/1998/namespace', since this namespace was already imported with the schema located at '/localhost/home/httpdata/public_html/moodleAspect/backup/cc/schemas/xml.xsd'. in /localhost/home/httpdata/public_html/moodleAspect/backup/cc/restore_cc.php on line 70
Schema Valid!

In reply to Ingo Dahn

Error in intermediate file on CC restore?

by Ingo Dahn -

I get the following error when restoring in Moodle a cartridge which has successfully passed the IMS validation:

Creating groupsXML error: EntityRef: expecting ';' at line 2452

and the restore stops. The imsmanifest.xml, however, has only less than 600 lines! Can anyone give a hint how to locate the error in the cartridge?

Regards

ID

In reply to Ingo Dahn

Re: Error in intermediate file on CC restore?

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi again,

the ims-cc thing on restore uses to convert the ims-cc package into one standard moodle backup package that is restored normally.

Do the error you're seeing is in one moodle.xml file that should be under your moodledata/temp/backup/xxxxxxx (where xxxxxx) is the newer directory there.

Just try the restore again, and when you get the error, look to that line in the directory above. And tell us how it looks like.

It's strange because ims-cc packages don't have users/groups information at all, so the generated moodle.xml file should have 100% empty sections related to users and groups.

In any case, follow the steps above and feel free to paste here (or in the Tracker) the offending line.

Ciao smile
In reply to Eloy Lafuente (stronk7)

Re: Error in intermediate file on CC restore?

by Ingo Dahn -

Thanks will (let) try. We have also run the respective cartridge through an improved cartridge validator which does additional html validation to be sure that the missing ';' does not come from an html error but haven't yet analyzed the reports.

From partners who restored the same cartridge on another Moodle installation I got the following info:

We managed to solve this problem by selecting GROUPS – NO (default is YES) when selecting setting for the import. But then we got another error that we could not resolve:

* Creating new course

o Thermodynamics (T-1)

o Category: Miscellaneous

* Creating the Restorelog.html in the course backup folder

* Creating sections

* Creating categories and questions

o Category "Quiz Bank \'Temperature - Test Your Knowledge\'"

. . .

o Category "Quiz Bank \'Internal Energy - Test Your Knowledge\'"

.

o Category "Quiz Bank \'Heat - Test Your Knowledge\'"

.

o Category "Quiz Bank \'First Law - Test Your Knowledge\'"

.

o Category "Quiz Bank \'Velocity Distribution - Test Your Knowledge\'"

.

* Copying course files.

o Files/folders: 2

* Creating scalesXML error: EntityRef: expecting ';' at line 2242

Both are apparently Moodle errors in its internal files.

Hope this helps.

Ingo

In reply to Ingo Dahn

Re: Error in intermediate file on CC restore?

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Ingo,

I think we need to be able to reproduce the problem here, else it's really complex to try to "fix" anything.

As far as I've restored dozens of ims-cc packages and never have had that error, I cannot imagine any cause for it.

I think it would be 100% helpful if you could share the offending package (the original ims-cc one or the generated moodle.xml one) in some way (publicly or privately) just to be able to reproduce the problem/s.

Sure there is one bug, it's only a matter of being able to catch it wink

TIA and ciao!
In reply to Ingo Dahn

Re: Error during - Common Cartridge Package Restore

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Ingo,

regarding MDL-21750, it has already being committed to Moodle 1.9.x so will be available in next weekly build. I also have reproduced the warnings you comment and have posted about them in the Bug Tracker (it's the recommended way or the developer won't know about wink).

Ciao smile