-
Bug
-
Resolution: Fixed
-
Blocker
-
3.3
-
MOODLE_33_STABLE
-
MOODLE_33_STABLE
-
MDL-58692-master-authcfgnames -
I was setting up a partner institution dataset, I got a fatal error while upgrading to master:
Default exception handler: Error writing to database Debug: ERROR: duplicate key value violates unique constraint "mdl_confplug_plunam_uix"
|
DETAIL: Key (plugin, name)=(auth_mnet, rpc_negotiation_timeout) already exists.
|
UPDATE mdl_config_plugins SET plugin = $2 WHERE plugin = $1
|
[array (
|
0 => 'auth/mnet',
|
1 => 'auth_mnet',
|
)]
|
Error code: dmlwriteexception
|
* line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown
|
* line 242 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
|
* line 1167 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
|
* line 1780 of /lib/dml/moodle_database.php: call to pgsql_native_moodle_database->set_field_select()
|
* line 51 of /auth/mnet/db/upgrade.php: call to moodle_database->set_field()
|
* line 564 of /lib/upgradelib.php: call to xmldb_auth_mnet_upgrade()
|
* line 1754 of /lib/upgradelib.php: call to upgrade_plugins()
|
* line 181 of /admin/cli/upgrade.php: call to upgrade_noncore()
|
|
!!! Error writing to database !!!
|
!! ERROR: duplicate key value violates unique constraint "mdl_confplug_plunam_uix"
|
DETAIL: Key (plugin, name)=(auth_mnet, rpc_negotiation_timeout) already exists.
|
UPDATE mdl_config_plugins SET plugin = $2 WHERE plugin = $1
|
[array (
|
0 => 'auth/mnet',
|
1 => 'auth_mnet',
|
)]
|
Error code: dmlwriteexception !!
|
!! Stack trace: * line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown
|
* line 242 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
|
* line 1167 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
|
* line 1780 of /lib/dml/moodle_database.php: call to pgsql_native_moodle_database->set_field_select()
|
* line 51 of /auth/mnet/db/upgrade.php: call to moodle_database->set_field()
|
* line 564 of /lib/upgradelib.php: call to xmldb_auth_mnet_upgrade()
|
* line 1754 of /lib/upgradelib.php: call to upgrade_plugins()
|
* line 181 of /admin/cli/upgrade.php: call to upgrade_noncore()
|
!!
|
This error is related to MDL-12689 changes. I've read a bit of history and I see that auth_mnet uses auth_mnet as plugin namespace since MDL-23245 (was using auth/mnet for some vars and auth_mnet for others) that issue's patch (94cf0a1e) includes a upgrade process to get rid of auth/mnet records (https://github.com/moodle/moodle/commit/94cf0a1e#diff-ac50c3eece4435d5f244c987200646efR38) but it seems that the site I'm trying to upgrade have somehow both auth/mnet -> rpc_negotiation_timeout and auth_mnet -> rpc_negotiation_timeout. I believe this can be related with MDL-23220 it could have happened that there was a problem with that upgrade step.
This can be a problem specific to this this var or to this site but this will probably not be the only site with this problem. We have different options:
- Remove auth_mnet upgrade step as the plugin is already supposed to be using auth_mnet (I've checked the codebase and I haven't found any get/set config to auth/xxx)
- Update all
MDL-12689upgrade steps to check first if the config var we are trying to set exists and if it does we respect the current value, if auth/xxx var and auth_xxx values differ we notify the user but continue with the upgrade, if they don't we just remove the auth/xxx one. We could also improve this by checking each of the plugin's config values giving always priority to the config namespace that was previously used (the value that was used by moodle beforeMDL-12689) - Check if this is an isolated issue and we should ignore it
I would vote for #2 if we don't have much time, but I think that something close to #3 would be better.
- blocks
-
MDLQA-10772 CLONE - Upgrade test using a big data set
- Passed
- has been marked as being related by
-
MDL-58793 Reduce the number of auth setting presented on upgrade to 3.3
- Closed
- has to be done after
-
MDL-58793 Reduce the number of auth setting presented on upgrade to 3.3
- Closed
- is a regression caused by
-
MDL-12689 convert all auth plugins to use settings.php
- Closed