Unable to update moodle: cannotdowngrade: lib/upgradelib.php: downgrade_exception thrown

Created:

2016-12-18 06:54:22 UTC

Modified:

2017-08-17 23:05:38 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Unable to update moodle: cannotdowngrade: lib/upgradelib.php: downgrade_exception thrown

Applicable to:

  • Plesk Onyx for Linux

Symptoms

Unable to update Moodle:

stderr:
Default exception handler: No se puede pasar mod_assign de 2015111601 a 2015111600. Debug:
Error code: cannotdowngrade
* line 746 of /lib/upgradelib.php: downgrade_exception thrown
* line 427 of /lib/upgradelib.php: call to upgrade_plugins_modules()
* line 1647 of /lib/upgradelib.php: call to upgrade_plugins()
* line 171 of /admin/cli/upgrade.php: call to upgrade_noncore()
* line 45 of /usr/local/psa/var/apspackages/moodle-3.0.3-7643ec43a7-4d75-fa6c-7d/cache/scripts/configure: call to require()

file: /usr/local/psa/admin/plib/Service/Agent/Transport/Local/Exec.php
line: 45
code: 0
trace: #0 /usr/local/psa/admin/plib/Service/Agent/Transport/Local.php(60): Service_Agent_Transport_Local_Exec->process(integer '0', object of type Service_Agent_Command_Exec, object of type Service_Agent_Transport_LocalTransaction)

After second attempted the following is shown:

Internal error: no service with resource type 'aps::aps12::moodle::moodle'

Message no service with resource type 'aps::aps12::moodle::moodle'
File aps_php.php
Line 14196
Type Exception

Cause

Failed update. Installation and plugins were particularly upgraded.

Resolution

  1. Backup apsc database:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin apsc > apsc.sql
  2. Disabled aspcatalog in /usr/local/psa/admin/conf/panel.ini :

    [aps]
    catalogUrl = ''
  3. Firstly it is needed to revert to working state:

    1.1 Log in to Plesk database

    MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa

    1.2. Execute the following query:

    MariaDB [apsc]> select * from aps_resource where resource_type like "%moodle%";
    +----+--------------------+--------------------+------------+----------------------------+--------+
    | id | registry_object_id | parent_resource_id | service_id | resource_type | app_id |
    +----+--------------------+--------------------+------------+----------------------------+--------+
    | 31 | 44 | NULL | | aps::aps10::moodle | 11 |
    | 34 | 50 | NULL | moodle | aps::aps12::moodle::moodle | 12 |
    +----+--------------------+--------------------+------------+----------------------------+--------+
    2 rows in set (0.00 sec)

    Resource_type should be set as 'aps::aps10::moodle'

    mysql> update apsc.aps_resource set resource_type = 'aps::aps10::moodle' where id = 34;
  4. Login to Moodle Administrative interface and Moodle database. In Moodle plugin page you should receive the list of issued plugins. Manually change the version to required in Moodle database, for example:

    mysql> select * from config_plugins where plugin = 'mod_assign';
    +-----+------------+---------+------------+

    | id | plugin | name | value |
    +-----+------------+---------+------------+

    | 894 | mod_assign | version | 2015111601 |
    +-----+------------+---------+------------+
    1 row in set (0.00 sec)

    mysql> update config_plugins set value = '2015111600' where id = 894;

    Correct value '2015111600' is because in physical file /var/www/vhosts/iesjalance.es/httpdocs/mod/assign/version.php this value is defined, so this should be equal to database.

  5. Perform this steps for each plugin and under Administrator interface click on 'Upgrade mysql database'.

  6. Now Moodle is upgraded and Plesk does not know about it.
  7. Turn on Application Catalog in /usr/local/psa/admin/conf/panel.ini :

    [aps]
    ;catalogUrl = ''
  8. In Plesk > Tools & Settings > Application Vault > click Clear

  9. Go to Plesk > Subscriptions > example.com > Moodle > Install
Have more questions? Submit a request
Please sign in to leave a comment.