Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bauh crashes on upgrading apps #164

Closed
Flash1232 opened this issue Jan 13, 2021 · 29 comments
Closed

Bauh crashes on upgrading apps #164

Flash1232 opened this issue Jan 13, 2021 · 29 comments
Labels
bug Something isn't working staging

Comments

@Flash1232
Copy link

Flash1232 commented Jan 13, 2021

Before opening a new issue
Install the staging branch and check if the unexpected behavior is happening there as well.
If you are on ArchLinux-based distro, you can install it through AUR (bauh-staging). Otherwise, you have
to clone the repository and install it with pip:

git clone https://github.com/vinifmor/bauh.git -b staging --depth=1
cd bauh
python3 -m venv venv
venv/bin/pip install pip --upgrade
venv/bin/pip install setuptools --upgrade
venv/bin/pip install -r requirements.txt
venv/bin/pip install .
venv/bin/bauh  # or venv/bin/bauh-tray

Describe the bug
Bauh crashes when upgrading all checked applications. It happens only in conjunction with these packages:
image

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/bauh/view/qt/thread.py", line 425, in run
    requirements = self.manager.get_upgrade_requirements(models, root_password, self)
  File "/usr/lib/python3.9/site-packages/bauh/view/core/controller.py", line 556, in get_upgrade_requirements
    man_reqs = man.get_upgrade_requirements(pkgs, root_password, watcher)
  File "/usr/lib/python3.9/site-packages/bauh/gems/flatpak/controller.py", line 596, in get_upgrade_requirements
    sizes = flatpak.map_update_download_size([str(p.id) for p in apps_by_install[0]], apps_by_install[1], flatpak_version)
  File "/usr/lib/python3.9/site-packages/bauh/gems/flatpak/flatpak.py", line 414, in map_update_download_size
    size = p2.findall(line_split[6])[0].split('?')
IndexError: list index out of range
Fatal Python error: Aborted

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

Thread 0x00007fbbeb7fe640 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/view/qt/thread.py", line 804 in run

Thread 0x00007fbc0d485640 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/view/qt/thread.py", line 804 in run

Thread 0x00007fbbeaffd640 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/view/qt/prepare.py", line 111 in run

Thread 0x00007fbc04b91640 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/gems/appimage/worker.py", line 109 in run
  File "/usr/lib/python3.9/threading.py", line 954 in _bootstrap_inner
  File "/usr/lib/python3.9/threading.py", line 912 in _bootstrap

Thread 0x00007fbc0dc86640 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/view/util/cache.py", line 95 in run
  File "/usr/lib/python3.9/threading.py", line 954 in _bootstrap_inner
  File "/usr/lib/python3.9/threading.py", line 912 in _bootstrap

Thread 0x00007fbc1b5b8740 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/app.py", line 54 in main
  File "/usr/bin/bauh", line 33 in <module>
[1]    9802 abort (core dumped)  bauh

Software Environment
bauh version: 0.9.10-1 (tested up to 0.9.12.RC-4)
O.S: Manjaro Linux 5.4.85-1-MANJARO
Python version: 3.9.1 (GCC 10.2.0)
Installation method: pacman

P.S: these instructions and the template must be respected, otherwise your issue will be closed.

@vinifmor
Copy link
Owner

@Flash1232 thanks for reporting the issue. I'm going to investigate the cause and publish a fix ASAP.

@vinifmor vinifmor added bug Something isn't working flatpak labels Jan 13, 2021
@PrzemekSkw
Copy link

Hi, I have the sam problem on EndevourOS [archlinux].
Python 3.9.1

In terminal after click upgrade in bauh:

[mariank@marian-dell ~]$ bauh
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/bauh/view/qt/thread.py", line 425, in run
    requirements = self.manager.get_upgrade_requirements(models, root_password, self)
  File "/usr/lib/python3.9/site-packages/bauh/view/core/controller.py", line 579, in get_upgrade_requirements
    man_reqs = man.get_upgrade_requirements(pkgs, root_password, watcher)
  File "/usr/lib/python3.9/site-packages/bauh/gems/flatpak/controller.py", line 604, in get_upgrade_requirements
    sizes = flatpak.map_update_download_size([str(p.id) for p in apps_by_install[0]], apps_by_install[1], flatpak_version)
  File "/usr/lib/python3.9/site-packages/bauh/gems/flatpak/flatpak.py", line 415, in map_update_download_size
    size = p2.findall(line_split[6])[0].split('?')
IndexError: list index out of range
Fatal Python error: Aborted

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

Thread 0x00007f4460ff9640 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/view/qt/thread.py", line 804 in run

Thread 0x00007f4462ffd640 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/view/qt/thread.py", line 804 in run

Thread 0x00007f443e7fc640 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/view/qt/prepare.py", line 138 in run

Thread 0x00007f4463fff640 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/view/util/cache.py", line 96 in run
  File "/usr/lib/python3.9/threading.py", line 954 in _bootstrap_inner
  File "/usr/lib/python3.9/threading.py", line 912 in _bootstrap

Thread 0x00007f4499f40740 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/app.py", line 54 in main
  File "/usr/bin/bauh", line 33 in <module>
Aborted (memory dump)

Regards.

@vinifmor
Copy link
Owner

@Flash1232 @PrzemekSkw , I've just publish a possible fix for this issue on the staging branch. It is already available in AUR (bauh-staging). Please, give me a feedback if its working on your ends.

@Flash1232
Copy link
Author

This is indeed fixed in the latest staging release (at least for me). Thanks so much! 😃

@PrzemekSkw
Copy link

@vinifmor Hi, I have checked on my Ubuntu Laptop at home and everything is OK. I cannot check my arch laptop because it is in work. Thanks in advance.
Regards Przemek.

@vinifmor
Copy link
Owner

Great! Thanks for the feedback, @PrzemekSkw . I'm going to hold this issue open until the final 0.9.12 release.

@PrzemekSkw
Copy link

@vinifmor Hi, today I noticed problem in my Ubuntu. I see there's 0.9.11 version when I run bauh but when I install I see:
Successfully installed bauh-0.9.13.
First I upgrade, next I purge bauh and install fresh.
Regards,
Przemek

@vinifmor
Copy link
Owner

@PrzemekSkw , I'm not sure if I understood the issue. Were you trying to upgrade bauh through the command line and it did not work properly ? (sudo pip3 install bauh --upgrade)

@PrzemekSkw
Copy link

@vinifmor Yes, I also try to upgrade but I still have older version.

@vinifmor
Copy link
Owner

vinifmor commented Jan 29, 2021

@PrzemekSkw , it may be an issue with the Ubuntu's pip version. Does it work if you uninstall and reinstall it again ?

sudo pip3 uninstall bauh -y
sudo pip3 install bauh --upgrade

@PrzemekSkw
Copy link

@vinifmor Hi, I make a screenshots:
Zrzut ekranu z 2021-01-31 22-51-26
Zrzut ekranu z 2021-01-31 22-52-24

@vinifmor
Copy link
Owner

vinifmor commented Feb 1, 2021

That's odd. It is updating fine on my Ubuntu machine. What are the outputs of bauh --version and which bauh ?

@Flash1232
Copy link
Author

Flash1232 commented Feb 1, 2021

Might be unrelated to the previous issue, but I have another weird crash for the 'pdfsam' package (AUR - community) when attempting to upgrade the app:

error: package 'pdfsam' was not found
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/bauh/view/qt/thread.py", line 425, in run
    requirements = self.manager.get_upgrade_requirements(models, root_password, self)
  File "/usr/lib/python3.9/site-packages/bauh/view/core/controller.py", line 579, in get_upgrade_requirements
    man_reqs = man.get_upgrade_requirements(pkgs, root_password, watcher)
  File "/usr/lib/python3.9/site-packages/bauh/gems/arch/controller.py", line 3030, in get_upgrade_requirements
    return summarizer.summarize(pkgs, root_password, arch_config)
  File "/usr/lib/python3.9/site-packages/bauh/gems/arch/updates.py", line 400, in summarize
    context.pkgs_data.update(pacman.map_updates_data(context.repo_to_update.keys()))
TypeError: 'NoneType' object is not iterable
Fatal Python error: Aborted

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

Thread 0x00007fb26f7fe640 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/view/qt/thread.py", line 809 in run

Thread 0x00007fb289ffb640 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/view/qt/thread.py", line 809 in run

Thread 0x00007fb28b7fe640 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/view/qt/prepare.py", line 139 in run

Thread 0x00007fb2b1705640 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/view/util/cache.py", line 96 in run
  File "/usr/lib/python3.9/threading.py", line 954 in _bootstrap_inner
  File "/usr/lib/python3.9/threading.py", line 912 in _bootstrap

Thread 0x00007fb2bb634740 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/app.py", line 54 in main
  File "/usr/bin/bauh", line 33 in <module>
[1]    34298 abort (core dumped)  bauh

I can launch the package from within bauh without problems, just upgrading crashes bauh.
Specs as in first post except Bauh version is now 0.9.13-2

@PrzemekSkw
Copy link

PrzemekSkw commented Feb 1, 2021

That's odd. It is updating fine on my Ubuntu machine. What are the outputs of bauh --version and which bauh ?

~$ bauh --version
bauh 0.9.11
$ which bauh
/usr/local/bin/bauh

Edit. I make bauh --reset and delete all bauh folders from HDD. Install fresh and now I have 0.9.13 :)
Regards.

@vinifmor
Copy link
Owner

vinifmor commented Feb 1, 2021

@Flash1232 , I'm going to have a look here.

@PrzemekSkw , great that your sorted the issue out.

@vinifmor
Copy link
Owner

vinifmor commented Feb 1, 2021

@Flash1232 , I've published a possible fix on the staging branch. It is already available in AUR (bauh-staging). Can you give me a feedback if it is working on your end ?

@Flash1232
Copy link
Author

@vinifmor Thanks for your speedy response! Unfortunately the error still persists with bauh-staging 0.9.14.RC-2:

error: package 'pdfsam' was not found
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/bauh/view/qt/thread.py", line 425, in run
    requirements = self.manager.get_upgrade_requirements(models, root_password, self)
  File "/usr/lib/python3.9/site-packages/bauh/view/core/controller.py", line 579, in get_upgrade_requirements
    man_reqs = man.get_upgrade_requirements(pkgs, root_password, watcher)
  File "/usr/lib/python3.9/site-packages/bauh/gems/arch/controller.py", line 3030, in get_upgrade_requirements
    return summarizer.summarize(pkgs, root_password, arch_config)
  File "/usr/lib/python3.9/site-packages/bauh/gems/arch/updates.py", line 438, in summarize
    res.to_upgrade = [self._map_requirement(pkg, context, installed_sizes) for pkg in sorted_pkgs]
  File "/usr/lib/python3.9/site-packages/bauh/gems/arch/updates.py", line 438, in <listcomp>
    res.to_upgrade = [self._map_requirement(pkg, context, installed_sizes) for pkg in sorted_pkgs]
  File "/usr/lib/python3.9/site-packages/bauh/gems/arch/updates.py", line 330, in _map_requirement
    data = context.pkgs_data[pkg.name]
KeyError: 'pdfsam'
Fatal Python error: Aborted

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

Thread 0x00007fa6296fa640 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/view/qt/thread.py", line 809 in run

Thread 0x00007fa648cdf640 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/view/qt/thread.py", line 809 in run

Thread 0x00007fa649ce1640 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/view/qt/prepare.py", line 139 in run

Thread 0x00007fa658819640 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/view/util/cache.py", line 96 in run
  File "/usr/lib/python3.9/threading.py", line 954 in _bootstrap_inner
  File "/usr/lib/python3.9/threading.py", line 912 in _bootstrap

Thread 0x00007fa668660740 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/app.py", line 54 in main
  File "/usr/bin/bauh", line 33 in <module>
[1]    63046 abort (core dumped)  bauh

@vinifmor vinifmor reopened this Feb 3, 2021
@vinifmor
Copy link
Owner

vinifmor commented Feb 3, 2021

@Flash1232 , no worries. Let's fix this. I've just pushed another possible fix to bauh-staging. Could you try it again ?

@Flash1232
Copy link
Author

Flash1232 commented Feb 3, 2021

We're getting closer, at least it crashes only after the upgrade summary dialog now. :) (0.9.14.RC-3)

error: package 'pdfsam' was not found
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 3048, resource id: 10723348, major code: 40 (TranslateCoords), minor code: 0
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/bauh/view/qt/thread.py", line 510, in run
    success = bool(self.manager.upgrade(requirements, root_password, self))
  File "/usr/lib/python3.9/site-packages/bauh/view/core/controller.py", line 288, in upgrade
    res = man.upgrade(man_reqs, root_password, handler)
  File "/usr/lib/python3.9/site-packages/bauh/gems/arch/controller.py", line 1167, in upgrade
    if not self._upgrade_repo_pkgs(to_upgrade=[p.name for p in repo_pkgs],
  File "/usr/lib/python3.9/site-packages/bauh/gems/arch/controller.py", line 994, in _upgrade_repo_pkgs
    downloaded = self._download_packages(pkgnames=to_upgrade_remaining,
  File "/usr/lib/python3.9/site-packages/bauh/gems/arch/controller.py", line 2273, in _download_packages
    return download_service.download_packages(pkgs=pkgnames,
  File "/usr/lib/python3.9/site-packages/bauh/gems/arch/download.py", line 163, in download_packages
    for pkg in pkgs_data:
TypeError: 'NoneType' object is not iterable
Fatal Python error: Aborted

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

Thread 0x00007faec6ffd640 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/view/qt/thread.py", line 809 in run

Thread 0x00007faf02d88640 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/view/qt/thread.py", line 809 in run

Thread 0x00007faf03589640 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/view/qt/prepare.py", line 139 in run

Thread 0x00007faf110f6640 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/view/util/cache.py", line 96 in run
  File "/usr/lib/python3.9/threading.py", line 954 in _bootstrap_inner
  File "/usr/lib/python3.9/threading.py", line 912 in _bootstrap

Thread 0x00007faf20ffd740 (most recent call first):
  File "/usr/lib/python3.9/site-packages/bauh/app.py", line 54 in main
  File "/usr/bin/bauh", line 33 in <module>
[1]    12308 abort (core dumped)  bauh

@vinifmor vinifmor removed the done label Feb 3, 2021
@vinifmor vinifmor added staging and removed flatpak labels Feb 3, 2021
@vinifmor
Copy link
Owner

vinifmor commented Feb 3, 2021

@Flash1232 , just pushed another fix to bauh-staging. Could you print the response of the following commands here as well ?

cat ~/.cache/bauh/arch/installed/pdfsam/data.json
pacman -Qi pdfsam

@Flash1232
Copy link
Author

~ cat ~/.cache/bauh/arch/installed/pdfsam/data.json
{"maintainer": "community", "command": "pdfsam", "icon_path": "pdfsam", "repository": "community", "desktop_entry": "/usr/share/applications/pdfsam.desktop"}%                                                      
➜  ~ pacman -Qi pdfsam
Name            : pdfsam
Version         : 4.2.1-3
Description     : A free open source tool to split and merge pdf documents
Architecture    : any
URL             : https://www.pdfsam.org/
Licenses        : AGPL3
Groups          : None
Provides        : None
Depends On      : hicolor-icon-theme  java-environment>=11  sh  unzip
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 26.11 MiB
Packager        : Unknown Packager
Build Date      : Di 19 Jan 2021 11:58:30
Install Date    : Di 19 Jan 2021 11:59:07
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : None

Now bauh doesn't seem to crash anymore, and now there is a graceful exception and error dialog.

@vinifmor
Copy link
Owner

vinifmor commented Feb 3, 2021

@Flash1232 Were you able to upgrade your packages ?

@Flash1232
Copy link
Author

Flash1232 commented Feb 3, 2021

I was able to upgrade the package to 4.2.2 with pamac, but not with bauh. Bauh would give me an error dialog and print error: package 'pdfsam' was not found to the console.

@vinifmor
Copy link
Owner

vinifmor commented Feb 3, 2021

I see. Well, this is odd. I'm going to perform more testing related to package upgrading to see if I find out the reason. But the crash is fixed at least.

@Flash1232
Copy link
Author

Thanks a lot for your time and yeah it's great that the exception is now caught properly which is the main thing :)
Bauh is really great! I enjoy its sheer simplicity, customizability and speed.

@vinifmor
Copy link
Owner

vinifmor commented Feb 3, 2021

Thank you @Flash1232 . It's nice when people actually report the bugs instead of dropping the tool. bauh has to handle complex scenarios that are not always caught during testing. Thanks helping the project.

@vinifmor vinifmor closed this as completed Feb 3, 2021
@vinifmor
Copy link
Owner

vinifmor commented Feb 3, 2021

@Flash1232 , just a doubt: do you have AUR manually added to pacman configuration files or only use it through bauh/pamac ?

@vinifmor vinifmor mentioned this issue Feb 3, 2021
@Flash1232
Copy link
Author

Flash1232 commented Feb 3, 2021

I enabled AUR in both pamac and bauh, my pacman.conf has no AUR configuration.

@vinifmor
Copy link
Owner

vinifmor commented Feb 3, 2021

It can be a cache related issue. Try removing the Arch cache (rm -rf ~/.cache/bauh/arch/installed) and launch bauh to regenerate it. If you face the same upgrade problem in the future, open a new Github issue, please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working staging
Projects
None yet
Development

No branches or pull requests

3 participants