bottlesdevs / Bottles

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

[Bug]: Bottles crashes on Full Archive import #2904

Open erazemk opened 1 year ago

erazemk commented 1 year ago

Describe the bug

When trying to import a Full Archive, which I created a day prior in the same version of Bottles, I get the error, which I posted below. The error only shows up in the log, the UI doesn't display anything (it still works, but doesn't show the imported archive). It seems to me that the archive could be corrupted, but since I made this archive in Bottles just a day ago, this could mean that the error happens when building the archive.

I confirmed this issue with two archives, that I created on the same day, at around the same time, from within Bottles.

To Reproduce

  1. Export a full archive of a bottle
  2. Delete the bottle (in my case I reinstalled my OS, but I'm guessing just deleting has the same outcome)
  3. Try to import the full archive

Package

Flatpak from Flathub

Distribution

Fedora 38

Debugging Information

Official Package: true
Version: '51.6'
DE/WM: gnome
Display:
    X.org: true
    X.org (port): :0
    Wayland: true
Graphics:
    vendors:
        nvidia: &id002
            vendor: nvidia
            envs:
                __NV_PRIME_RENDER_OFFLOAD: '1'
                __GLX_VENDOR_LIBRARY_NAME: nvidia
                __VK_LAYER_NV_optimus: NVIDIA_only
            icd: /usr/lib/x86_64-linux-gnu/GL/vulkan/icd.d/nvidia_icd.json:/usr/lib/i386-linux-gnu/GL/vulkan/icd.d/nvidia_icd.json
            nvngx_path: /usr/lib/x86_64-linux-gnu/GL/nvidia-530-41-03/extra/nvidia/wine
        intel: &id001
            vendor: intel
            envs:
                DRI_PRIME: '1'
            icd: /usr/lib/x86_64-linux-gnu/GL/vulkan/icd.d/intel_icd.x86_64.json:/usr/lib/x86_64-linux-gnu/GL/vulkan/icd.d/intel_hasvk_icd.x86_64.json:/usr/lib/i386-linux-gnu/GL/vulkan/icd.d/intel_icd.i686.json:/usr/lib/i386-linux-gnu/GL/vulkan/icd.d/intel_hasvk_icd.i686.json
    prime:
        integrated: *id001
        discrete: *id002
Kernel:
    Type: Linux
    Version: 6.2.15-300.fc38.x86_64
Disk:
    Total: 16673067008
    Free: 16672899072
RAM:
    MemTotal: 31.1GiB
    MemAvailable: 25.0GiB
Bottles_envs: null

Troubleshooting Logs

16:46:05 (ERROR) Error while running async job: <function BackupManager.import_backup at 0x7fd8b11f27a0>
    Exception: Compressed file ended before the end-of-stream marker was reached

  File "/app/share/bottles/bottles/backend/utils/threading.py", line 59, in __target
    result = self.task_func(*args, **kwargs)
  File "/app/share/bottles/bottles/backend/managers/backup.py", line 148, in import_backup
    safe_extract(tar, Paths.bottles)
  File "/app/share/bottles/bottles/backend/managers/backup.py", line 141, in safe_extract
    for member in _tar.getmembers():
  File "/usr/lib/python3.10/tarfile.py", line 1822, in getmembers
    self._load()        # all members, we first have to
  File "/usr/lib/python3.10/tarfile.py", line 2420, in _load
    tarinfo = self.next()
  File "/usr/lib/python3.10/tarfile.py", line 2342, in next
    self.fileobj.seek(self.offset - 1)
  File "/usr/lib/python3.10/gzip.py", line 393, in seek
    return self._buffer.seek(offset, whence)
  File "/usr/lib/python3.10/_compression.py", line 153, in seek
    data = self.read(min(io.DEFAULT_BUFFER_SIZE, offset))
  File "/usr/lib/python3.10/gzip.py", line 507, in read
    raise EOFError("Compressed file ended before the "
Traceback (most recent call last):
  File "/app/share/bottles/bottles/frontend/views/importer.py", line 91, in __finish
    if result.status:
AttributeError: 'NoneType' object has no attribute 'status'

Additional context

No response

simonspa commented 1 year ago

I can confirm this behavior for Ubuntu 22.04, Bottles via FlatHub

Note that the exported bottle has a zipped size of only 70MB while the folder ~/.var/app/com.usebottles.bottles/data/bottles/bottles/mybottle is 3.4 GB large.

CaptainCoward commented 1 year ago

here i don't get a crash but nothing is imported neither. If your zipped bottle is so small it could be the case that you closed bottles during exporting. Here it took forever with absolutely no feedback. Only after the file stopped getting bigger i assumed the backup process was done. In the end i got a 50GB gz.tar file that i can't import - nothing happens. Trying to extract the file with Ark, will crash Ark, trying to extract it within double commander it will crash as well. Though via terminal it sees to work. Putting it at your bottles location and it seems to work (i could start the games)

ningacoding commented 1 year ago

Same here, it won't import.

In my case i wait until full archive is exported (F5 on Files explorer until write stops) with 8Gb after copy.

But Import still don't work.

baaannnaaannn commented 1 year ago

same here how to solve this?