[Solved] Error when uninstalling Tor and Tor Proxy

I am uninstalling infrequently used apps to reduce problems from possibly overloading the system.

When I uninstall Tor and Tor Proxy via Plinth, I get the following errors:

Error:
Error uninstalling app: [Errno 2] No such file or directory Details

Error running action: tor..uninstall(): FileNotFoundError(2, "No such file or directory")
Action traceback:
╞   File "/usr/lib/python3/dist-packages/plinth/actions.py", line 501, in _privileged_call
╞     return_values = func(*arguments['args'], **arguments['kwargs'])
╞   File "/usr/lib/python3/dist-packages/plinth/modules/tor/privileged.py", line 497, in uninstall
╞     os.unlink(f'/var/run/tor-instances/{INSTANCE_NAME}.defaults')
╞     ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error uninstalling app: [Errno 2] No such file or directory Details

Error running action: torproxy..uninstall(): FileNotFoundError(2, "No such file or directory")
Action traceback:
╞   File "/usr/lib/python3/dist-packages/plinth/actions.py", line 501, in _privileged_call
╞     return_values = func(*arguments['args'], **arguments['kwargs'])
╞   File "/usr/lib/python3/dist-packages/plinth/modules/torproxy/privileged.py", line 193, in uninstall
╞     os.unlink(f'/var/run/tor-instances/{INSTANCE_NAME}.defaults')
╞     ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Any suggestions for how to resolve these issues?

You can try creating “dummy” files for the files that are missing:

$ sudo touch /var/run/tor-instances/plinth.defaults
$ sudo touch /var/run/tor-instances/fbxproxy.defaults

And then uninstall the apps again.

I’m working on a code change to ignore the missing files when uninstalling:

However I’m not sure how your system ended up in this state.

2 Likes

Thank you, this solved the issue. I do not know how the system got in this state.

The patch is now merged. It should available in next release.

Looks like a fresh install in Trixie does not create the .defaults files.