Broke my Yunohost system, how to fix (python3/dist-packages/yunohost)?

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

  1. Is there a safe (preserve existing system configurations) way to run the # yunohost something something to check / reinstall the Yunohost base system python packahes?
  2. 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?

Thank you for your help.

Can’t you restore a recent system backup ?

/home/yunohost.* has backup & conf folders.
backup has installed app tar files, while
conf only has etc & var folders.

Since the problem is with /usr/lib/python3 I don’t see how, unless yunohost creates backups of the /usr folder… If it does, where is it?

You can probably run apt install python3-dbus --reinstall

Thanks for the suggestion, which fixed the Dbus error.

However, I have continuing other errors (Admins: advise if I should open a different thread for this).

Other Errors:

  1. User panel shows installed apps, but admin panel Applications gives “There are no installed apps” - even though I just reinstalled Searx (see #3)
  2. Domains gives error below. Reinstalled python3-urllib3, openssl
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...

  1. 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.
  2. 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.

Thank you for your help.

I had to do a clean install to fix

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.