samba: error 500 in the app page when a non-existent user is in freedombox-share group
Error 500 in the Samba app page:
Mar 05 18:07:33 freedombox /usr/bin/plinth\[816155\]: Internal Server Error: /plinth/apps/samba/ Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 181, in \_get_response response = wrapped_callback(request, \*callback_args, \*\*callback_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/django/views/generic/base.py", line 70, in view return self.dispatch(request, \*args, \*\*kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/plinth/views.py", line 184, in dispatch return super().dispatch(request, \*args, \*\*kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/django/views/generic/base.py", line 98, in dispatch return handler(request, \*args, \*\*kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/django/views/generic/edit.py", line 133, in get return self.render_to_response(self.get_context_data()) ^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/plinth/modules/samba/views.py", line 81, in get_context_data context\['users'\] = samba.get_users() ^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/plinth/modules/samba/**init**.py", line 140, in get_users uid = pwd.getpwnam(group_user).pw_uid ^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: "getpwnam(): name not found: 'debian-deluged'"
System users may be removed when uninstalling an app or uninstalling packages manually. Avoid error 500 in the Samba app page when this happens.
Relates to #2410 (closed)