MiSTer-devel / Downloader_MiSTer

Tool for installing and updating MiSTer cores and other files
GNU General Public License v3.0
112 stars 15 forks source link

Crash in zip asset without folders #34

Closed agg23 closed 1 year ago

agg23 commented 1 year ago

This is caused by an error on my part (I think), but creating a zip internal file without a corresponding folder definition crashes with:

0:00:02.96| Restoring filtered ZIP data...
0:00:02.96| Expanding summaries...
Traceback (most recent call last):
  File "/tmp/dont_download.zip/downloader/main.py", line 37, in main
    exit_code = execute_full_run(
  File "/tmp/dont_download.zip/downloader/main.py", line 57, in execute_full_run
    exit_code = runner.full_run()
  File "/tmp/dont_download.zip/downloader/full_run_service.py", line 59, in full_run
    result = self._full_run_impl()
  File "/tmp/dont_download.zip/downloader/full_run_service.py", line 118, in _full_run_impl
    self._online_importer.download_dbs_contents(importer_command, full_resync)
  File "/tmp/dont_download.zip/downloader/online_importer.py", line 72, in download_dbs_contents
    expanded_db = zip_summaries.expand_summaries()
  File "/tmp/dont_download.zip/downloader/online_importer.py", line 458, in expand_summaries
    self._import_zip_ids_from_internal_summaries(zip_ids_from_internal_summary)
  File "/tmp/dont_download.zip/downloader/online_importer.py", line 478, in _import_zip_ids_from_internal_summaries
    self._populate_with_summary(zip_id, summary)
  File "/tmp/dont_download.zip/downloader/online_importer.py", line 515, in _populate_with_summary
    self._db.folders.update(summary['folders'])
KeyError: 'folders'

Downloader failed!
agg23 commented 1 year ago

Turns out this is due to the lack of a zips.internal_summary.folders key

theypsilon commented 1 year ago

Thanks for letting me know. ZIP support is currently unofficial, but since we are gonna make it official soon, I improved the error reporting a bit in this PR: src/downloader/db_entity.py So you would get a less confusing error next time. I plan to keep improving it, though.