bottlesdevs / Bottles

Run Windows software and games on Linux
https://usebottles.com
GNU General Public License v3.0
6.21k stars 258 forks source link

[BUG] Bottles Applmage Always Silently Fails on Cold Start #481

Closed lfom closed 2 years ago

lfom commented 3 years ago

Describe the bug After Bottles hasn't been run for a while, it silently fails to launch. Starting it a second time works fine.

Installation

To Reproduce The problem happens if a new version is installed, after the computer is restarted or simply when Bottles hasn't been run for a long time (maybe the issue is related to disk cache/speed somehow?).

Expected behavior Bottles should launch every time it is started.

Screenshots N/A

Desktop (please complete the following information):

Additional context In the first launch from terminal, it shows:

Unable to read file: /tmp/.mount_bottleylJovr//opt/libc/lib/ld-linux.so.2

I have seen other Bottles issues related to ld-linux.so.2, using both AppImage and Flatpak, so maybe something needs to be fixed in the way app loads.

Thanks for maintaining Bottles!

mirkobrombin commented 3 years ago

Thanks for reporting, do you have any links from others who have had such problems with other applications?

lfom commented 3 years ago

@mirkobrombin Sorry, I think I wasn't clear: I meant I have seen other Bottle issues related to ld-linux.so.2, not any other apps. All other AppImages I run here do not have this problem.

Screenshot from 2021-08-21 18-10-39

mirkobrombin commented 3 years ago

Ah ok I got it. I was able to replicate the bug but I think it will take me some time to investigate.

lfom commented 3 years ago

I have updated the text to make it clear. It is a minor issue, just a bit annoying. I just felt I should report it anyway, specially after I found other issues related told-linux.so.2 while trying to see if the same issue was reported already. Thanks again. Regards

mirkobrombin commented 3 years ago

I have updated the text to make it clear. It is a minor issue, just a bit annoying. I just felt I should report it anyway, specially after I found other issues related told-linux.so.2 while trying to see if the same issue was reported already. Thanks again. Regards

I have an idea about the possible cause and will do some experiments in the day

mirkobrombin commented 3 years ago

Maybe related: https://github.com/AppImageCrafters/appimage-builder/issues/43

FilBot3 commented 3 years ago

I ran into the same error when downloading through my Firefox web browser on Fedora 34. I then used wget when I wanted to open an issue, but this time got different results. I was able to load the AppImage, but then when I tried to create my Software Bottle, it hung on downloading DXVK for a long while (30min) where the Flatpak did it in about 20sec. Below I have the terminal output of what I was doing.

```bash ➜ Downloads wget https://github.com/bottlesdevs/Bottles/releases/download/2021.8.28-treviso/Bottles-2021.8.28-treviso-x86_64.AppImage --2021-08-28 09:06:25-- https://github.com/bottlesdevs/Bottles/releases/download/2021.8.28-treviso/Bottles-2021.8.28-treviso-x86_64.AppImage Resolving github.com (github.com)... 140.82.113.3 Connecting to github.com (github.com)|140.82.113.3|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://github-releases.githubusercontent.com/106949285/3e6a6826-d93c-4a05-adc6-38636916b66b?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210828%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210828T140625Z&X-Amz-Expires=300&X-Amz-Signature=e38af4d864beabcb63bea3afcdf841f4e439f1cd52b923ba88d9b858fbbee5fc&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=106949285&response-content-disposition=attachment%3B%20filename%3DBottles-2021.8.28-treviso-x86_64.AppImage&response-content-type=application%2Foctet-stream [following] --2021-08-28 09:06:25-- https://github-releases.githubusercontent.com/106949285/3e6a6826-d93c-4a05-adc6-38636916b66b?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210828%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210828T140625Z&X-Amz-Expires=300&X-Amz-Signature=e38af4d864beabcb63bea3afcdf841f4e439f1cd52b923ba88d9b858fbbee5fc&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=106949285&response-content-disposition=attachment%3B%20filename%3DBottles-2021.8.28-treviso-x86_64.AppImage&response-content-type=application%2Foctet-stream Resolving github-releases.githubusercontent.com (github-releases.githubusercontent.com)... 185.199.108.154, 185.199.110.154, 185.199.109.154, ... Connecting to github-releases.githubusercontent.com (github-releases.githubusercontent.com)|185.199.108.154|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 85767360 (82M) [application/octet-stream] Saving to: ‘Bottles-2021.8.28-treviso-x86_64.AppImage’ Bottles-2021.8.28-treviso-x86_64.AppImage 100%[========================================================================================================================================>] 81.79M 68.6MB/s in 1.2s 2021-08-28 09:06:27 (68.6 MB/s) - ‘Bottles-2021.8.28-treviso-x86_64.AppImage’ saved [85767360/85767360] ➜ Downloads chmod u+x Bottles-2021.8.28-treviso-x86_64.AppImage ➜ Downloads ./Bottles-2021.8.28-treviso-x86_64.AppImage Gtk-Message: 09:06:39.633: Failed to load module "colorreload-gtk-module" 2021-08-28 09:06:39 INFO: Runners path doens't exist, creating now. 2021-08-28 09:06:39 INFO: Bottles path doens't exist, creating now. 2021-08-28 09:06:39 INFO: Dxvk path doens't exist, creating now. 2021-08-28 09:06:39 INFO: Vkd3d path doens't exist, creating now. 2021-08-28 09:06:39 INFO: Temp path doens't exist, creating now. 2021-08-28 09:06:39 INFO: Runners found: [sys-wine-6.13] 2021-08-28 09:06:40 INFO: Bottles Started! TypeError: Must be number, not NoneType 2021-08-28 09:06:51 WARNING: No dxvk found. 2021-08-28 09:06:51 WARNING: No vkd3d found. 2021-08-28 09:06:51 INFO: Runners found: [sys-wine-6.13] 2021-08-28 09:06:51 WARNING: No runners found. 2021-08-28 09:06:51 INFO: Installing component: [vaniglia-6.15]. 2021-08-28 09:06:51 INFO: Installing component: [dxvk-1.9.1]. 2021-08-28 09:06:51 INFO: Installing component: [vkd3d-v2.4]. 2021-08-28 09:06:52 ERROR: Error while running async job: > Exception: Could not find a suitable TLS CA certificate bundle, invalid path: /etc/ssl/certs/ca-certificates.crt File "/tmp/.mount_BottleDQUvVy///usr/local/share/bottles/bottles/utils.py", line 277, in __target result = self.task_func(*args, **kwargs) File "/tmp/.mount_BottleDQUvVy///usr/local/share/bottles/bottles/backend/component.py", line 357, in async_install download = self.download( File "/tmp/.mount_BottleDQUvVy///usr/local/share/bottles/bottles/backend/component.py", line 222, in download download_url = requests.get( File "/tmp/.mount_BottleDQUvVy/usr/lib/python3/dist-packages/requests/api.py", line 76, in get return request('get', url, params=params, **kwargs) File "/tmp/.mount_BottleDQUvVy/usr/lib/python3/dist-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "/tmp/.mount_BottleDQUvVy/usr/lib/python3/dist-packages/requests/sessions.py", line 542, in request resp = self.send(prep, **send_kwargs) File "/tmp/.mount_BottleDQUvVy/usr/lib/python3/dist-packages/requests/sessions.py", line 655, in send r = adapter.send(request, **kwargs) File "/tmp/.mount_BottleDQUvVy/usr/lib/python3/dist-packages/requests/adapters.py", line 416, in send self.cert_verify(conn, request.url, verify, cert) File "/tmp/.mount_BottleDQUvVy/usr/lib/python3/dist-packages/requests/adapters.py", line 227, in cert_verify raise IOError("Could not find a suitable TLS CA certificate bundle, " 2021-08-28 09:06:52 ERROR: Error while running async job: > Exception: Could not find a suitable TLS CA certificate bundle, invalid path: /etc/ssl/certs/ca-certificates.crt File "/tmp/.mount_BottleDQUvVy///usr/local/share/bottles/bottles/utils.py", line 277, in __target result = self.task_func(*args, **kwargs) File "/tmp/.mount_BottleDQUvVy///usr/local/share/bottles/bottles/backend/component.py", line 357, in async_install download = self.download( File "/tmp/.mount_BottleDQUvVy///usr/local/share/bottles/bottles/backend/component.py", line 222, in download download_url = requests.get( File "/tmp/.mount_BottleDQUvVy/usr/lib/python3/dist-packages/requests/api.py", line 76, in get return request('get', url, params=params, **kwargs) File "/tmp/.mount_BottleDQUvVy/usr/lib/python3/dist-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "/tmp/.mount_BottleDQUvVy/usr/lib/python3/dist-packages/requests/sessions.py", line 542, in request resp = self.send(prep, **send_kwargs) File "/tmp/.mount_BottleDQUvVy/usr/lib/python3/dist-packages/requests/sessions.py", line 655, in send r = adapter.send(request, **kwargs) File "/tmp/.mount_BottleDQUvVy/usr/lib/python3/dist-packages/requests/adapters.py", line 416, in send self.cert_verify(conn, request.url, verify, cert) File "/tmp/.mount_BottleDQUvVy/usr/lib/python3/dist-packages/requests/adapters.py", line 227, in cert_verify raise IOError("Could not find a suitable TLS CA certificate bundle, " 2021-08-28 09:06:54 INFO: Renaming [vaniglia-6.15-x86_64.tar.gz] to [vaniglia-6.15-x86_64.tar.gz]. 2021-08-28 09:06:58 INFO: Runners found: [sys-wine-6.13|vaniglia-6.15] 2021-08-28 09:07:10 INFO: Creating the wineprefix … 2021-08-28 09:07:10 WARNING: No dxvk found. 2021-08-28 09:07:10 ERROR: Error while running async job: > Exception: 'Manager' object has no attribute 'async_component_manager' File "/tmp/.mount_BottleDQUvVy///usr/local/share/bottles/bottles/utils.py", line 277, in __target result = self.task_func(*args, **kwargs) File "/tmp/.mount_BottleDQUvVy///usr/local/share/bottles/bottles/backend/manager.py", line 531, in async_create_bottle self.check_dxvk(no_async=True) File "/tmp/.mount_BottleDQUvVy///usr/local/share/bottles/bottles/backend/manager.py", line 300, in check_dxvk self.async_component_manager.install( [1] 8120 killed ./Bottles-2021.8.28-treviso-x86_64.AppImage ``` I did have to kill the AppImage using the following ```bash ➜ Downloads ps aux | grep -v grep | grep -i bottles filbot 6677 0.1 0.2 1127976 93960 ? Sl 08:58 0:01 dolphin /home/filbot/.var/app/com.usebottles.bottles/data/bottles/bottles/DriveThruRPG/drive_c/Program Files/DriveThruRPG filbot 8120 2.0 0.2 1161164 85396 pts/1 Sl+ 09:06 0:08 /tmp/.mount_BottleDQUvVy//usr/bin/python3.9 /tmp/.mount_BottleDQUvVy//usr/bin/bottles filbot 8123 0.2 0.0 12236 2376 ? Ssl 09:06 0:00 ./Bottles-2021.8.28-treviso-x86_64.AppImage ➜ Downloads ps aux | grep -v grep | grep -i bottles | awk '{print $2}' | xargs kill -9 ```

Hopefully this output helps.

mirkobrombin commented 3 years ago

I ran into the same error when downloading through my Firefox web browser on Fedora 34. I then used wget when I wanted to open an issue, but this time got different results. I was able to load the AppImage, but then when I tried to create my Software Bottle, it hung on downloading DXVK for a long while (30min) where the Flatpak did it in about 20sec. Below I have the terminal output of what I was doing.

Hopefully this output helps.

This is a different issue. I just launched an update that fixes it, it will be available soon, thanks for the report.

bmunger commented 2 years ago

I can confirm this has happened for me too, on Ubuntu 18.04. Launching it a second time works.

mirkobrombin commented 2 years ago

Sooner or later I will understand what causes it

mrjones-plip commented 2 years ago

Confirming that this happened to me on Ubuntu 20.04 as well. Also launching it a second time is a work around like everyone else.

I'm happy to try any fixes if it would be of assistance!

mirkobrombin commented 2 years ago

At the moment I still have no idea, I just know that the old method we used to build the Appimage did not cause this problem, I have to investigate the new one

lfom commented 2 years ago

@mirkobrombin I have found it today, it seems to be the same issue: https://github.com/AppImageCrafters/appimage-builder/issues/93#issuecomment-781729104

Bootles uses appimage-builder? Is it the latest version? If it is, I can make some tests here and try to find a fix...

mirkobrombin commented 2 years ago

@mirkobrombin I have found it today, it seems to be the same issue: AppImageCrafters/appimage-builder#93 (comment)

Bootles uses appimage-builder? Is it the latest version? If it is, I can make some tests here and try to find a fix...

If you do that it would be very much appreciated 🙏

lfom commented 2 years ago

@mirkobrombin OK, I think I have found a way to fix the problem, but now Bottles does not run properly my installed applications anymore. I think something changed in the database of apps/bottles: after running the new version, the previous version does not open the WINE bottle anymore, and the new version cannot find the executables, both the AUR package and the official AppImage, so I think the problem is something added in the last two versions...

Anyway, building the AppImage using the shell script in the repo results in a much smaller AppImage and it runs just fine, while the AppImage built using the GitHub workflow commands result in the behavior reported in this issue (I guess this is what is used for releases).

The problem is that the AppImage should be actually multiarch, since it has binaries for both amd64 and i386. With the current AppImageBuilder.yml, there is no AppDir/opt/libc/lib/ld-linux.so.2. Changing it to an actual multiarch fixes the issue (I got tips from here, using the exclude rules - execept etc - also reduced 5MB from the size of the final file):

 apt:
    arch: [amd64, i386]
    sources:
      - sourceline: 'deb http://archive.ubuntu.com/ubuntu/ hirsute main restricted universe multiverse'
        key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C'
      #- sourceline: 'deb [arch=i386] http://archive.ubuntu.com/ubuntu/ hirsute main restricted universe multiverse'
      #  key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C'
mirkobrombin commented 2 years ago

@mirkobrombin OK, I think I have found a way to fix the problem, but now Bottles does not run properly my installed applications anymore. I think something changed in the database of apps/bottles: after running the new version, the previous version does not open the WINE bottle anymore, and the new version cannot find the executables, both the AUR package and the official AppImage, so I think the problem is something added in the last two versions...

Anyway, building the AppImage using the shell script in the repo results in a much smaller AppImage and it runs just fine, while the AppImage built using the GitHub workflow commands result in the behavior reported in this issue (I guess this is what is used for releases).

The problem is that the AppImage should be actually multiarch, since it has binaries for both amd64 and i386. With the current AppImageBuilder.yml, there is no AppDir/opt/libc/lib/ld-linux.so.2. Changing it to an actual multiarch fixes the issue (I got tips from here, using the exclude rules - execept etc - also reduced 5MB from the size of the final file):

 apt:
    arch: [amd64, i386]
    sources:
      - sourceline: 'deb http://archive.ubuntu.com/ubuntu/ hirsute main restricted universe multiverse'
        key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C'
      #- sourceline: 'deb [arch=i386] http://archive.ubuntu.com/ubuntu/ hirsute main restricted universe multiverse'
      #  key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C'

Ya the script in the repository root is the old build system but il lack all the necessary dependencies, it is not for standalone appimages. The new one use the AppImage recipe.

So just need to set the multiarch to fix the problem? If so, I can make the fix and build the latest release asap

lfom commented 2 years ago

So just need to set the multiarch to fix the problem? If so, I can make the fix and build the latest release asap

It did here (tested on two machines).

mirkobrombin commented 2 years ago

Nice I’m launching a new build 😎

mirkobrombin commented 2 years ago

Seems to work but

/bin/sh: line 1: cabextract: command not found

Yaa another bug, also p7zip is missing, despite it is inside the Appimage

lfom commented 2 years ago

I commented on the commit, you do not need: https://github.com/bottlesdevs/Bottles/blob/1162aecf3f1923b3f5f2cffe7fba69a72d390315/AppImageBuilder.yml#L60-L61 maybe it is related. I built the AppImage on focal, and using hirsute repos.

mirkobrombin commented 2 years ago

I think not, the problem should be related to the bin path pointing to the wrong directory

lfom commented 2 years ago

Testing the official app I also noticed that it seems that $PATH is not properly set.

(15:42:29) INFO Opening the file manager in the path … 
Traceback (most recent call last):
  File "/usr/share/bottles/bottles/widgets/program.py", line 159, in browse_program_folder
    ManagerUtils.open_filemanager(
  File "/usr/share/bottles/bottles/backend/manager_utils.py", line 52, in open_filemanager
    command = f"xdg-open '{path}'"
UnboundLocalError: local variable 'path' referenced before assignment
mirkobrombin commented 2 years ago

Testing the official app I also noticed that it seems that $PATH is not properly set.

(15:42:29) INFO Opening the file manager in the path … 
Traceback (most recent call last):
  File "/usr/share/bottles/bottles/widgets/program.py", line 159, in browse_program_folder
    ManagerUtils.open_filemanager(
  File "/usr/share/bottles/bottles/backend/manager_utils.py", line 52, in open_filemanager
    command = f"xdg-open '{path}'"
UnboundLocalError: local variable 'path' referenced before assignment

But this should be related to another problem

lfom commented 2 years ago

It looks like, just the problem related to the bottle.yml. I have checkout 2021.12.14-treviso-3, added the changes in AppImageBuilder.yml to fix Wayland and ld-linux.so.2 errors and it is working fine after I reverted bottle.yml to a backup copy. If you wanna check it, it can be downloaded here.

mirkobrombin commented 2 years ago

image

Keep giving me errors due to missing p7zip and cabextract. Seems to be working in Wayland but doesn't find the necessary binaries (that are just in the same dir :| )

lfom commented 2 years ago

Weird, no problems here installing dxvk-1.9.1, for instance (no p7zip installed in the machine):

(16:50:17) INFO Opening the file manager in the path … 
(16:50:22) INFO Installing component: [dxvk-1.9.1]. 
(16:50:22) WARNING File [dxvk-1.9.1.tar.gz] already exists in temp, skipping. 
(16:50:23) INFO DXVKs found:
     - dxvk-1.9.2
     - dxvk-1.9.1

(16:50:30) INFO Opening the file manager in the path … 
mirkobrombin commented 2 years ago

I’m using Fedora, you?

lfom commented 2 years ago

@mirkobrombin Arch (Gnome 41 + Wayland) and Pop!_OS 21.10 (Gnome 40 + Wayland), no problems with either using my 2021-12-14-treviso-3 AppImage build with the two fixes.

mirkobrombin commented 2 years ago

@mirkobrombin Arch (Gnome 41 + Wayland) and Pop!_OS 21.10 (Gnome 40 + Wayland), no problems with either using my 2021-12-14-treviso-3 AppImage build with the two fixes.

Nice! Can you open a PR with these fixes?

lfom commented 2 years ago

@mirkobrombin You have added them to master already:

The only difference is that I removed those two lines from AppImageBuilder.yml: https://github.com/bottlesdevs/Bottles/issues/481#issuecomment-1002726641

I applied the changes to 2021-12-14-treviso3 because the newer versions broke the bottle I use.

mirkobrombin commented 2 years ago

Done, I'll release the next build so we can test it and see if it is actually fixed

mirkobrombin commented 2 years ago

Release updated: https://github.com/bottlesdevs/Bottles/releases/tag/2021.12.28-treviso

The silent crash on cold start seems to be solved, thanks! I'm going to close this to focus on the "missing cabextract" problem https://github.com/bottlesdevs/Bottles/issues/833

Thanks @lfom for your contribution :smile:

lfom commented 2 years ago

@mirkobrombin You are more than welcome. I am glad I could help at least a little with the project. Regards