Moodle - Content Types Updates Available, but not Installing

Hi,

Moodle 3.5.3+, just updated to the latest version of the H5P plugin, which was slightly problematic as I had to manually create the add_to column in the mdl_hvp_libraries table of the database. But the upgrade went fine. However, serveral of the Content Tupes are showing that upgrades are available, but they're not installing.

Process:

1) Click on Details -> Update

2) System thinks for a few seconds

3) Returns me to the 'Add a New Interactive Content' page which now has no H5P visible

I have tried reconnecting to the Hub and clearing caches.

Has anyone else experienced this?

Many thanks in advance.

Gavin

 

BV52's picture

Hi Gavin,

Have you tried uploading a sample content? If this works this is another way of updating the contents you can start with Column, Course Presentation and Quiz (Question Set).

If this does not resolve an issue or throws an error message, please include the following information:

  1. Detailed steps to reproduce the bug (exactly how and when did it happen): Stated above
  2. Platform and version number. Moodle 3.5.3+
  3. Mobile or Desktop
  4. Browser: Chrome, Firefox, Safari etc
  5. H5P plugin version
  6. H5P content type and version (if a content type was used), and a sample URL or attached H5P.
  7. Any browser console errors
  8. Any PHP errors
  9. Screenshots if it's a visual problem

The more information you provide, the quicker the community will be able to fix it and the quicker you'll have a working solution!

Hi,

Firstly, thank you for your help so far

I tried uploading the Column example. I tlooked like it was doing something, but then stopped - see screenshot from after it stopped.

3. Desktop

4. Chrome (up-to-date

5. H5P 1.12

6 - Various content types won't update

7. TypeError: Cannot read property 'libraries' of undefined

    at t.<anonymous> (h5p-hub-client.js?ver=2018110600:24)

    at Z (h5p-hub-client.js?ver=2018110600:17)

    at beginUpdateQueue (h5p-hub-client.js?ver=2018110600:17)

    at updateClassInstance (h5p-hub-client.js?ver=2018110600:17)

    at beginWork (h5p-hub-client.js?ver=2018110600:17)

    at a (h5p-hub-client.js?ver=2018110600:17)

    at s (h5p-hub-client.js?ver=2018110600:17)

    at c (h5p-hub-client.js?ver=2018110600:17)

    at y (h5p-hub-client.js?ver=2018110600:17)

    at h (h5p-hub-client.js?ver=2018110600:17)

8. Nothing in the logs

Best,

Gavin

thomasmars's picture

Hi Gavin,
Looks like libraries are not being found. Can you check in your browser console for 'content-type-cache' request, should look something like this: http://example.com/mod/hvp/ajax.php?contextId=1&token=xyz&action=content-type-cache, and check what your response is. The request is run when you open the H5P editor.
You can also try to go into the "H5P Libraries" page in your Moodle plugin administration and click the "Update content type cach", then try again. Let us know what the response of the request is there and we should be able to help you further.

Thomas,

Thanks for your cintinued help. I see nothing in the console when I open the editor. If I try to update a content type which as updates, I see the following:

h5p-hub-client.js?ver=2018110600:17 TypeError: Cannot read property 'libraries' of undefined

    at t.<anonymous> (h5p-hub-client.js?ver=2018110600:24)

    at Z (h5p-hub-client.js?ver=2018110600:17)

    at beginUpdateQueue (h5p-hub-client.js?ver=2018110600:17)

    at updateClassInstance (h5p-hub-client.js?ver=2018110600:17)

    at beginWork (h5p-hub-client.js?ver=2018110600:17)

    at a (h5p-hub-client.js?ver=2018110600:17)

    at s (h5p-hub-client.js?ver=2018110600:17)

    at c (h5p-hub-client.js?ver=2018110600:17)

    at y (h5p-hub-client.js?ver=2018110600:17)

    at h (h5p-hub-client.js?ver=2018110600:17)

I did try the "update content type cache' but I don't think it did anything.

Best,

Gavin

thomasmars's picture

Hi, you have to look the network tab of your developer tools to find the request I pointed out.
Reference: https://developers.google.com/web/tools/chrome-devtools/network-performance/reference, when you find the request, you have to click it and then go to its response to see what comes out of it.

This is what I get:

[{"name":"H5P.Accordion","title":"Accordion","majorversion":"1","minorversion":"0","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.Agamotto","title":"Agamotto","majorversion":"1","minorversion":"3","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.AppearIn","title":"appear.in for Chat and Talk","majorversion":"1","minorversion":"0","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.ArithmeticQuiz","title":"Arithmetic Quiz","majorversion":"1","minorversion":"1","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.Audio","title":"Audio","majorversion":"1","minorversion":"2","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.AudioRecorder","title":"Audio Recorder","majorversion":"1","minorversion":"0","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.Chart","title":"Chart","majorversion":"1","minorversion":"2","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.Collage","title":"Collage","majorversion":"0","minorversion":"3","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.Column","title":"Column","majorversion":"1","minorversion":"7","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.CoursePresentation","title":"Course Presentation","majorversion":"1","minorversion":"19","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.Dialogcards","title":"Dialog Cards","majorversion":"1","minorversion":"6","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.DocumentationTool","title":"Documentation Tool","majorversion":"1","minorversion":"6","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.DragQuestion","title":"Drag and Drop","majorversion":"1","minorversion":"12","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.DragText","title":"Drag Text","majorversion":"1","minorversion":"7","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.Essay","title":"Essay","majorversion":"1","minorversion":"0","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.Blanks","title":"Fill in the Blanks","majorversion":"1","minorversion":"10","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.ImageMultipleHotspotQuestion","title":"Find Multiple Hotspots","majorversion":"1","minorversion":"0","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.ImageHotspotQuestion","title":"Find the Hotspot","majorversion":"1","minorversion":"7","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.Flashcards","title":"Flashcards","majorversion":"1","minorversion":"5","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.GuessTheAnswer","title":"Guess the Answer","majorversion":"1","minorversion":"3","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.IFrameEmbed","title":"Iframe Embedder","majorversion":"1","minorversion":"0","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.ImageHotspots","title":"Image Hotspots","majorversion":"1","minorversion":"6","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.ImageJuxtaposition","title":"Image Juxtaposition","majorversion":"1","minorversion":"1","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.ImagePair","title":"Image Pair","majorversion":"1","minorversion":"4","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.ImageSequencing","title":"Image Sequencing","majorversion":"1","minorversion":"0","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.ImageSlider","title":"Image Slider","majorversion":"1","minorversion":"0","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.InteractiveVideo","title":"Interactive Video","majorversion":"1","minorversion":"19","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.MarkTheWords","title":"Mark the Words","majorversion":"1","minorversion":"8","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.MemoryGame","title":"Memory Game","majorversion":"1","minorversion":"2","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.MultiChoice","title":"Multiple Choice","majorversion":"1","minorversion":"12","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.PersonalityQuiz","title":"Personality Quiz","majorversion":"1","minorversion":"0","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.QuestionSet","title":"Question Set","majorversion":"1","minorversion":"15","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.Questionnaire","title":"Questionnaire","majorversion":"1","minorversion":"2","tutorialurl":null,"restricted":true,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.SingleChoiceSet","title":"Single Choice Set","majorversion":"1","minorversion":"10","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.Summary","title":"Summary","majorversion":"1","minorversion":"9","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.Timeline","title":"Timeline","majorversion":"1","minorversion":"1","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.TrueFalse","title":"True\/False Question","majorversion":"1","minorversion":"4","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0},{"name":"H5P.TwitterUserFeed","title":"Twitter User Feed","majorversion":"1","minorversion":"0","tutorialurl":null,"restricted":false,"metadatasettings":null,"metadataSettings":null,"majorVersion":0,"minorVersion":0}]
thomasmars's picture

Are you sure this is from the "action=content-type-cache" endpoint ?
The response should be in the following format:

{
"outdated":false,
"libraries": 
 [{"id":79,"machineName":"H5P.Accordion","majorVersion":1,
 "minorVersion":0,"patchVersion":18,"h5pMajorVersion":1,
  "h5pMinorVersion":5,"title":"Accordion", ...},...],
"recentlyUsed": ["H5P.MarkTheWords","H5P.InteractiveVideo","H5P.MultiChoice"],
"apiVersion":{"major":1,"minor":19},
"details":[]
}

Please also check which version of the H5P plugin you have in your plugins overview: https://docs.moodle.org/35/en/Installing_plugins#Plugins_overview

Thomas,

I hope the attached is what you're looking for (I've changed the server URL, for security reasons. The plugin is updated this morning, but I still can't update libraries.

Best,

Gavin

Attachments: 
thomasmars's picture

Hi Gavin,
The output there looks fine. A few more questions:
1) What library were you trying to update when this happens ?
2) Were you able to update any libraries before this started happening ?

Please enable debugging for Moodle (https://docs.moodle.org/35/en/Debugging).
Then try to update a content type again through the content type hub.

3) Are you seeing any PHP errors now ?
4) And what is the response from the "install-libraries" endpoint ? should look something like this: "
http://example.com/mod/hvp/ajax.php?contextId=x&token=y&action=library-install&id=H5P.Column"

I think we may be getting somewhere:

  1. There are currently around 7 which have updates available - they all fail in the same manner
  2. No
  3. No errors shown - though there should have been because:
  4. {"error":"Error writing to database","errorcode":"dmlwriteexception","stacktrace":null,"debuginfo":null,"reproductionlink":null}

So it would appear there's an issue there. Moodle itself is working fine, so the permissions, etc., I think are not an issue.

You may recall right up the top of this thread I had to manually create a column when I did the last upgrade (Moodle 3.5.3+, just updated to the latest version of the H5P plugin, which was slightly problematic as I had to manually create the add_to column in the mdl_hvp_libraries table of the database).

I updated H5P itself yesterday, so clearly the system is msotly fine, but something is not right. does this get us any further?

Gavin

 

thomasmars's picture

Hi Gavin,
For some reason it seems like your site is not reporting the php errors it is getting, or you're not looking in the correct place for the php errors.
https://docs.moodle.org/35/en/error/moodle/dmlwriteexception suggests that you should be able to retrieve more detailed information about what the problem is by turning on debugging in Moodle: https://docs.moodle.org/35/en/Debugging. Please try to follow this guide tediously to enable "DEVELOPER" debugging.
Also check your php.ini file for where the php error log is being stored, this guide should get you in the right direction: https://docs.moodle.org/dev/PHP_error_logs.

Hi,

Log files are empty, I'll need to contact the hosting company. In the meantime, I'm wondering if removing the plugin and reinstalling would help? What happens to h5p activities if I delete then reinstall - do they remain in courses, or do they disappear completely?

Gavin

BV52's picture

Hi Gavin,

Removing the plugin will also remove all contents created not unless you back them up by downloading them as H5P files.

-BV52