gitweb: Error when deleting repo when app is disabled
Gitweb still allows creating, editing, or deleting a repository when the app itself is disabled. Creating/editing seems ok, but the delete action will produce an error:
INFO plinth.actions # gitweb..delete_repo(…)
INFO plinth.actions # apache..enable(…)
ERROR plinth.actions Error running action apache..enable(*('gitweb-freedombox-auth', 'config'), **{}): Command '['a2enconf', 'gitweb-freedombox-auth']' returned non-zero exit status 1. (1, ['a2enconf', 'gitweb-freedombox-auth'], b'', b'ERROR: Conf gitweb-freedombox-auth does not exist!\n\x1b[31m ERROR\x1b[0m \x1b[94m__main__ \x1b[0m Error executing action: Command \'[\'a2enconf\', \'gitweb-freedombox-auth\']\' returned non-zero exit status 1.\nTraceback (most recent call last):\n File "/freedombox/actions/actions", line 93, in _call\n return_values = func(*arguments[\'args\'], **arguments[\'kwargs\'])\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/freedombox/plinth/modules/apache/privileged.py", line 154, in enable\n action_utils.webserver_enable(name, kind)\n File "/freedombox/plinth/action_utils.py", line 159, in webserver_enable\n subprocess.check_output([command_map[kind], name])\n File "/usr/lib/python3.11/subprocess.py", line 466, in check_output\n return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/usr/lib/python3.11/subprocess.py", line 571, in run\n raise CalledProcessError(retcode, process.args,\nsubprocess.CalledProcessError: Command \'[\'a2enconf\', \'gitweb-freedombox-auth\']\' returned non-zero exit status 1.\n') [' File "/freedombox/actions/actions", line 93, in _call\n return_values = func(*arguments[\'args\'], **arguments[\'kwargs\'])\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', ' File "/freedombox/plinth/modules/apache/privileged.py", line 154, in enable\n action_utils.webserver_enable(name, kind)\n', ' File "/freedombox/plinth/action_utils.py", line 159, in webserver_enable\n subprocess.check_output([command_map[kind], name])\n', ' File "/usr/lib/python3.11/subprocess.py", line 466, in check_output\n return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', ' File "/usr/lib/python3.11/subprocess.py", line 571, in run\n raise CalledProcessError(retcode, process.args,\n']
Internal Server Error: /plinth/apps/gitweb/Test-repo/delete/
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 "/freedombox/plinth/modules/gitweb/views.py", line 146, in delete
app.update_service_access()
File "/freedombox/plinth/modules/gitweb/__init__.py", line 114, in update_service_access
self._disable_public_access()
File "/freedombox/plinth/modules/gitweb/__init__.py", line 126, in _disable_public_access
self.auth_webserver.enable()
File "/freedombox/plinth/modules/gitweb/__init__.py", line 159, in enable
super().enable()
File "/freedombox/plinth/modules/apache/components.py", line 55, in enable
privileged.enable(self.web_name, self.kind)
File "/freedombox/plinth/actions.py", line 57, in wrapper
return _run_privileged_method_as_process(module_name, action_name,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/freedombox/plinth/actions.py", line 116, in _run_privileged_method_as_process
return _wait_for_return(*wait_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/freedombox/plinth/actions.py", line 154, in _wait_for_return
raise exception
subprocess.CalledProcessError: Command '['a2enconf', 'gitweb-freedombox-auth']' returned non-zero exit status 1.
ERROR django.request Internal Server Error: /plinth/apps/gitweb/Test-repo/delete/
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 "/freedombox/plinth/modules/gitweb/views.py", line 146, in delete
app.update_service_access()
File "/freedombox/plinth/modules/gitweb/__init__.py", line 114, in update_service_access
self._disable_public_access()
File "/freedombox/plinth/modules/gitweb/__init__.py", line 126, in _disable_public_access
self.auth_webserver.enable()
File "/freedombox/plinth/modules/gitweb/__init__.py", line 159, in enable
super().enable()
File "/freedombox/plinth/modules/apache/components.py", line 55, in enable
privileged.enable(self.web_name, self.kind)
File "/freedombox/plinth/actions.py", line 57, in wrapper
return _run_privileged_method_as_process(module_name, action_name,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/freedombox/plinth/actions.py", line 116, in _run_privileged_method_as_process
return _wait_for_return(*wait_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/freedombox/plinth/actions.py", line 154, in _wait_for_return
raise exception
subprocess.CalledProcessError: Command '['a2enconf', 'gitweb-freedombox-auth']' returned non-zero exit status 1.
Probably related to #2349.