AchetaGames / Epic-Asset-Manager

A frontend to Assets purchased on Epic Games Store
https://flathub.org/apps/details/io.github.achetagames.epic_asset_manager
MIT License
363 stars 21 forks source link

Manager crashes after downloading of chunk fails #233

Closed SG-O closed 1 year ago

SG-O commented 1 year ago

When I download large assets (In this case it is the free City Sample) the Asset Manager often crashes.

Here is the debug output:

$ flatpak run --env=RUST_LOG=debug io.github.achetagames.epic_asset_manager
<epic_asset_manager> - [DEBUG] - /app/share/epic_asset_manager
<epic_asset_manager> - [DEBUG] - 
<epic_asset_manager> - [DEBUG] - 3.8.3
<epic_asset_manager::application> - [INFO] - Epic Asset Manager (io.github.achetagames.epic_asset_manager)
<epic_asset_manager::application> - [INFO] - Version: 3.8.3 ()
<epic_asset_manager::application> - [INFO] - Datadir: /app/share/epic_asset_manager
<epic_asset_manager::application::imp> - [DEBUG] - GtkApplication<EpicAssetManager>::startup
<egs_api::api::types::download_manifest> - [ERROR] - No header magic
<egs_api::api::types::download_manifest> - [ERROR] - No header magic
<egs_api::api::types::download_manifest> - [ERROR] - No header magic
<epic_asset_manager::ui::widgets::download_manager> - [ERROR] - Unable to remove chunk file: No such file or directory (os error 2)
<epic_asset_manager::ui::widgets::download_manager> - [ERROR] - Unable to remove chunk file: No such file or directory (os error 2)
<epic_asset_manager::ui::widgets::download_manager> - [ERROR] - Unable to remove chunk file: No such file or directory (os error 2)
<egs_api::api::types::chunk> - [ERROR] - No header magic
thread 'File Pool' panicked at 'called `Option::unwrap()` on a `None` value', src/ui/widgets/download_manager/asset.rs:1067:26
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
<epic_asset_manager::ui::widgets::download_manager> - [ERROR] - Unable to remove chunk file: No such file or directory (os error 2)
<egs_api::api::types::chunk> - [ERROR] - No header magic
thread 'File Pool' panicked at 'called `Option::unwrap()` on a `None` value', src/ui/widgets/download_manager/asset.rs:1067:26
<epic_asset_manager::ui::widgets::download_manager::asset> - [ERROR] - Failed to start chunk download, trying again later: error sending request for url (https://epicgames-download1.akamaized.net/Builds/Rocket/Automated/CitySample/CloudDir/ChunksV3/15/15C21EC8CBCAD2FB_79D23BD24883F18061C948B6A0169DC6.chunk): error trying to connect: dns error: failed to lookup address information: Name or service not known
thread 'main' panicked at 'cannot sample empty range', /run/build/epic_asset_manager/vendor/rand/src/rng.rs:134:9
aknarts commented 1 year ago

Most of those errors are not errors, the Panic is the concerning one(that is the actual crash. I will take a look at it. The City Sample was a complicated assets since the introduction of it so I am not even surprised it fails.

Good news is that if you hit download again it should resume and you might hit a different mirror and finish the download(the mirror selection is somewhat random).

SG-O commented 1 year ago

Resuming the download works but I had to do it over 10 times for the download to finish. When the download was finally over, I encountered another minor bug which I will describe in another issue.

aknarts commented 1 year ago

Took a look at this, it is slightly concerning considering where it fails. I will need to download the asset myself and see the structure of the Chunk that failed. Something is wrong and it is not really clear what. Fixed the crash in an upcoming commit.