# Mediawiki error 500

**URL:** <https://discuss.freedombox.org/t/mediawiki-error-500/1725>\
**Category:** Support\
**Created:** [September 16, 2021, 6:02pm UTC](https://discuss.freedombox.org/t/mediawiki-error-500/1725 "2021-09-16T18:02:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dietmar](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/d/c5a1d2/32.png) [@Dietmar](https://discuss.freedombox.org/u/Dietmar)\
**Post date:** [September 16, 2021, 6:02pm UTC](https://discuss.freedombox.org/t/mediawiki-error-500/1725/1 "2021-09-16T18:02:29Z")

</div>

**Problem Description**  
Installed Mediawiki on a fresh install of FBx, up to date bullseye. When changing the admin password I got error 500.  
As I had a backup, I ignored this error and did a restore from buster. That however gave error “Fatal exception of type “Wikimedia\Rdbms\DBQueryError””.

**Information**  
Error: “No such user: admin”

Sep 16 19:53:14 freedombox /usr/bin/plinth[9999]: # mediawiki public-registrations status  
Sep 16 19:53:15 freedombox sudo[20622]: plinth : PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/mediawiki public-registrations status  
Sep 16 19:53:15 freedombox sudo[20622]: pam\_unix(sudo:session): session opened for user root(uid=0) by (uid=115)  
Sep 16 19:53:16 freedombox sudo[20622]: pam\_unix(sudo:session): session closed for user root  
Sep 16 19:53:16 freedombox /usr/bin/plinth[9999]: # mediawiki private-mode status  
Sep 16 19:53:16 freedombox sudo[20625]: plinth : PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/mediawiki private-mode status  
Sep 16 19:53:16 freedombox sudo[20625]: pam\_unix(sudo:session): session opened for user root(uid=0) by (uid=115)  
Sep 16 19:53:18 freedombox sudo[20625]: pam\_unix(sudo:session): session closed for user root  
Sep 16 19:53:35 freedombox /usr/bin/plinth[9999]: # mediawiki public-registrations status  
Sep 16 19:53:35 freedombox sudo[20641]: plinth : PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/mediawiki public-registrations status  
Sep 16 19:53:35 freedombox sudo[20641]: pam\_unix(sudo:session): session opened for user root(uid=0) by (uid=115)  
Sep 16 19:53:36 freedombox sudo[20641]: pam\_unix(sudo:session): session closed for user root  
Sep 16 19:53:36 freedombox /usr/bin/plinth[9999]: # mediawiki private-mode status  
Sep 16 19:53:36 freedombox sudo[20644]: plinth : PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/mediawiki private-mode status  
Sep 16 19:53:36 freedombox sudo[20644]: pam\_unix(sudo:session): session opened for user root(uid=0) by (uid=115)  
Sep 16 19:53:37 freedombox sudo[20644]: pam\_unix(sudo:session): session closed for user root  
Sep 16 19:53:37 freedombox /usr/bin/plinth[9999]: # mediawiki public-registrations status  
Sep 16 19:53:37 freedombox sudo[20647]: plinth : PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/mediawiki public-registrations status  
Sep 16 19:53:37 freedombox sudo[20647]: pam\_unix(sudo:session): session opened for user root(uid=0) by (uid=115)  
Sep 16 19:53:38 freedombox sudo[20647]: pam\_unix(sudo:session): session closed for user root  
Sep 16 19:53:38 freedombox /usr/bin/plinth[9999]: # mediawiki private-mode status  
Sep 16 19:53:38 freedombox sudo[20651]: plinth : PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/mediawiki private-mode status  
Sep 16 19:53:38 freedombox sudo[20651]: pam\_unix(sudo:session): session opened for user root(uid=0) by (uid=115)  
Sep 16 19:53:39 freedombox sudo[20651]: pam\_unix(sudo:session): session closed for user root  
Sep 16 19:53:39 freedombox /usr/bin/plinth[9999]: # mediawiki change-password  
Sep 16 19:53:39 freedombox sudo[20654]: plinth : PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/mediawiki change-password  
Sep 16 19:53:39 freedombox sudo[20654]: pam\_unix(sudo:session): session opened for user root(uid=0) by (uid=115)  
Sep 16 19:53:43 freedombox sudo[20654]: pam\_unix(sudo:session): session closed for user root  
Sep 16 19:53:43 freedombox /usr/bin/plinth[9999]: Error executing command - [‘sudo’, ‘-n’, ‘/usr/share/plinth/actions/mediawiki’, ‘change-password’], , No such user: admin  
Traceback (most recent call last):  
File “/usr/share/plinth/actions/mediawiki”, line 266, in   
main()  
File “/usr/share/plinth/actions/mediawiki”, line 262, in main  
subcommand\_method(arguments)  
File “/usr/share/plinth/actions/mediawiki”, line 154, in subcommand\_change\_password  
subprocess.check\_call([  
File “/usr/lib/python3.9/subprocess.py”, line 373, in check\_call  
raise CalledProcessError(retcode, cmd)  
subprocess.CalledProcessError: Command ‘[‘php7.4’, ‘/usr/share/mediawiki/maintenance/changePassword.php’, ‘–user’, ‘admin’, ‘–password’, ‘D=1PfmF.’]’ returned non-zero exit status 1.  
Sep 16 19:53:43 freedombox /usr/bin/plinth[9999]: Internal Server Error: /plinth/apps/mediawiki/  
Traceback (most recent call last):  
File “/usr/lib/python3/dist-packages/django/core/handlers/exception.py”, line 34, in inner  
response = get\_response(request)  
File “/usr/lib/python3/dist-packages/django/core/handlers/base.py”, line 115, in \_get\_response  
response = self.process\_exception\_by\_middleware(e, request)  
File “/usr/lib/python3/dist-packages/django/core/handlers/base.py”, line 113, in \_get\_response  
response = wrapped\_callback(request, \*callback\_args, \*\*callback\_kwargs)  
File “/usr/lib/python3/dist-packages/django/views/generic/base.py”, line 71, in view  
return self.dispatch(request, \*args, \*\*kwargs)  
File “/usr/lib/python3/dist-packages/django/views/generic/base.py”, line 97, in dispatch  
return handler(request, \*args, \*\*kwargs)  
File “/usr/lib/python3/dist-packages/plinth/views.py”, line 165, in post  
return super().post(request, \*args, \*\*kwargs)  
File “/usr/lib/python3/dist-packages/django/views/generic/edit.py”, line 142, in post  
return self.form\_valid(form)  
File “/usr/lib/python3/dist-packages/plinth/modules/mediawiki/views.py”, line 47, in form\_valid  
actions.superuser\_run(‘mediawiki’, [‘change-password’],  
File “/usr/lib/python3/dist-packages/plinth/actions.py”, line 104, in superuser\_run  
return \_run(action, options, input, run\_in\_background, True,  
File “/usr/lib/python3/dist-packages/plinth/actions.py”, line 200, in \_run  
raise ActionError(action, output, error)  
plinth.errors.ActionError: (‘mediawiki’, ‘’, ‘No such user: admin\nTraceback (most recent call last):\n File “/usr/share/plinth/actions/mediawiki”, line 266, in \n main()\n File “/usr/share/plinth/actions/mediawiki”, line 262, in main\n subcommand\_method(arguments)\n File “/usr/share/plinth/actions/mediawiki”, line 154, in subcommand\_change\_password\n subprocess.check\_call([\n File “/usr/lib/python3.9/subprocess.py”, line 373, in check\_call\n raise CalledProcessError(retcode, cmd)\nsubprocess.CalledProcessError: Command ‘[‘php7.4’, ‘/usr/share/mediawiki/maintenance/changePassword.php’, ‘–user’, ‘admin’, ‘–password’, ‘D=1PfmF.’]’ returned non-zero exit status 1.\n’)  
Sep 16 19:53:49 freedombox /usr/bin/plinth[9999]: # help get-logs  
Sep 16 19:53:50 freedombox sudo[20659]: plinth : PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/help get-logs  
Sep 16 19:53:50 freedombox sudo[20659]: pam\_unix(sudo:session): session opened for user root(uid=0) by (uid=115)

---

<div class="post-metadata">

**Author:** ![Dietmar](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/d/c5a1d2/32.png) [@Dietmar](https://discuss.freedombox.org/u/Dietmar)\
**Post date:** [September 19, 2021, 1:50pm UTC](https://discuss.freedombox.org/t/mediawiki-error-500/1725/2 "2021-09-19T13:50:41Z")

</div>

I would like to purge Mediawiki and try again. When will this function be integrated in Plinth, I think there was a discussion about this?  
What happens, if I do an apt reinstall of Mediawiki? Will this help and keep the integrity of FBx?

---

<div class="post-metadata">

**Author:** ![Dietmar](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/d/c5a1d2/32.png) [@Dietmar](https://discuss.freedombox.org/u/Dietmar)\
**Post date:** [September 19, 2021, 4:20pm UTC](https://discuss.freedombox.org/t/mediawiki-error-500/1725/3 "2021-09-19T16:20:40Z")

</div>

I also followed the instructions in “[MediaWiki content gone, "History" shows DBQueryError - #2 by njoseph](https://discuss.freedombox.org/t/mediawiki-content-gone-history-shows-dbqueryerror/1703/2)” and I could change the admin password (previously got error “no such user” or so).  
I will NOT run restore but will copy content again manually.  
So the issue resolved - but not understood.

EDIT: funny, my wiki content is already back, I just have to upload the images.

---

<div class="post-metadata">

**Author:** ![lifeform](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/l/7ab992/32.png) [@lifeform](https://discuss.freedombox.org/u/lifeform)\
**Post date:** [November 1, 2021, 4:18pm UTC](https://discuss.freedombox.org/t/mediawiki-error-500/1725/4 "2021-11-01T16:18:03Z")

</div>

I got a 500 error while attempting to update the admin password (on bullseye), but for a different reason: “Passwords must be at least 10 characters. The password entered is in a list of very commonly used passwords. Please choose a more unique password”. The underlying problem seems to be that Mediawiki raises an exception when the password update fails and the exception isn’t getting caught and handled (presumably to display the message to the user). However, I also see [Issue 1260](https://salsa.debian.org/freedombox-team/freedombox/-/issues/1260), which suggests that FreedomBox admins should automatically be made MediaWiki admins, which would make the Mediawiki config admin password update function unnecessary (but not necessarily eliminate the need to catch password-related Mediawiki exceptions, depending on how Mediawiki admins are sync’d with Freedombox admins).

```
Oct 31 20:41:10 freedombox /usr/bin/plinth[23868]: Error executing command - ['sudo', '-n', '/usr/share/plinth/actions/mediawiki', 'change-password'], , * Passwords must be at least 10 characters.
        * The password entered is in a list of very commonly used passwords. Please choose a more unique password.
        Traceback (most recent call last):
          File "/usr/share/plinth/actions/mediawiki", line 266, in <module>
            main()
          File "/usr/share/plinth/actions/mediawiki", line 262, in main
            subcommand_method(arguments)
          File "/usr/share/plinth/actions/mediawiki", line 154, in subcommand_change_password
            subprocess.check_call([
          File "/usr/lib/python3.9/subprocess.py", line 373, in check_call
            raise CalledProcessError(retcode, cmd)
        subprocess.CalledProcessError: Command '['php7.4', '/usr/share/mediawiki/maintenance/changePassword.php', '--user', 'admin', '--password', 'abcd']' returned non-zero exit status 1.
						   
Oct 31 20:41:11 freedombox /usr/bin/plinth[23868]: Internal Server Error: /plinth/apps/mediawiki/
        Traceback (most recent call last):
          File "/usr/lib/python3/dist-packages/django/core/handlers/exception.py", line 34, in inner
            response = get_response(request)
          File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 115, in _get_response
            response = self.process_exception_by_middleware(e, request)
          File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 113, in _get_response
            response = wrapped_callback(request, *callback_args, **callback_kwargs)
          File "/usr/lib/python3/dist-packages/django/views/generic/base.py", line 71, in view
            return self.dispatch(request, *args, **kwargs)
          File "/usr/lib/python3/dist-packages/django/views/generic/base.py", line 97, in dispatch
            return handler(request, *args, **kwargs)
          File "/usr/lib/python3/dist-packages/plinth/views.py", line 168, in post
            return super().post(request, *args, **kwargs)
          File "/usr/lib/python3/dist-packages/django/views/generic/edit.py", line 142, in post
            return self.form_valid(form)
          File "/usr/lib/python3/dist-packages/plinth/modules/mediawiki/views.py", line 47, in form_valid
            actions.superuser_run('mediawiki', ['change-password'],
          File "/usr/lib/python3/dist-packages/plinth/actions.py", line 104, in superuser_run
            return _run(action, options, input, run_in_background, True,
          File "/usr/lib/python3/dist-packages/plinth/actions.py", line 200, in _run
            raise ActionError(action, output, error)
        plinth.errors.ActionError: ('mediawiki', '', '* Passwords must be at least 10 characters.\n* The password entered is in a list of very commonly used passwords. Please choose a more unique password.\nTraceback (most recent call last):\n File "/usr/share/plinth/actions/mediawiki", line 266, in <module>\n main()\n File "/usr/share/plinth/actions/mediawiki", line 262, in main\n subcommand_method(arguments)\n File "/usr/share/plinth/actions/mediawiki", line 154, in subcommand_change_password\n subprocess.check_call([\n File "/usr/lib/python3.9/subprocess.py", line 373, in check_call\n raise CalledProcessError(retcode, cmd)\nsubprocess.CalledProcessError: Command \'[\'php7.4\', \'/usr/share/mediawiki/maintenance/changePassword.php\', \'--user\', \'admin\', \'--password\', \'abcd\']\' returned non-zero exit status 1.\n')
```
