Exception during server zip import

Quick Information

  • Operating System: Linux
  • Install Type: Docker
  • Crafty Version: v4.9.0

What Happened?

When setting up a new server via ZIP upload, the server will be stuck at the Importing... stage. In logs I see an error in the import thread.

Expected result

The importing step should succeed and the server be created.

Steps to reproduce

  • Go to Create new server
  • Upload ZIP
  • (Maybe unrelated) The ZIP has a folder inside, which means I changed the "ZIP root dir" to the folder inside.
  • Submit creation form

Logs

Exception in thread beea2dcf-2d9d-40da-bd59-764fb6481307_import:
Traceback (most recent call last):
  File "/usr/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.12/threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
  File "/crafty/app/classes/shared/import_helper.py", line 69, in import_threaded_zipped_server
    self.file_helper.unzip_file(
  File "/crafty/app/classes/helpers/file_helpers.py", line 613, in unzip_file
    zip_ref.extract(file, destination_path)
  File "/usr/lib/python3.12/zipfile/__init__.py", line 1739, in extract
    return self._extract_member(member, path, pwd)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/zipfile/__init__.py", line 1798, in _extract_member
    raise ValueError("Empty filename.")
ValueError: Empty filename.

Priority/Severity

  • High (anything that impacts the normal user flow or blocks app usage)
  • Medium (anything that negatively affects the user experience)
  • Low (anything else e.g., typos, missing icons/translations, layout/formatting issues, etc.)

Extra notes

  • I'll test again with a ZIP without the extra folder inside when I have the time.
  • I'll do debugging in the python code to extract more useful information when I have the time.
Assignee Loading
Time tracking Loading