Interactive Video (1.21.8) not working after Upgrade to 3.7.4

Interactive Video (1.21.8) not working after Upgrade to 3.7.4

by Thorsten Bartel -
Number of replies: 5
Picture of Core developers

We've made a recent upgrade from Moodle 3.4 to Moodle 3.7 and found that all H5P content of type "Interactive Video" stopped working. When attempting to view or edit any H5P interactive video on our Moodle site, we simply get a timeout resulting in bad session locks.

I'll list all the relevant specs and changes I can think of:

New Moodle version: 3.7.4
Change of $CFG->cachedir and $CFG->localcachedir
Content Type library updated from 1.21.2 to 1.21.8
Servers (both production and test) are running memcached for sessions
H5P version is 1.20.2 on both servers
Directory permissions are identical on both servers (777 for moodledata and separate cache dirs)

I've tried to replicate the issue on our test system and was successfull in doing so by simply moving said cache directories to their default location (in moodledata) and back (to their custom directory). That was enough.

Strangely enough, on our test system, I have been able to remedy the situation by simply deleting "cache", "localcache", "sessions", "temp" and "trashdir" (in both paths where applicable). On production, this doesn't seem enough. Only two differences between the systems:
1) Production has internet access and thus
2) Production has more current plugin and content type versions (see 1.21.2 vs. 1.21.8 above)

I'm at an absolute loss. PHP Debugging on max level is not helpful:
"session_start(): Unable to clear session lock record"

I'm hesitant to start playing around with session handler, etc.
My best guess is some interaction between H5P and the moodle cache. But not sure, how exactly... and even less what I could do about it.

Average of ratings: -
In reply to Thorsten Bartel

Re: Interactive Video (1.21.8) not working after Upgrade to 3.7.4

by Stuart Mealor -
What happened when you originally tested this upgrade ?
I mean, you must have tested the upgrade procedure before moving a production site from Moodle 3.4 to 3.7.4 right ?
Presume no-one noticed this content type not working ?
Soooo
What happens if you add a NEW H5P interactive video to your site now ?
Does that work ?
Does every other type of H5P content work correctly ?
In reply to Stuart Mealor

Re: Interactive Video (1.21.8) not working after Upgrade to 3.7.4

by Thorsten Bartel -
Picture of Core developers
Thanks for your reply, Stuart. I'll try to answer your questions as best as I can.

When originally testing this upgrade, everything seemed fine. I needed to take some additional steps to reproduce the problem on the test system in the first place: Moving around the cache & localcache folders. It might be worth noting that these changes (moving cache & localcache to more performant storage) were the only changes not tested in detail on the test system. (i.e. we checked whether the whole system would work with these changes, but not every single activity)

We can add new H5P content, including interactive videos. That seems to work.
We also do have *some* existing interactive videos that work. There does not seem to be a predictable pattern which work and which don't, though the majority fails to load.

Other H5P content seems to work just fine.

I'm planning to stop the production server completely for a short period of time tomorrow morning, allowing me to clean all moodledata directories I think might be involved: cache, localcache, lock, temp, trashdir
Might it be worth a shot to add the "muc"-folder to this list?
In reply to Thorsten Bartel

Re: Interactive Video (1.21.8) not working after Upgrade to 3.7.4

by Thorsten Bartel -
Picture of Core developers
Tried everything mentioned.
Switched cache directories back to standard.
Emptied caches and other related directories.
Changed session handler back to file sessions.
Finally rebooted the server.

Sadly, no change in behaviour. Next, we're going to give our test system an internet connection so we can update the H5P libraries to the same versions as we have on production. See if that makes the problem occur in the same stubborn way. -.-'
In reply to Thorsten Bartel

Re: Interactive Video (1.21.8) not working after Upgrade to 3.7.4

by Stuart Mealor -
Well, if the problem is cache related (and it doesn't sounds like it's version issue as new content is adding OK), then it's worth clearing all caches.
But if you have a proxy or other similar service as well that could be involved?
In reply to Stuart Mealor

Re: Interactive Video (1.21.8) not working after Upgrade to 3.7.4

by Thorsten Bartel -
Picture of Core developers
Hello again, Stuart!

We finally managed to resolve the problem. Our developer spent about his whole afternoon debugging and finally spotted the issue:
In our php.ini, the value for "max_execution_time" was way too short, leading to writing processes to /temp being disrupted. Sessions were also corrupted within the process. After raising this value from about 30s to 300s, everything works fine.

Cheers and thanks again for your time and insights
Average of ratings: Useful (1)