Hello all,
I made a mistake while trying to do some Python3 stuff (pip3), and now I have missing Python packages that are part of Yunohost in
/usr/lib/python3/dist-packages/yunohost/
My YunoHost server
Hardware: on-premise Old computer amd64 YunoHost version: 11.1.1.2 (Bullseye) I have access to my server : ANY/ALL (Through SSH | through the webadmin | direct access via keyboard / screen) Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : yes If yes, please explain:: Broke the system using Python3 PIP
Description of my issue
While using pip3, I mistakenly removed python3 packages that are required by Yunohost normal operation.
Example:
File "/usr/lib/python3/dist-packages/yunohost/service.py", line 370, in _get_service_information_from_systemd
import dbus
ModuleNotFoundError: No module named dbus
Debian Dbus is running, but there’s no dbus.py in python3/dist-packages/yunohost.
# yunohost tools upgrade system gives “Nothing to do. Everything is already up-to-date”
# apt install python3-dbus gives “already the newest version”
Running the Diagnosis from the web interface gives:
**Action**: "PUT" /yunohost/api/diagnosis/run?except_if_never_ran_yet
**Error message:**
Failed to load diagnoser dnsrecords : deprecated() got an unexpected keyword argument 'name'
Solution
Is there a safe (preserve existing system configurations) way to run the # yunohost something something to check / reinstall the Yunohost base system python packahes?
If not, is there a list of yunohost-python-packages that I could manually or bash script (I can write that myself) check for missing then reinstall?
File /usr/local/lib/python3.9/dist-packages/OpenSSL/crypto.py, line 3224, in <module> utils.deprecated(
TypeError: deprecated() got an unexpected keyword argument name
pip install --force-reinstall pyopenssl -> ERROR: Cannot uninstall pycparser. It is a distutils installed...
Going through /var/log folders, I see that installed Apps work, but they register several errors. The Searx app gave internal server error, so I did yunohost app remove searx & re-installed from cli. The App now works.
Did not mention this in original post as I did not deem relevant, but Mariadb had serious corruption that that I could not repair. So I did a zfs rollback of the snapshot I had taken 1 day prior (mirrored ZFS on separate HDD than yunohost /). But I now see “version mismatch” error in logs for installed Apps (see # 3). mysqlcheck --auto-repair --all-databases returns normal since before posting this thread.
I’m hoping there’s a yunohost cli command that can softly (without resetting database entries) reinstall / upgrade to latest version for all installed apps?
If you have a partial answer, please indicate item number from above problem list.