Moodle upgrade error from 3.0.4+ to 3.1

Moodle upgrade error from 3.0.4+ to 3.1

by Yong Ra -
Number of replies: 19

If anyone can help, I am getting following error when I upgrade from 3.0.4+ to 3.1. Do anyone have idea on how to fix this? I tried doing it with mod_data, but that did not work.


Thank you and sorry for posting this issue on another thread. I did not mean to hijack it. With the same kind of install issue, I thought I should post it there.


Ra


Debug info: Table 'performance_schema.session_variables' doesn't exist
SHOW VARIABLES LIKE 'innodb_file_per_table'
[array (
)]
Error code: dmlreadexception


Stack trace:

  • line 474 of /lib/dml/moodle_database.php: dml_read_exception thrown
  • line 1088 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 1527 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
  • line 332 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->get_record_sql()
  • line 308 of /lib/ddl/mysql_sql_generator.php: call to mysqli_native_moodle_database->is_compressed_row_format_supported()
  • line 542 of /lib/ddl/database_manager.php: call to mysql_sql_generator->getAddFieldSQL()
  • line 74 of /mod/data/db/upgrade.php: call to database_manager->add_field()
  • line 726 of /lib/upgradelib.php: call to xmldb_data_upgrade()
  • line 432 of /lib/upgradelib.php: call to upgrade_plugins_modules()
  • line 1742 of /lib/upgradelib.php: call to upgrade_plugins()
  • line 677 of /admin/index.php: call to upgrade_noncore()
Average of ratings: -
In reply to Yong Ra

Re: Moodle upgrade error from 3.0.4+ to 3.1

by Yong Ra -

By the way, I used "git checkout MOODLE_31_STABLE" command after changing the git branch MOODLE_31_STABLE to to do the in-place upgrade. I did not do the fresh install and copy the config files over and other modules to do the upgrade.


Thank you.

In reply to Yong Ra

Re: Moodle upgrade error from 3.0.4+ to 3.1

by Yong Ra -

I found the answer. I think this problem only implies to servers that are using MySQL 5.7.x. I have other installations that uses MariaDB 5.5.x and MySQL 5.5.x and they do not have this issue.


There is a setting in MySQL which needs to be on. It is "show_compatibility_56" setting. (I am not a MySQL admin, So, I do not know what this is for. But, I read that this will eventually removed.)


To fix this, I added "show_compatibility_56=ON" in my.cnf file under [mysqld] section and restarted the MySQL service.


The upgrade from 3.0.4+ to 3.1 worked fine.


Hope this helps someone.

Average of ratings: Useful (1)
In reply to Yong Ra

Re: Moodle upgrade error from 3.0.4+ to 3.1

by A. Obeid -

I get another issue after doing this upgrade: navigation menu drop down arrow not working properly.

I replace the block "settings" with the old one than it works.



In reply to A. Obeid

Re: Moodle upgrade error from 3.0.4+ to 3.1

by A. Obeid -
function get_required_javascript() {
    global $PAGE; $adminnodeid = null;
    $adminnode = $PAGE->settingsnav->find('siteadministration', navigation_node::TYPE_SITE_ADMIN);
    if (!empty($adminnode)) {
        $adminnodeid = $adminnode->id;
     }
        parent::get_required_javascript();
        $arguments = array(
            'id' => $this->instance->id,
            'instance' => $this->instance->id,
            'candock' => $this->instance_can_be_docked()
        );
        $this->page->requires->js_call_amd('block_settings/settingsblock', 'init', array($adminnodeid));
    }

$arguments is not in use!
In reply to A. Obeid

Re: Moodle upgrade error from 3.0.4+ to 3.1

by Cameron 👨‍🦲🟥⚡️ -
Picture of Core developers Picture of Peer reviewers Picture of Testers

Hi, we did a lot of work on the navigation blocks for 3.1. This problem is being fixed in MDL-54722

It should still be working though, the $arguments stuff is for when you dock the block. When the block is not docked, everything should still work.


In reply to Cameron 👨‍🦲🟥⚡️

Re: Moodle upgrade error from 3.0.4+ to 3.1

by A. Obeid -

Hi, so i put all this change and do testing. Still the same behavior.  <li> and <span> dont have an id after klicking any link in Settings.


<li class="collapsed contains_branch" tabindex="-1" id="yui_3_17_2_1_1464868412463_254">

<p id="users_tree_item" class="tree_item branch" role="treeitem" tabindex="-1" aria-expanded="false" aria-owns="users_tree_item_group">

 <span id="yui_3_17_2_1_1464868412463_253" tabindex="-1">Users</span>

after klicking any page there settings:

<li class="type_setting depth_2 contains_branch" aria-labelledby="label_2_8" tabindex="-1">
<p class="tree_item tree_item branch" aria-owns="57501f524323b_group" aria-expanded="true" role="treeitem" tabindex="-1" aria-selected="false">
<span tabindex="-1">Users</span>

In reply to A. Obeid

Re: Moodle upgrade error from 3.0.4+ to 3.1

by Cameron 👨‍🦲🟥⚡️ -
Picture of Core developers Picture of Peer reviewers Picture of Testers
Sorry, I can't reproduce this... It looks like you are clicking the "Site administraction" > "Users" node? When I click it the li and the p both retain their id attribute.


If you can't resolve the problem it may be worth creating a new thread or an issue on the tracker with clear replication steps.

In reply to A. Obeid

Re: Moodle upgrade error from 3.0.4+ to 3.1

by Niall Sheehan -

While trying to figure out our 3.1 menu issues I found this topic and would like to add what we are having issues with after upgrading to 3.1 from 3.0.3. Basically the side bar menus are not working as expected. On some pages everything works as expected, on others menu items do not expand or open a different item for example expanding Plugins may cause Competencies to expand instead.

On a page when the menu is working as expected the HTML is:

<p class="tree_item branch" id="badges_tree_item" role="treeitem" tabindex="0" aria-expanded="true" aria-owns="badges_tree_item_group" aria-selected="true"><span tabindex="-1">Badges</span></p>

On a non working page:

<p class="tree_item tree_item branch" role="treeitem" aria-expanded="true" aria-owns="575185cec9de1_group" tabindex="0" aria-selected="true"><span tabindex="-1">Badges</span></p>

What is 575185cec9de1_group and why is it not badges_tree_item_group?


Using the More theme.

Cheers.

Average of ratings: Useful (1)
In reply to Niall Sheehan

Re: Moodle upgrade error from 3.0.4+ to 3.1

by Niall Sheehan -

For anyone else having this issue it has "cleared up" for the Site Administration menu and main navigation menu, however under Front Page Settings the odd aria-owns values persist. All nested menu items have the same value. 


Cheers.

Attachment menu-moodle_inspect.png
Attachment menu-moodle.png
In reply to Niall Sheehan

Re: Moodle upgrade error from 3.0.4+ to 3.1

by Cameron 👨‍🦲🟥⚡️ -
Picture of Core developers Picture of Peer reviewers Picture of Testers

Hi, those are unique ids generated for the nodes. We need to ensure that there is a aria-owns relationship between the treeitem and the node it is expanding/collapsing.

When rendering these trees, some nodes specify their own IDs, some do not. When they don't specify them (which seems to be most of the time), a unique ID is generated.

From your post it sounds like you aren't having a problem anymore, but were just curious. Is that correct?

In reply to Cameron 👨‍🦲🟥⚡️

Re: Moodle upgrade error from 3.0.4+ to 3.1

by Niall Sheehan -

The problem is still persisting in a few places. As shown above under the Administration menu - Front Page Settings, all of the 'aria-owns values' are the same random value, the 'class' for menu items with nested items is show as "type_unknown depth_2 contains_branch" while under Site Administration, a collapsed branch has a class of "collapsed contains_branch", all items in this menu have appropriate ID values.


Not sure why the Front Page Menu is assigning these values...

Cheers. 

Niall

In reply to Niall Sheehan

Re: Moodle upgrade error from 3.0.4+ to 3.1

by Cameron 👨‍🦲🟥⚡️ -
Picture of Core developers Picture of Peer reviewers Picture of Testers

That's truly bizarre. When I do the same thing, I get different IDs. Those IDs are generated each time the page is loaded, so the only explanation I can think of is that you were incredibly unlucky and the same ID was generated twice...

Does it happen every time you access the front page settings section?

I wouldn't pay too much attention to the class names and stuff, they have been a bit hectic for some time. Hopefully it will be fixed.


In reply to Cameron 👨‍🦲🟥⚡️

Re: Moodle upgrade error from 3.0.4+ to 3.1

by Niall Sheehan -

Unfortunately we are still having issues with incorrect aria-owns values, we are seeing the same random value used for multiple menu item with nested items preventing the hidden status of the selected item being switched to false because some other menu item already has the same aria-owns value and it open if it is before the one I am trying to open. In your example the values are unique in our situation unique values are NOT the case, they are all the same.

While I can open the dev tools and change the value, my test users are not likely to figure this out. smile

FWIW we've switched to the More Theme with no change, all active plugins are up to date and compatible with 3.1. Had to rule those possibilities out.

Cheers.

NIall

In reply to Niall Sheehan

Re: Moodle upgrade error from 3.0.4+ to 3.1

by Niall Sheehan -

We can reproduce this when editing a course. Go to a course, select Edit Quiz (this is a single event - quiz). Select Course Administration, and the menu above Quiz Administration opens and closes.


Quiz Admin menu:

<p class="tree_item root_node tree_item branch" role="treeitem" aria-expanded="true" aria-owns="576165fa22c5f_group" tabindex="-1" aria-selected="false" id="yui_3_17_2_1_1466000890720_1904"><span tabindex="-1" id="yui_3_17_2_1_1466000890720_1903">Quiz administration</span></p>

Course Admin menu:

<p class="tree_item root_node tree_item branch" role="treeitem" aria-expanded="false" aria-owns="576165fa22c5f_group" tabindex="0" aria-selected="true" id="yui_3_17_2_1_1466000890720_1578"><span tabindex="-1" id="yui_3_17_2_1_1466000890720_1577">Course administration</span></p>

In reply to Niall Sheehan

Re: Moodle upgrade error from 3.0.4+ to 3.1

by Cameron 👨‍🦲🟥⚡️ -
Picture of Core developers Picture of Peer reviewers Picture of Testers

Thanks for reporting back Niall. Unfortunately I still cannot reproduce this... See the attached screenshot. Both quiz administration and course administration have distinct values for me :[

Does it happen every time you repeat the above steps?


In reply to Cameron 👨‍🦲🟥⚡️

Re: Moodle upgrade error from 3.0.4+ to 3.1

by A. Obeid -

Solved by JD:

Replace uniqid() by html_writer::random_id() in

\blocks\navigation\renderer.php#89
and
\blocks\settings\renderer.php#78

MDL-54977

In reply to A. Obeid

Re: Moodle upgrade error from 3.0.4+ to 3.1

by Luis Alberto Ossa Nieto -

Hello Obeid,

I followed each post in this forum and I have to say that the problem still has not been resolved. I made two completely clean installations on two external servers that meet the minimum requirements described in the documentation moodle.org.

In one of the servers I installed version 3.0.6 and on the other, version 3.1.1. Both versions have the same problem when collapsing the menu.

I followed all the instructions that you believe in the forum, but no change is achieved, the problem persists, the links do work but the menu and the system to collapse not work.

I have read so much, I even added a new language pack to see if this aspect was failing, but still the same.

Ideally someone from the development team the task of loading a version of clean moodle, on a new server, with the minimum characteristics required by the organization, evidencing the problem and find an immediate solution for end users take (Create or develop a patch correction).

I hope to have correctly explained the situation.

Thank you very much.

Greetings.

Sincerely,

Luis Ossa.


In reply to Luis Alberto Ossa Nieto

Re: Moodle upgrade error from 3.0.4+ to 3.1

by Niall Sheehan -

I am no longer seeing this issue, I believe it was cause by a plugin that had not been updated, however because it's resolved I didn't have an opportunity to figure out which one.