MediaWiki suddenly came with 500 internal error Fatal error: Uncaught Error: Call to a member function getCode() on null in /var/www/wiki/includes/user/User.php:1578 Stack trace: #0 /var/www/wiki/includes/user/User.php(5243): User::getDefaultOptions() #1 /var/www/wiki/includes/user/User.php(2859): User->loadOptions() #2 /var/www/wiki/includes/context/RequestContext.php(364): User->getOption('language') #3 /var/www/wiki/includes/Message.php(380): RequestContext->getLanguage() #4 /var/www/wiki/includes/Message.php(1257): Message->getLanguage() #5 /var/www/wiki/includes/Message.php(842): Message->fetchMessage() #6 /var/www/wiki/includes/Message.php(934): Message->toString('text') #7 /var/www/wiki/includes/exception/MWExceptionRenderer.php(254): Message->text() #8 /var/www/wiki/includes/exception/MWExceptionRenderer.php(358): MWExceptionRenderer::msg('dberr-again', 'Try waiting a f...') #9 /var/www/wiki/includes/exception/MWExceptionRenderer.php(52): MWExceptionRenderer::reportOutageHTML(Object(Wikimedia\Rdbms\DBConnectionError)) #10 /var/www/wiki/includes/exception/MWExce in /var/www/wiki/includes/user/User.php on line 1578
答案 0 :(得分:0)
我认为如果您有多次安装尝试并且mysql.user仍然存在,则可能会发生此错误。我今天遇到了同样的问题。
我已将错误提交为: https://phabricator.wikimedia.org/T177768
使用以下步骤重新安装后问题消失了:
dropping database
removing user from mysql.users
strangely the "user exists" error still appeared on installation
granting access rights was therefore necessary on the mysql database.