Slow / failed logins

Slow / failed logins

by Stan Klapauszak -
Number of replies: 4

Seeking whatever assistance I can get on this serious issue: About a week ago (date not certain) we started to experience very slow Moodle login / logout times (2-3 minutes) for browser users, and mobile-app users are unable to log in at all (they receive an error code "logintokenerror: timeout has occurred"). Once logged in, Moodle actions all appear to work at "normal" speed, or close to it. The server appears to be working normally and other apps on this server are working normally. But the Firefox display of page-element load times shows that moodle/login/index.php is taking 1.7 min to load.

What is baffling is that there has been no substantive change to Moodle in the past several months except for adding courses and users - and not a lot of that either. We're not a large or busy site (~800 courses, ~3000 users total but only 5-10 concurrent users). We do have some system connections running over web services (Edwiser Bridge connecting to an external Wordpress website, ampEducator SIS course-syncing and SSO) but those were all implemented months or years ago with no recent changes. Further, we have a Test Moodle site which is an exact copy of our production site (literally a copy/restore from a few months ago) with the same configuration, connections, courses and users and it doesn't have these issues.

In the Moodle logs the failed Moodle app logins appear as "Web service authentication failed with code: "invalid_token" so I thought for a moment that perhaps our web services token had expired. So I recreated the token (this time without an expiry date) but that did not solve the issue. And our Test Moodle had the exact same token, and Moodle app connections are working for it.

Any clues where to look for this issue? What diagnostics should I be running to figure out what is happening?

We're running Moodle 3.9.11 on a MS Azure server LAMP (Linux, Apache, MySQL, PHP) stack.

I appreciate any ideas you can offer...

Stan

Average of ratings: -
In reply to Stan Klapauszak

Slow / failed logins

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
What sort of authentication is your site using? Are these just manual accounts or something else?

If it was working fine and then it suddenly wasn't then *something* changed. Even if it doesn't seem releated. It would be a good idea to find out what.

Moodle 3.9 has been completely unsupported for well over a year, so that isn't a great place to be.
Average of ratings:Useful (1)
In reply to Howard Miller

Slow / failed logins

by Stan Klapauszak -
Hi Howard - thanks for those thoughts. All our accounts are manual, except for SSO with ampEducator and via the Edwiser bridge to a Wordpress website.

I actually think I've made a breakthrough here: as I was sequentially disabling various components, I disabled the Edwiser SSO to our Wordpress website, and that seems to have resolved the issue. That function has been working without issue since 2021, but I agree with you that SOMETHING must have changed to break it. I'll figure that out, but for now we can at least login to Moodle.

Stan
In reply to Stan Klapauszak

Slow / failed logins

by Stan Klapauszak -
Just closing the loop here, in case anyone else ever hits this issue: Turns out that what had happened was that our webserver hosting service had turned on ModSecurity for the website that was connected to Moodle via the Edwiser Bridge product. That meant that SSO requests from Moodle to the website were failing (timing out). Browser-based Moodle logins would eventually connect to Moodle (after the SSO requests to the website timed out) but Moodle Mobile logins failed before that could occur. We (temporarily) fixed the issue by turning off Modsecurity on that website - so now the Edwiser Bridge SSO works again. Still working with Edwiser and our website host to figure out if we can tweak Modsecurity rules to allow Modsecurity and Edwiser Bridge to peacefully co-exist.
Average of ratings:Useful (1)
In reply to Stan Klapauszak

Slow / failed logins

by Ken Task -
Picture of Particularly helpful Moodlers

Azure is your virtualization ... Linux in that environment is typically Ubuntu ... but what version of Ubuntu?
Shell access to the Ubuntu is, I would think, absolutely necessary.
In the shell, issue: uname -an and you'll see version of Ubuntu.
 
2 resources to consult for Moodle versions and requirements:
http://www.syndrega.ch/blog/#php-and-dbms-compatibility-of-major-moodle-releases
and
https://moodledev.io/general/releases

As howard has already said, 3.9.x is old and you are in need of an upgrade. However, you cannot hyperjump from 3.9 to 4.5 nor 5.0 without steps (a moodle march).

For that, best to use shell and git.
https://docs.moodle.org/500/en/Git_for_Administrators

And since you have addons/plugins those need to be investigated to see if they have a compat version for the destination version of your moodle.   Don't forget, themes, which are all controlling, are plugins.

'SoS', Ken