MAK-Relic-Tool / Issue-Tracker

Central Bug Tracker / Issues Board for the MAK Relic Tool
0 stars 0 forks source link

File metadata read failure caused by read mismatch when unpacking #46

Open ModernMAK opened 6 months ago

ModernMAK commented 6 months ago
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,

File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)

File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\Scripts\relic.exe_main.py", line 7, in

File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\relic\core\cli.py", line 168, in run
return super().run()

File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\relic\core\cli.py", line 122, in run
exit_code = self._run(ns, sys.argv)

File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\relic\core\cli.py", line 91, in _run
result: Optional[int] = func(ns)

File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\relic\sga\core\cli.py", line 170, in command
copy_fs(sga, f"osfs://{outdir}", on_copy=_callback, preserve_time=True)

File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\fs\copy.py", line 50, in copy_fs
return copy_fs_if(

File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\fs\copy.py", line 110, in copy_fs_if
return copy_dir_if(

File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\fs\copy.py", line 450, in copy_dir_if
copier.copy(_src_fs, dir_path, _dst_fs, copy_path)

File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\fs_bulk.py", line 144, in copy
copy_file_internal(

File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\fs\copy.py", line 281, in copy_file_internal
_copy_locked()

File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\fs\copy.py", line 275, in _copy_locked
copy_modified_time(src_fs, src_path, dst_fs, dst_path)

File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\fs\copy.py", line 521, in copy_modified_time
src_meta = _src_fs.getinfo(src_path, namespaces)

File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\relic\sga\v2\essencefs\definitions.py", line 2346, in getinfo
return node.getinfo(namespaces) # type: ignore

File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\relic\sga\v2\essencefs\definitions.py", line 533, in getinfo
return self._backing.getinfo(namespaces)

File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\relic\sga\v2\essencefs\definitions.py", line 313, in getinfo
modified=self.modified_unix,

File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\relic\sga\v2\essencefs\definitions.py", line 361, in modified_unix
return self._data_info.header.modified

File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\relic\sga\v2\serialization.py", line 266, in modified
buffer = self._serializer.read_bytes(*self.Meta.modified_ptr)

File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\relic\core\lazyio.py", line 636, in read_bytes
value = self._cache[key] = _read()

File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\relic\core\lazyio.py", line 629, in _read
raise MismatchError("Read Mismatch", len(b), size)
relic.core.errors.MismatchError: Unexpected Read Mismatch; got 0, expected 4!
ModernMAK commented 6 months ago

The error is caused by the file data header; which is the new header-thing that I recently discovered in the format.

It's not listed on the wiki of the previous relic-game-tool

Will require further research on how I broke this 😠

ModernMAK commented 5 months ago

To my knowledge; Dawn Of War 'works' without the header format. Could check if the header looks valid, and if not, assume some dummy values. Especially useful if repacking from a previous version of the codebase that failed to properly add them. Then we can just add a 'critical warning' or something to mention that it was missing.