vinifmor / bauh

Graphical user interface for managing your Linux applications. Supports AppImage, Debian and Arch packages (including AUR), Flatpak, Snap and native Web applications
zlib License
931 stars 71 forks source link

crash when updateing AppImages #321

Open hg42 opened 1 year ago

hg42 commented 1 year ago

Install the staging branch

done

Describe the bug

when updating AppImages (as root to the system, either sudo or via ssh), after confirming the update list, bauh just closes (crash), however, when restarting bauh, the first app seems to be installed (usually it works then, may be it's sometimes partly installed, and sometimes there is no trace of the app)

it also happens for single AppImage updates note: installing from a file works, though I didn't try updates from file yet I am just starting with bauh, so I imported all my older AppImages and updated them later. It also happened with a new update today.

It's not easy to test, you have to get or store some older AppImages, because import+update removes them. My old saved AppImages are also a bit problematic, they are somehow different, then current AppImages, I guess the format changed. I still need to test if update button and update from file do the same thing.

The problem seems to be this in all cases:

Traceback (most recent call last):
  File "/z/src/bauh/venv/lib/python3.11/site-packages/bauh/view/qt/thread.py", line 552, in run
    success = bool(self.manager.upgrade(requirements, root_password, self))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/z/src/bauh/venv/lib/python3.11/site-packages/bauh/view/core/controller.py", line 297, in upgrade
    res = man.upgrade(man_reqs, root_password, handler)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/z/src/bauh/venv/lib/python3.11/site-packages/bauh/gems/appimage/controller.py", line 384, in upgrade
    if not self._install(pkg=req.pkg, watcher=watcher, pre_downloaded_file=download_data).success:
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/z/src/bauh/venv/lib/python3.11/site-packages/bauh/gems/appimage/controller.py", line 598, in _install
    downloaded, file_name = True, pkg.local_file_path.split('/')[-1]
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'split'
Fatal Python error: Aborted

Current thread 0x00007f6b01ffb6c0 (most recent call first):
  <no Python frame>

Thread 0x00007f6b24ff96c0 (most recent call first):
  File "/z/src/bauh/venv/lib/python3.11/site-packages/bauh/view/qt/thread.py", line 844 in run

Thread 0x00007f6b25ffb6c0 (most recent call first):
  File "/z/src/bauh/venv/lib/python3.11/site-packages/bauh/view/qt/thread.py", line 844 in run

Thread 0x00007f6b3d7fc6c0 (most recent call first):
  File "/z/src/bauh/venv/lib/python3.11/site-packages/bauh/view/util/cache.py", line 96 in run
  File "/usr/lib/python3.11/threading.py", line 1038 in _bootstrap_inner
  File "/usr/lib/python3.11/threading.py", line 995 in _bootstrap

Thread 0x00007f6b9ebb4040 (most recent call first):
  File "/z/src/bauh/venv/lib/python3.11/site-packages/bauh/app.py", line 67 in main
  File "/z/src/bauh/venv/bin/bauh", line 33 in <module>

Extension modules: PyQt5.QtCore, yaml._yaml, PyQt5.QtGui, PyQt5.QtWidgets, charset_normalizer.md, PyQt5.QtNetwork (total: 6)
zsh: IOT instruction  sudo venv/bin/bauh

Software Environment bauh version: bauh-0.10.6 O.S: name and version: Debian testing (carefully mixed with other sources) Python version: 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux Installation method: AppImage for bauh-0.10.5 release and for the staging version the method described in new issues form (where else do I find this?)

hg42 commented 1 year ago

the AppImages, that did not upgrade created empty directories in /usr/local/share/bauh/appimage/installed currently with staging bauh-0.10.6 all apps, I try to upgrade (from my old version), create the empty directory and fail to install. Looks like a difference between 0.10.5 and staging?

I cannot compare with bauh-0.10.5 currently, because it crashes when clicking on the "click here to select" box. Staging does not do that. However, file selection worked before with bauh-0.10.5, so I'm a bit confused how this can be.


On further testing, using the downgrade function on an AppImage and then upgrading again works for all apps I tried.

It seems the older AppImages are the problem (thought they have the same version).

I tried with Stacer 1.0.9 which I probably downloaded from AppImageHub at some time. If I update this, it crashes. If I install Stacer via bauh and downgrade it, an upgrade doesn't crash.


I installed 1.0.9 both ways and saved the files. If installing the crashing version and replacing the json file by the working version, it works (tested in staging).

data.json---works.zip data.json--crash.zip


no... replacing the json didn't work, it didn't install the upgraded version... but it didn't crash


also wrong... it installed the new version in another directory (stacer-0), but didn't remove the old one, so it was still shown as upgradable (so I thought the new version wouldn't exist)

hg42 commented 1 year ago

ok, I repeated that. It works normally, if I replace the file with the working version and change install_dir to the correct value (stacer in the test instead of stacer-0 in the working version).

If I do the opposite: installing stacer via bauh + downgrade and replacing categories... with "categories": ["Imported"], "imported": true,, it crashes.

data.json--only-imported.zip

vinifmor commented 1 year ago

I believe this specific case happened because the AppImage (stacer) was initially imported, but now it is also available on bauh's database. If you uninstall it, and reinstall it via the search mechanism, does the issue happen as well ?

vinifmor commented 1 year ago

That's exactly the case... I've firstly imported the file, and then tried to upgrade it and got the crash. I'm going to provide a fix. Thank you for reporting the issue.

hg42 commented 12 months ago

yes, exactly, all packages at that point were imported:

I am just starting with bauh, so I imported all my older AppImages and updated them later.

and this was an update of an imported, package either (note: a new update, but not a new package):

It also happened with a new update today.

after all imported packages were uninstalled and reinstalled, it did not happen again

thanks for the good work

vinifmor commented 12 months ago

no worries... just pushed a fix to the staging branch... the final release should be available soon