Since some months our wiki (MW 1.31.5) experiences a strange error, that happens maybe twice a week (on average).
The php error log is as follows:
[06-Dec-2019 10:02:16 CET] PHP Fatal error: Uncaught Error: Call to a member function getCode() on null in /html/site/mediawiki/includes/user/User.php:1737 Stack trace: #0 /html/site/mediawiki/includes/user/User.php(5417): User::getDefaultOptions() #1 /html/site/mediawiki/includes/user/User.php(3101): User->loadOptions() #2 /html/site/mediawiki/includes/context/RequestContext.php(336): User->getOption('language') #3 /html/site/mediawiki/includes/Message.php(380): RequestContext->getLanguage() #4 /html/site/mediawiki/includes/Message.php(1290): Message->getLanguage() #5 /html/site/mediawiki/includes/Message.php(842): Message->fetchMessage() #6 /html/site/mediawiki/includes/Message.php(934): Message->toString('text') #7 /html/site/mediawiki/includes/exception/MWExceptionRenderer.php(201): Message->text() #8 /html/site/mediawiki/includes/exception/MWExceptionRenderer.php(301): MWExceptionRenderer::msg('dberr-problems', 'Sorry! This sit...') #9 /ht in /html/site/mediawiki/includes/user/User.php on line 1737
Sometimes this error happens once a day, sometimes several times within one minute.
As a consequence the site is down for some seconds and editors get kicked out (logged out) of the wiki.
I googled the error messages several times, but didn't find anything helpful.
Who can point me in the right direction to fix this annoying error please?
The site in question is https://secret-wiki.de/wiki/Spezial:Version and has ~ 60.000 visitors monthly, but this error also happens occasionally on another public MW 1.31 install that I run.