Getting stuck in 'new settings added during your last moodle upgrade'

Getting stuck in 'new settings added during your last moodle upgrade'

by tim st.clair -
Number of replies: 6
Picture of Particularly helpful Moodlers Picture of Plugin developers

I've got Moodle 5.0.2 and when a new plugin or setting is added, I get the following screen in a loop. Which is to say, it tells me there are new settings for external database, ldap server, and shibboleth. I press updated, it thinks, it comes back to the same 'new settings' screen with these 3 things again.

new settings for external database

When I change the url from the upgradesettings.php back to /admin and hit enter, its all good. The next time I upgrade another plugin (say bump a version), these three settings again appear and I get stuck in the loop again.

Is there something I can do?

Average of ratings: -
In reply to tim st.clair

Getting stuck in 'new settings added during your last moodle upgrade'

by Ken Task -
Picture of Particularly helpful Moodlers

All 3 are authentications, so have to ask if your site actually uses the authentication methods shown?

If so, after you regain admin acess, visit authentications and see that each has been filled out ... no missing info that is required.

If not, visit authentications and see if those have been turned on but not completed.

All of those above would require some settings in DB.   Are your DB tables related to authentication in need of optimization or fixes?  Have something stuck in adhoc task of cron job?

Quick check ... from command line, go to:

code/admin/cli/ and issue

php checks.php -v

'SoS', Ken

In reply to Ken Task

Getting stuck in 'new settings added during your last moodle upgrade'

by tim st.clair -
Picture of Particularly helpful Moodlers Picture of Plugin developers
No, never have used any of these auth methods on this site.

I tried this on another test copy of the site running this time on 5.1.1 - I installed a new plugin that I've not installed into that Moodle before - Questionnaire. This installed properly, prompted for the settings for the questionnaire, then refreshed after update and prompted for these three plugins again, and would get stuck until I went to another url, then back t admin.

Not sure why they all say (Speciality) - something to do with display_auth_lock_options() in authlib.php.

php check.php -v yields:

root@067319226be1:/var/www/html/admin/cli# php checks.php -v
Cannot load Xdebug - it was already loaded
CRITICAL: Tasks max fail delay (tool_task_maxfaildelay)
Status | Check
----------+--------------------------------------------------------------------
OK | Environment (core_environment)
| Your server environment meets all minimum requirements.
| http://localhost:8081/admin/environment.php
|
OK | Upgrade (core_upgradecheck)
| No upgrade needed for the installed version 5.1.1 (Build:
| 20251208) (2025100601). Thanks for coming anyway!
| http://localhost:8081/admin/index.php?cache=1
|
NA | Antivirus (core_antivirus)
| No antivirus scanners are currently enabled
| http://localhost:8081/admin/settings.php?section=manageantiviruses
|
OK | Cron running (tool_task_cronrunning)
| Cron is running frequently
| http://localhost:8081/admin/tool/task/runningtasks.php
|
ERROR | Tasks max fail delay (tool_task_maxfaildelay)
| 2 task(s) failing
| http://localhost:8081/admin/tasklogs.php
|
ERROR | Ad hoc task queue (tool_task_adhocqueue)
| Oldest unprocessed task is 203 days 20 hours, which is more
| than 4 hours
| http://localhost:8081/admin/tool/task/adhoctasks.php
|
OK | Long running tasks (tool_task_longrunningtasks)
| Long running tasks: 0
| http://localhost:8081/admin/tool/task/runningtasks.php
|

Those adhoc tasks are old failed backups, which I've subsequently deleted. Don't know why a half-year-old failed backup would trigger an upgradesettings.php loop for plugins that have never been touched.
In reply to tim st.clair

Getting stuck in 'new settings added during your last moodle upgrade'

by Ken Task -
Picture of Particularly helpful Moodlers

The checks script reads config.php file.  What's in your config.php file?  xdebug is not a required extension to php.  And it might be an issue with what you are seeing.

Checks should show all green [OK] - investigate those NOT green.

Did you run those direct DB queries and dump to text files so you could see what your DB has?

From mysql client:
mysql -N -u root -e "use m51test;select * from mdl_config_plugins;" > allpluginssettings.txt;cat allpluginssettings.txt

The fgrep auth allpluginssettings.txt
will show all auth settings ... ldap, etc.

Again, when ever I do an update or upgrade via CLI git, the very last thing moodle does is run through all settings defaults - that usually takes longer than any other process in the update/upgrade.

I would think your server might show something at that point.

'SoS', Ken

In reply to tim st.clair

Getting stuck in 'new settings added during your last moodle upgrade'

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
I know I had an issue with something similar and it was related to the case of the profile field - I had changed the case (capitalized it I believe) and it would do this again and again. I felt like there was an upgrade way back when that fixed this but I also remember having to do something with the profile field to get rid of this screen. Sorry, not a huge help but hopefully it will at least get you in the right direction.
Average of ratings: Useful (1)
In reply to Emma Richardson

Getting stuck in 'new settings added during your last moodle upgrade'

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Have you made any changes to this profile field? Is it a field that you just created?
In reply to tim st.clair

Getting stuck in 'new settings added during your last moodle upgrade'

by Ken Task -
Picture of Particularly helpful Moodlers

Whenever I git update code the last thing that happens is moodle runs through all settings for defaults.

Suggestion:

There is a moodle table called mdl_config_plugins (mdl_ is prefix) that contains all the settings.
In code/admin/cli/ create a script called getldap that contains:

mysql -u root -e "use moodle;select * from mdl_config_plugins where plugin like '%auth_ldap%';" > ldapconfig.txt;cat ldapconfig.txt;wc -l ldapconfig.txt

That will dump all setting for ldap to an ldapconfig.txt file that you can then inspect for missing settings.

Ditto for the other authentication methods - just copy getldap to getother and in getother script change '%auth_ldap%' to '%auth_other% as well as the name of the txt file to see
'other'.

mysql -u root -e "use moodle;select * from mdl_config_plugins where plugin like '%auth%';" > allauthconf.txt;cat allauthconf.txt;wc -l allauthconfig.txt

will show all.

'SoS', Ken