Problem accessing dropdown such as personal profile since 3.8 (20191118) update

Problem accessing dropdown such as personal profile since 3.8 (20191118) update

by Guido Roessling -
Number of replies: 24
Picture of Plugin developers

Hi all,

I just upgraded to Moodle 3.8 (build 20191118). Now I (as the admin) and probably other users can no longer access my profile - when clicking on the link next to my name at the top right, nothing happens. (Well, a blue box is drawn around the name and triangle, but no menu pops up). The same applies when clicking on the "burger menu" - nothing happens. Also, grading a submission does not seem to work (loads endlessly).

I tested this on my main computer (macOS, Safari + Firefox + Chrome) and Windows 10 (in a VM, Firefox + Edge), so I assume that this is a general issue. I have no idea what the reason might be, and debugging also does not show anything helpful.

It does show in the server logs that a file is missing (as below), and hints on what can be done to fix this would also be appreciated (the file actually exists in the top directory).

2019/11/17 13:03:59 [error] 10005#10005: *28511404 FastCGI sent in stderr: "PHP message: Default exception handler: File not found. Debug: 

Error code: filenotfound

* line 494 of /lib/setuplib.php: moodle_exception thrown

* line 2074 of /lib/filelib.php: call to print_error()

* line 96 of /admin/lib.php: call to send_file_not_found()

* line 5009 of /lib/filelib.php: call to core_admin_pluginfile()

* line 44 of /pluginfile.php: call to file_pluginfile()" while reading response header from upstream, client: 213.152.161.74, server: moodle.informatik.tu-darmstadt.de, request: "GET /pluginfile.php/1/core_admin/logo/0x200/1573991495https%3A//moodle[...]/apple-touch-icon.png HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.3-fpm.sock:", host: "moodle.[...]", referrer: "https://moodle.[...]/login/index.php"

Thank you in advance for all helpful hints or insights!
Attachment Screenshot_17_11_19__13_05.png
Average of ratings: -
In reply to Guido Roessling

Re: Problem accessing dropdown such as personal profile since 3.8 (20191118) update

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Which version did you upgrade from? How did you upgrade? What are you running moodle on? Your own server? Hosted? Linux? Windows? Did you perform any php upgrades? Sounds more like a server issue but you could start by redownloading the moodle code to check that something did not corrupt during the original upgrade.
In reply to Emma Richardson

Re: Problem accessing dropdown such as personal profile since 3.8 (20191118) update

by Guido Roessling -
Picture of Plugin developers
It's on a virtual machine hosted by our department running Linux/nginx. There were no PHP upgrades and Moodle worked fine just before the upgrade.
I moved the original 3.7.3 version out of the way (in a different directly) and used git (branch/checkout/pull) to get the 3.8 sources, then ran upgrade and moved all additional plugins from the 3.7.3+ version back into place.
When I hover the mouse over the user menu, the link displayed at the bottom of the page is only "https://moodle...../#", which may be correct as this is only supposed to show a dropdown.
EDIT: "git diff" also shows no differences between "my" version and the official sources.
In reply to Guido Roessling

Re: Problem accessing dropdown such as personal profile since 3.8 (20191118) update

by Guido Roessling -
Picture of Plugin developers
Thanks - whatever the problem was, a complete uninstall/reinstall from git seems to have resolved it.
In reply to Guido Roessling

Re: Problem accessing dropdown such as personal profile since 3.8 (20191118) update

by Guido Roessling -
Picture of Plugin developers
The culprit seems to be mod_groupformation. Once I reinstall the plugin (copy the resources from an archive and run "upgrade.php", the dropdowns etc. are broken. If I remove it again (uninstall + upgrade.php), everything is back in order, so it must somehow be that plugin's fault.
I am sorry but I was not able to debug the reason behind this...
Average of ratings: Useful (2)
In reply to Guido Roessling

Re: Problem accessing dropdown such as personal profile since 3.8 (20191118) update

by Madhu Avasarala -

Hi, I am having a similar problem. Just upgraded from 3.7.3+ to 3.8 on Boost theme on 18.04 Ubuntu Linux and php 7.2

After upgrade, many of the menu's are not working as for example the user profile drop-down, Site-admin's secondary menus such as users, courses, etc.

The only group plugin I am using is mod_grouptool. I uninstalled this in the 3.7.3+ version and switched theme to classic and retried the upgrade with exact same type results. I hand purged cache for good measure. I do not get any error messages with debug set to developer.

I notice that the URL becomes https://rahilmahmood.com/moodle/admin/search.php#linkusers even when I try to click the various menus on the site-admin page. So this is a problem! When I replace the url with /admin/users.php it goes to the correct admin users page.

In reply to Madhu Avasarala

Re: Problem accessing dropdown such as personal profile since 3.8 (20191118) update

by Guido Roessling -
Picture of Plugin developers
We have mod_grouptool installed without a problem, so I do not think that this is causing the problem.
What worked for me (but took a lot of time) was to move the installation into a different directory; install a clean version (with git pull) and add the config file, and then add one file + run "upgrade.php" and check if the menus were still working, and then repeat this for the next plugin. That was how I found our culprit. I also had the problem that there were no meaningful (or any) error messages when the plugin was installed.
The good news (I guess) was that if I uninstalled the problematic plugin (and ran upgrade.php), everything worked fine, so I did not have to "start from scratch".
In reply to Madhu Avasarala

Re: Problem accessing dropdown such as personal profile since 3.8 (20191118) update

by Martin Meadows -
Madhu,

I'm having the same problems on a git upgrade from 3.7.3+ to 3.8. My server is a CentOS 7.7.1908 installation running php 7.4. I have the theme set as the default Boost and notice the same #link* phenomenon as you mention. Using the search takes me to where I wish to go, but other things such as what Guido mention don't work either: the left-side menu drawer, personal profile, etc. I've tried in various browsers (Safari, Chrome & Firefox), but the problem persists.

I have debugging set to "Developer" and sending error messages to HTML and have been getting the following error messages:

Notice: Trying to access array offset on value of type null in /var/www/html/moodle/lib/mustache/src/Mustache/Parser.php on line 278

In reply to Guido Roessling

Re: Problem accessing dropdown such as personal profile since 3.8 (20191118) update

by Michael Hawkins -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Testers
Hi all,

We have looked into this today and performed various testing scenarios (with both upgrading and with/without the mentioned plugins). These issues don't relate to performing the upgrade itself, but rather existing JavaScript issues within one or more third party plugins are surfacing when those plugins are installed with Moodle 3.8.

In the case of mod_groupformation, the key error is that some JavaScript is not being defined correctly, which is causing an error that prevents other JavaScript executing on the page, such as that which switches between the site admin tabs. I will attempt to contact the plugin maintainer for that plugin today and let them know about the issue (it is also worth mentioning that plugin has not been updated since Moodle 3.5).

For Madhu and others experiencing this issue who do not have mod_groupformation installed, I would suggest some other installed plugin is likely not following the current JS guidelines, and triggering a similar bug. I did also test mod_grouptool, which seemed fine and did not cause the same issue. If you are able to identify the culprit(s), the best course of action would be to contact the relevant plugin maintainer, so they are hopefully able to address the issue and publish a compatible version.

Regarding the search.php URLs ending in #linkusers, #linkcourses etc, those are correct on the relevant admin section, and have just been updated in that way to allow refreshing/navigating back in your browser to that admin page to retain the correct visible section on the page, rather than defaulting back to the base "site administration" tab.

I hope that information is helpful, and you're able to find any remaining sources of the issue soon!

Mick
Average of ratings: Useful (4)
In reply to Michael Hawkins

Re: Problem accessing dropdown such as personal profile since 3.8 (20191118) update

by Guido Roessling -
Picture of Plugin developers
Thank you for your reply and the analysis, Mick!
My Moodle (and especially JavaScript) skills were only sufficient to pinpoint the culprit (in my case), but not to analyse the reason behind this. As such, could you give a link to information on how one can tell whether "some JavaScript is not being defined correctly"? That is, are there some "telltale sign" or other indications that would let users tell if the JavaScript in plugin X should be OK or might be the case of error?
Best regards,

Guido
In reply to Guido Roessling

Re: Problem accessing dropdown such as personal profile since 3.8 (20191118) update

by Michael Hawkins -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Testers
Hi Guido,

Not a problem! It's a tricky one to answer, because there could be many different causes. In general, checking the browser console for any errors is a good place to start, then following those to determine the source (and if you can/need to, analysing that to determine why it's an issue). In this case, following the error in the browser console led to a JavaScript file which was calling a function immediately after it was initialised, rather than just defining it for later use in the correct place (there is an example of how it should have been defined in the JavaScript modules docs). We were able to confirm that was the issue by updating the code locally, then confirming the issues on the page were fixed. A slightly less complicated way  to confirm the suspected file was the culprit, particularly since the file was minified (not easily human readable), was to first identify the suspected cause, then simply remove that JavaScript from the file briefly, and confirm that also stopped the bug appearing on the page.

Note: We were testing and modifying code on local development servers, and I'd advise only modifying files to troubleshoot issues such as this in a non-production  environment, so live users aren't affected and to avoid risking any other damage/data loss of production data. In the upgrade overview docs, we recommend performing a test upgrade on a copy of your site before going ahead with upgrading your main site (in case any issues arise), so using that separate copy of your site could also be an option (assuming it does not modify production data).
In reply to Michael Hawkins

Re: Problem accessing dropdown such as personal profile since 3.8 (20191118) update

by Madhu Avasarala -
Just an added note on this issue: When the cachejs is set to No in the admin settings then the problem goes away completely.
Average of ratings: Useful (2)
In reply to Madhu Avasarala

Re: Problem accessing dropdown such as personal profile since 3.8 (20191118) update

by Martin Meadows -
Thanks Madhu, for this tip. After struggling with this for the past two weeks, deleting plugins and downgrading php from 7.4 to 7.3, I turned off the cachejs and, hallelujah!, my dropdown menus started working again.

BUT, is this an ideal solution? The default is to have this turned on for improved page loading performance. Won't having it turned off make our installations more sluggish?
Average of ratings: Useful (1)
In reply to Martin Meadows

Re: Problem accessing dropdown such as personal profile since 3.8 (20191118) update

by Michael Hawkins -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Testers
Hi Martin,

Does the problem return if you re-enable cachejs? I'm wondering whether the issue was that your JS cache needed purging or something along those lines.
Average of ratings: Useful (1)
In reply to Michael Hawkins

Re: Problem accessing dropdown such as personal profile since 3.8 (20191118) update

by Martin Meadows -

Hi Michael, 

Yes, the problem returns as soon as I re-enable cachejs. I've been upgrading/downgrading between 3.7 and 3.8 branches, deleting additional plugins both pre and post upgrade to try to find the source of the problem. After every deletion of a plugin, I purge all caches, but the issue remains. 

This is mostly a test site, but there is one course that is in use and a couple from which I need to extract important data. I have whittled things down to Questionnaire, Reader and the Poodll suite of plugins but these are, for me, essentials and I'm not ready to delete them just yet. 

****************************
<git status> says:

Your branch is up to date with 'origin/MOODLE_38_STABLE'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)

blocks/glossary_export_to_quiz/
blocks/readerview/
filter/generico/
filter/poodll/
filter/videoeasy/
lib/editor/atto/plugins/cloudpoodll/
lib/editor/atto/plugins/generico/
lib/editor/atto/plugins/poodll/
lib/editor/tinymce/plugins/poodll/
mod/assign/feedback/poodll/
mod/assign/submission/onlinepoodll/
mod/assignment/type/poodllonline/
mod/data/field/poodll/
mod/hvp/
mod/questionnaire/
mod/readaloud/
mod/reader/
php_errors.log
question/type/cloudpoodll/
question/type/essayautograde/
question/type/gapfill/
question/type/ordering/
question/type/poodllrecording/
repository/poodll/
theme/fordson/

***********************

MY THOUGHTS:

  • I have reader running without problems on a different 3.8 installation. 
  • fordson and glossary_export_to_quiz are 3.8 release versions so should be OK
  • the poodll/generico suite of plugins are working fine on Poodll-Creator Justin Hunt's 3.8 test site. He also has admin access to my site but didn't find anything to suggest where the problem lies ...
  • I can't delete questionnaire yet to see if it might be the cause, but it tends to be a well-maintained plugin ....


So, that's where I am. I need to find a creative new perspective.    


In reply to Martin Meadows

Re: Problem accessing dropdown such as personal profile since 3.8 (20191118) update

by Guido Roessling -
Picture of Plugin developers
Note: you do not really have to delete the plugins per se, as in "purge the database of all files". What I did instead was "move them out of the way" and check if the problems persisted when they were gone (but still had all their data in the database), and if the problem re-appeared after moving the sources back to the right spot and running upgrade. (I think running upgrade is not necessarily).
This will take you a few minutes, but you should be able to pinpoint the problem more easily, and not risk "losing questionnaires" (although they will be unavailable or shown an error if somebody accesses them while you work on it).
We have Fordson and questionnaire installation without problem, so I assume that those are not the problematic plugins.
Average of ratings: Useful (1)
In reply to Martin Meadows

Re: Problem accessing dropdown such as personal profile since 3.8 (20191118) update

by Adam Jenkins -
Picture of Plugin developers

I have been able to replicate this issue as well (it wasn't difficult).

There also exists a tracker item for this: https://tracker.moodle.org/browse/MDL-67358

I'll try to post more when I know more, but for the moment, it appears to happen with a variety of plugins and at different levels. For example a block will affect a dashboard page with that block on it more than say a quiz question type. (which is logical).

Average of ratings: Useful (2)
In reply to Michael Hawkins

Re: Problem accessing dropdown such as personal profile since 3.8 (20191118) update

by Madhu Avasarala -
Hello Micahel,
Thanks for your insightful explanation. I turned on the console and could see some errors in javascript. After uninstalling the extremely important plugin block_configurable_reports, the problem completely disappeared. So in my case it was this plugin causing some issues. I shall post a bug report on the tracker of that plugin but if you have some influence on that plugin development team I would be grateful if you can exercise it since this plugin is as important as the core. Thanks.
Average of ratings: Useful (1)
In reply to Madhu Avasarala

Re: Problem accessing dropdown such as personal profile since 3.8 (20191118) update

by Michael Hawkins -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Testers
No worries, thanks Madhu. That plugin appears to be maintained by some HQ developers, so I will follow up with them to ensure they have seen your report in Tracker.
In reply to Michael Hawkins

Ri: Re: Problem accessing dropdown since 3.8 (20191118) update

by Davide Rossi -

Hi all,

I just upgraded to Moodle 3.8+ (Build: 20191122).

Dropdown menu no longer work when I turn editing on.

In my case Collapsed Topics seems causing some issues, but I am not sure because
at the moment the problem is unclear and not constant.

Thank you in advance

In reply to Davide Rossi

Re: Ri: Re: Problem accessing dropdown since 3.8 (20191118) update

by Guido Roessling -
Picture of Plugin developers

Hi Davide,

please see the post by Michael Hawkins above (https://moodle.org/mod/forum/discuss.php?d=393570#p1587351 for some information on how to find out what the troublesome plugin is. I do not recommend "my approach" unless you cannot find a better way to get this figured out...

In our case, the plugin used an incorrect access to tether (amd/src/tether.js in this case), although tether was already provided by theme/boost/amd/src/tether.js. If you have ssh access to your system (and assuming it is Linux-based), you may want to run this command: find . -name tether.js (in the Moodle installation directory) and look for where tether.js is used besides theme/boost/amd/src/tether.js . Those plugins would then go on my list of monitoring if they are the culprit; in my case, I moved them out of the Moodle file system (do not do a "real delete", as this will also delete all DB records....), ran upgrade to be on the safe side, and checked if the system now worked.

Best regards and good luck,

Guido

In reply to Guido Roessling

Ri: Re: Ri: Re: Problem accessing dropdown since 3.8 (20191118) update

by Davide Rossi -
Thanks Guido for the answer.
I searched tether.js. The only occurrence is in the theme Boost.
I checked the browser console for any errors and I founded an error with responsivevoice.js, a Text-to-Speech code.
For now I deleted it (even though it was very useful in my courses) and everything seem to work.
Thanks again,
Davide
In reply to Davide Rossi

Re: Ri: Re: Ri: Re: Problem accessing dropdown since 3.8 (20191118) update

by Guido Roessling -
Picture of Plugin developers
I am glad I could help a bit, even if the plugin in your case was something different...
Best regards,

Guido
In reply to Guido Roessling

Re: Problem accessing dropdown such as personal profile since 3.8 (20191118) update

by Adam Jenkins -
Picture of Plugin developers
Just as a final follow up to this thread, the issue ( https://tracker.moodle.org/browse/MDL-67327 ) addresses this issue and has now been fixed. This is an interesting fix, as the fix doesn't actually fix the cause. Some plugins would do this:

define(function() {
//
});
Where they actually should do the following:

define([], function() {
//
});

The fix that has been implemented makes Moodle more tolerant of such plugins.
Average of ratings: Useful (2)