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 with empty appimage url #207

Closed
Flash1232 opened this issue Nov 17, 2021 · 8 comments
Closed

bauh crashes with empty appimage url #207

Flash1232 opened this issue Nov 17, 2021 · 8 comments
Labels
bug Something isn't working

Comments

@Flash1232
Copy link

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
App crashes when AppImage url is suddenly empty (no idea how that could happen).

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/bauh/view/qt/thread.py", line 435, 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 576, in get_upgrade_requirements
    man_reqs = man.get_upgrade_requirements(pkgs, root_password, watcher)
  File "/usr/lib/python3.9/site-packages/bauh/gems/appimage/controller.py", line 791, in get_upgrade_requirements
    installed_size = self.http_client.get_content_length_in_bytes(pkg.url_download)
  File "/usr/lib/python3.9/site-packages/bauh/api/http.py", line 76, in get_content_length_in_bytes
    res = self.session.get(**params)
  File "/usr/lib/python3.9/site-packages/requests/sessions.py", line 555, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python3.9/site-packages/requests/sessions.py", line 528, in request
    prep = self.prepare_request(req)
  File "/usr/lib/python3.9/site-packages/requests/sessions.py", line 456, in prepare_request
    p.prepare(
  File "/usr/lib/python3.9/site-packages/requests/models.py", line 316, in prepare
    self.prepare_url(url, params)
  File "/usr/lib/python3.9/site-packages/requests/models.py", line 390, in prepare_url
    raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL 'None': No schema supplied. Perhaps you meant http://None?
Fatal Python error: Aborted

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

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

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

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

Thread 0x00007f6549768640 (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 973 in _bootstrap_inner
  File "/usr/lib/python3.9/threading.py", line 930 in _bootstrap

Thread 0x00007f6561fdc740 (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]    56866 abort (core dumped)  bauh

Software Environment
bauh version: 0.9.21-staging
O.S: 5.10.70-1-MANJARO
Python version: v3.9.7
Installation method: pacman

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

I've opened a PR with a workaround that solves the issue for me, although it is not clear to me how the underlying issue came to be in the first place. Maybe there is a better solution for this...

@vinifmor
Copy link
Owner

Hi @Flash1232 , that's a bug for sure. What application were you trying to install ?

@vinifmor vinifmor added the bug Something isn't working label Nov 17, 2021
@Flash1232
Copy link
Author

It is a Joplin AppImage (v2.4.12 installed, should be upgraded to v2.5.12)

@vinifmor
Copy link
Owner

@Flash1232 it is a bug associated with the backend script responsible for mapping the AppImage database (it is not checking if the release URL is none). The fix has been applied and in a few hours the AppImage database should be updated.

I've also provided added some handling on the client side (bauh) to avoid this sort of issues:
46a3b46
e930a97

You can install the staging branch through AUR (bauh-staging) for testing.

I suggest to reinstall this AppImage in 3 or 4 hours and use the staging branch to see if the issue has been fixed.

@Flash1232
Copy link
Author

Thanks for the feedback and quick fix!
I will try that in a couple hours then and let you know.

@Flash1232
Copy link
Author

Flash1232 commented Nov 17, 2021

The issue seems to have been solved, no further crashes occurred and I was then able to install the new Joplin AppImage.
There seems to be some (I think) unrelated issue now that results in this. I will try to find the offending package as no useful logs are generated for it. Is there any way to de-select all packages for upgrade? I often end up going with 50 clicks or so when I want just one package updated.

EDIT: After trying again with the OLD image this happened:

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/bauh/view/qt/thread.py", line 523, 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/appimage/controller.py", line 366, in upgrade
    if not self.install(req.pkg, root_password, None, watcher).success:
  File "/usr/lib/python3.9/site-packages/bauh/gems/appimage/controller.py", line 509, 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 0x00007f47beffd640 (most recent call first):
<no Python frame>

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

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

Thread 0x00007f4805596640 (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 973 in _bootstrap_inner
  File "/usr/lib/python3.9/threading.py", line 930 in _bootstrap

Thread 0x00007f480fd40740 (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]    555760 abort (core dumped)  bauh --logs

@vinifmor
Copy link
Owner

It seems the first issue you have pointed allowed the second to happen. In other words: bauh failed to download the image, and it seems the previous installed file was erased (then the second issue happened). I'm going to debug this scenario.

About your question related to selecting packages to upgrade: there is no button to "select/unselect all", but bauh just upgrades what's been currently displayed on the table (WYSWYG). So just filter the package you want to upgrade by its name.

@vinifmor
Copy link
Owner

@Flash1232 , last bug discussed is fixed on the staging branch: 65df765 (already available in AUR)

I suggest disabling multi-threaded download for now since it is failing to download some AppImages from GitHub.

@vinifmor vinifmor mentioned this issue Nov 20, 2021
@vinifmor vinifmor removed the staging label Nov 20, 2021
@Flash1232
Copy link
Author

Sorry for the delayed answer, I appreciate your thorough explanations and quick response! :)

About your question related to selecting packages to upgrade: there is no button to "select/unselect all", but bauh just upgrades what's been currently displayed on the table (WYSWYG). So just filter the package you want to upgrade by its name.

That's great to know!

I was unable to reproduce any bugs with the current staging branch so I think the issue is well resolved.

Thank you again!

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

No branches or pull requests

2 participants