Skip to content

Failure when resuming download using Legendary#51

Open
MateoGonzalezLourido wants to merge 2 commits into
Heroic-Games-Launcher:masterfrom
MateoGonzalezLourido:fix-partial-legendary-downloads
Open

Failure when resuming download using Legendary#51
MateoGonzalezLourido wants to merge 2 commits into
Heroic-Games-Launcher:masterfrom
MateoGonzalezLourido:fix-partial-legendary-downloads

Conversation

@MateoGonzalezLourido

Copy link
Copy Markdown

heroic issue 5654

Describe the bug

When resuming a previously interrupted fresh install, if legendary determines
the download size is 0 (nothing new to fetch), it crashes with:

AttributeError: 'NoneType' object has no attribute 'install_tags'

This happens because old_igame is None for games not yet in the installed
library, but the code accesses it unconditionally.

#logs

¡Se ha producido un error! Intente cerrar sesión e iniciar sesión nuevamente en su cuenta de Epic.
[Core] INFO: Trying to re-use existing login session...[cli] INFO: Preparing download for "3 out of 10, EP 2: "Foundation 101"" (1317e4e3b3ed40c289dde85b194347d3)...[Core] INFO: Parsing game manifest...[Core] INFO: Install path: /home/paraguayo33/Games/Heroic/threeoutof10Ep2[Core] INFO: Selected CDN: egdownload.fastly-edge.com (http)[DLM] INFO: Found previously interrupted download. Download will be resumed if possible.[DLM] INFO: Skipping 25 files based on resume data.[cli] INFO: Download size is 0, the game is either already up to date or has not changed. Exiting...Traceback (most recent call last):File "<frozen runpy>", line 203, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/opt/Heroic/resources/app.asar.unpacked/build/bin/x64/linux/./legendary/__main__.py", line 40, in <module>
legendary.cli.main()
~~~~~~~~~~~~~~~~~~^^
File "/opt/Heroic/resources/app.asar.unpacked/build/bin/x64/linux/./legendary/legendary/cli.py", line 3264, in main
cli.install_game(args)
~~~~~~~~~~~~~~~~^^^^^^
File "/opt/Heroic/resources/app.asar.unpacked/build/bin/x64/linux/./legendary/legendary/cli.py", line 1042, in install_game
if old_igame.install_tags:
^^^^^^^^^^^^^^^^^^^^^^AttributeError: 'NoneType' object has no attribute 'install_tags'

@MateoGonzalezLourido

Copy link
Copy Markdown
Author

When resuming a previously interrupted fresh install, if all files are
already present on disk with correct hashes (dl_size == 0), legendary
crashes with:

AttributeError: 'NoneType' object has no attribute 'install_tags'

This happens because old_igame is None for games not yet registered
in the installed library, but the code accesses it unconditionally.

Additionally, even without the crash, the game would never be marked as
installed since install_game() is only called in the download path.

Changes:

  • Guard old_igame.install_tags access with a None check
  • When dl_size == 0 and the game is not registered, call
    install_game(igame) to register it, since all files are verified
    on disk (hash-checked by the resume logic)

Steps to reproduce:

  1. Start a fresh install of a game
  2. Interrupt the download midway
  3. Resume the download

Expected: Game is resumed, completed, and registered as installed
Actual: Crash with AttributeError

@MateoGonzalezLourido

Copy link
Copy Markdown
Author

Tested and works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant