Open DerfJagged opened 1 month ago
We'll look into it - thanks for letting us know
Is this related to your comment in your script source about large files not extracting as well @DerfJagged ? Noticed it last week and had it on my agenda to look into this week anyways.
Is this related to your comment in your script source about large files not extracting as well @DerfJagged ? Noticed it last week and had it on my agenda to look into this week anyways.
It's two separate issues: 1) Large (>350MB) zip files fail to extract 2) If it fails to unzip a file (e.g. if it's not a 7z file) it will keep an open handle on that file. Not sure if failing to extract a large file will keep an open handle or not.
@DerfJagged you mention an "invalid zip file" in your original message, but both your last message (and the log error entry you originally shared) reference a 7z
archive. Could you clarify what type of archive you were encountered this with, and if possible attach that dummy archive that is known to cause this so I can repro it?
I looked for the "DO NOT DOWNLOAD" item in the Homebrew Store directory, but didn't see it in either of your last two commits.
Thanks for your help.
@Ste1io When you use the http command to download files, you specify the file extension it will be saved as, so it will successfully download it and it will always be named as .7z, which is why the log entry mentions tmp.7z.
local http = Http.Get("https://example.com/file.xyz", "Downloads\tmp.7z");
I ran into it because I had linked https://consolemods.org/wiki/File:XellLaunch.7z
which is the file's description page, not the actual link for the download (which would be https://consolemods.org/wiki/images/4/41/XellLaunch.7z
). This caused it to just download the http page, and save it as tmp.7z. It'd probably also be reproducible if someone just renamed a .zip file to .7z.
The "DO NOT DOWNLOAD" option is on the actual homebrew store. Run the script on your Xbox, go to the "ConsoleMods - Other" directory, and it's the last item. It will download, fail to extract, and that tmp.7z file will still be held open which breaks any further downloads until you restart Aurora.
It looks like there might be a bug in Aurora's Lua for zip handling.
If I have an invalid zip at PATH_TO_ZIP and run this:
Then it will fail the zip.Extract and show the "Extraction failed!" error, as you'd expect. However, it seems to keep an open file handle on the zip file, and the FileSystem.DeleteFile command fails, and you can't even manually delete the file via FTP until you reboot Aurora. I don't see any script developer accessible ZipFile.CloseFile command, so I think Aurora source needs to be adjusted to close the file upon Extract failure.
The log shows this message: { "time" : "17:32:28.500", "thread" : "0xF9000004", "type" : "normal", "filter" : "RecursiveDeleteDirectory", "message" : "Failed to delete file: Game:\User\Scripts\Utility\HomebrewStore\Downloads\tmp.7z. Error Code: 32" }
For a practical example, I had a typo on a link in the Homebrew Store and it caused that download to fail, but since it kept an open file handle, it would not allow any subsequent downloads to extract since they were trying to write to the same place.
If you want to test it, I've made an item called "DO NOT DOWNLOAD" at the very bottom of the "Other" section of the homebrew store which will trigger this bug.