Exception - Unexpected closing tag when updating 3.8.1 to 3.8.2+

Exception - Unexpected closing tag when updating 3.8.1 to 3.8.2+

by Renan COLLIN -
Number of replies: 13

Hello,

I need some help as I can not find clues to solve my problem.

I have received notifications about updating my moodle site from 3.8.1 which works well to 3.8.2+.

So I have followed the update page but encountered many problems.

I tried the classic theme and to desactivate the plugins without any improvements.

I always have the following message : Exception - Unexpected closing tag in /js ou /action....

So the update process has shown some warnings/errors when the debugging was activated :

Class coursecat is now alias to autoloaded class core_course_category, course_in_list is an alias to core_course_list_element. Class coursecat_sortable_records is deprecated without replacement. Do not include coursecatlib.php

    line 31 of /lib/coursecatlib.php: call to debugging()
    line 27 of /blocks/featuredcourses/block_featuredcourses.php: call to require_once()
    line 2019 of /lib/blocklib.php: call to include_once()
    line 1981 of /lib/blocklib.php: call to block_load_class()
    line 90 of /lib/classes/plugininfo/block.php: call to block_instance()
    line 81 of /admin/settings/plugins.php: call to core\plugininfo\block->load_settings()
    line 8385 of /lib/adminlib.php: call to require()
    line 819 of /admin/index.php: call to admin_get_root()

Exception - Unexpected closing tag: /js on line 27
Debug info:
Error code: generalexceptionmessage
Stack trace:

    line 115 of /lib/mustache/src/Mustache/Parser.php: Mustache_Exception_SyntaxException thrown
    line 43 of /lib/mustache/src/Mustache/Parser.php: call to Mustache_Parser->buildTree()
    line 783 of /lib/mustache/src/Mustache/Engine.php: call to Mustache_Parser->parse()
    line 808 of /lib/mustache/src/Mustache/Engine.php: call to Mustache_Engine->parse()
    line 738 of /lib/mustache/src/Mustache/Engine.php: call to Mustache_Engine->compile()
    line 657 of /lib/mustache/src/Mustache/Engine.php: call to Mustache_Engine->loadSource()
    line 188 of /lib/outputrenderers.php: call to Mustache_Engine->loadTemplate()
    line 69 of /message/output/popup/lib.php: call to renderer_base->render_from_template()
    line 3250 of /lib/outputrenderers.php: call to message_popup_render_navbar_output()
    line 219 of /lib/mustache/src/Mustache/Context.php: call to core_renderer->navbar_plugin_output()
    line 138 of /lib/mustache/src/Mustache/Context.php: call to Mustache_Context->findVariableInStack()
    line 80 of /moodledata/localcache/mustache/1586583194/classic/__Mustache_c3dc162d7a9c84bf327839748c324a4d.php: call to Mustache_Context->findDot()
    line 36 of /moodledata/localcache/mustache/1586583194/classic/__Mustache_62664e99c8ececa85c4d2ed4c0168cfa.php: call to __Mustache_c3dc162d7a9c84bf327839748c324a4d->renderInternal()
    line 67 of /lib/mustache/src/Mustache/Template.php: call to __Mustache_62664e99c8ececa85c4d2ed4c0168cfa->renderInternal()
    line 195 of /lib/outputrenderers.php: call to Mustache_Template->render()
    line 44 of /theme/classic/layout/columns.php: call to renderer_base->render_from_template()
    line 1374 of /lib/outputrenderers.php: call to include()
    line 1304 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
    line 498 of /lib/outputrenderers.php: call to core_renderer->header()
    line 296 of /admin/renderer.php: call to plugin_renderer_base->__call()
    line 905 of /admin/index.php: call to core_admin_renderer->admin_notifications_page()

I had modified the footer code on academi theme but as I tried with the classic theme, there is the same error as you can see....

Anyone has seen this error when updating moodle 3.8.2+ ?

I have not found any more information in the log server that would be useful...

best regards

Renan Collin

Average of ratings: -
In reply to Renan COLLIN

Re: Exception - Unexpected closing tag when updating 3.8.1 to 3.8.2+

by Renan COLLIN -
I have just succeded in updating the available plugins so the problem seems to come from the Moodle Core Update from 3.8.1 to 3.8.2+. Gonna backup and try more further. I hope to read from someone soon...
Best regards.
In reply to Renan COLLIN

Re: Exception - Unexpected closing tag when updating 3.8.1 to 3.8.2+

by Ken Task -
Picture of Particularly helpful Moodlers

From your debug ... points to a block:
/blocks/featuredcourses/block_featuredcourses.php

https://moodle.org/plugins/block_featuredcourses

According to the plugins page link above supposed to be compatible with 3.8 ... but wonder about 3.8.2+ compat.

Since it's not a core block, more of providing a view of courses on front page, etc. ... consider removing it to see if your errors go away.  Could re-install it later.

There was also a reference to this:

/moodledata/localcache/mustache/1586583194/

Themes are cached ... suggest you also remove manually contents of your moodledata/localcache/  Safe to do as Moodle code will repopulate as needed.

Didn't think moodle 3.8 themes are based on mustache but boost now.

Best guess at this point!

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: Exception - Unexpected closing tag when updating 3.8.1 to 3.8.2+

by Renan COLLIN -
Thanks a lot Ken smile
Gonna try to desactivate that featured courses plugin.... I did not see it so that can be a good option to test. I knew that some plugin could create compatibility but really thanks to have seen this.
And secondly, effectively, I did not purge the cache, maybe I was not sure to do this but with your advice, I will do it and make you know if this can help.
Best regards.
Renan
In reply to Renan COLLIN

Re: Exception - Unexpected closing tag when updating 3.8.1 to 3.8.2+

by Renan COLLIN -
Hello Ken,

after desactivating the featured courses plugin which is not part of the moodle core files and purging moodledata/localcache plus theme classic to be sure, the update was achieved without any big problem.
The only one is the log concerning Class coursecat is now alias to autoloaded class core_course_category, course_in_list is an alias to core_course_list_element. Class coursecat_sortable_records is deprecated without replacement. Do not include coursecatlib.php.
Where do I have not to include coursecatlib.php ? as the log says ?

Gonna tell Daniel for the featured course with which I have already exchanged about debugging paypal availability too.

Thanks again for your help Ken, another eye is always good when we are focussing too much on some points....

Best regards
Renan
In reply to Renan COLLIN

Re: Exception - Unexpected closing tag when updating 3.8.1 to 3.8.2+

by Ken Task -
Picture of Particularly helpful Moodlers

Welcome.  Progress made is good, however ...

"Where do I have not to include coursecatlib.php ? as the log says ?"

A plugin should not modify core files.  Thought that was a standard rule for all addons.  So suggest contacting the developer of the plugin ... which, I think you've said you are doing?

The file is part of core and in a git acquired moodle38 code directory that file shows to be 3329 in size.   What does your coursecatlib.php file show?

In a 3.8.2 (Build: 20200309) In the header of that file ... this comment:

 * Deprecated file, classes moved to autoloaded locations

Just did a git pull on that site.  Updated with no issues. Version is now 3.8.2+ (Build: 20200408)

Comment still the same and file size still 3329.

Just for grins I hid the file:

-rw-r--r--.  1 apache apache   3329 Jan 13 08:28 .coursecatlib.php

See the 'dot' in front of filename above?

Logged into the 38 ... no errors ... clicked on anything 'course' related ... no errors.

Is there something left in mdl_config_plugins table related?

Sooooo .... I dunno!!!! Maybe a Moode 'supreme being' will pop in here and clarify! smile

'SoS', Ken


Average of ratings: Useful (1)
In reply to Ken Task

Re: Exception - Unexpected closing tag when updating 3.8.1 to 3.8.2+

by Renan COLLIN -
Yes, I have contacted Daniel and I will see with him for Block Featured Courses incompatibility and regarding modifying coursecatlib.php.
But I still do not understand why the block featured is still mentionned during the core update while I have uninstalled it before updating. That seems not to be totally uninstalled...
Gonna check the file and the tables and will let you know as I am backuping for now.
Quite weird to have a dot before that file coursecatlib... is it hidden ? It can be launched by command line like a shell script ? Weird... but maybe the cause of something, so yes maybe a moodle guru could help us here. But just before gonna check the file.
Best regards
Renan
In reply to Renan COLLIN

Re: Exception - Unexpected closing tag when updating 3.8.1 to 3.8.2+

by Ken Task -
Picture of Particularly helpful Moodlers

Was testing my 3.8.2+ ...

Original file did not ... repeat did not ... have a 'dot' in front of filename.

I did that manually using following command:

mv coursecatlib.php .coursecatlib.php

See 'dot' in front of filename?   That hides a file from apache.  Did that to test if I could force my 3.8.2+ into an error ... might then determine what code was calling the file.   No calls.  No errors.  My site functioned just fine, but I don't have that plugin installed on my site either.

Cannot run that script from command line.

Not totally un-installed ... files for plugin are no longer present.  Did you go to Plugins to see if that reported 'missing from disk'?  If so, go ahead and click 'Upgrade database' button.   That should 'un-install'.

IF that doesn't, then there's reference to it somewhere in tables?

Is there a reference to it in mdl_config_plugins table?

Are there tables in the DB related?

Again ... dunno!  Guess you'll just have to 'circle in a holding pattern'!

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: Exception - Unexpected closing tag when updating 3.8.1 to 3.8.2+

by Renan COLLIN -
Great, interesting for the dot file test.
For uninstalling the plugin, I had updated db too but I will check again in admin interface and with phpmyadmin.
I am talking with Daniel too who will have a look tomorrow.
I am still backuping but the other versions of coursecatlib.php files have not the size 3329 but 3433.... sad Still digging, thanks again to have tested smile and I will let you know.
Best regards
Renan
In reply to Renan COLLIN

Re: Exception - Unexpected closing tag when updating 3.8.1 to 3.8.2+

by Renan COLLIN -
Woaw, there are plenty references to featured courses block while I had uninstalled and updated the DB. The plugin is still there. So purging the cache was the point for updating the moodle core files to 3.8.2+.
This is really weird...
From that point, I have the platform migrated to the latest version and that is already good but I would like to understand why the plugin is still there.
Best regards
Renan
In reply to Renan COLLIN

Re: Exception - Unexpected closing tag when updating 3.8.1 to 3.8.2+

by Renan COLLIN -
There are other plugin compatibility problem while attempting to update to Moodle 3.8.2+ so I will have to wait a bit for a complete compatibility before updating moodle to the latest version.
The reason why the Featured Courses plugin was not uninstalled is that I encounter 403 page if I do not use confirm=1 to plugins.php, do not know why and secondly I did not remove the plugin files so the next update whould have reinstall it.
Thanks a lot for your help, I think, I know better Moodle now and this can help others like me as moodle beginner.
So to everyone, be careful to plugin compatibilities when updating core files, purge cache is a good practice and remove plugin folders when you want to completely remove them.
Best regards.
Renan
Average of ratings: Useful (1)
In reply to Renan COLLIN

Re: Exception - Unexpected closing tag when updating 3.8.1 to 3.8.2+

by Ken Task -
Picture of Particularly helpful Moodlers

Good to hear!   Feel free to rate any posting in this thread as 'Useful' if it helped.

Helps me 'earn' my badges! smile

'SoS', Ken

In reply to Renan COLLIN

Re: Exception - Unexpected closing tag when updating 3.8.1 to 3.8.2+

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
That's a worry - there shouldn't be anything in minor versions that breaks plugins. Shouldn't be....
In reply to Howard Miller

Re: Exception - Unexpected closing tag when updating 3.8.1 to 3.8.2+

by Renan COLLIN -
Hello, yes, in theory which is an utopic world, I guess smile And no plugin modifying core files, and me who lost some time (and Ken's one too) because I did not check well version compatibility, sorry fot that... sad We have to pay to be able to learn...