New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
archive.extracted: 2016.11.2 returns state failure for some zip formats, if already extracted #39110
Comments
@morganwillcock Does |
@terminalmage Thanks for looking at this. It's listed in files. salt salt-test archive.list salt://archive_7zip.zip verbose=True salt-test: ---------- dirs: files: - New folder/ - New folder/New Text Document.txt - New Text Document.txt links: top_level_dirs: top_level_files: - New Text Document.txt top_level_links: |
OK. This suggests either that the zip file was created incorrectly, or that there is a bug in the Python stdlib. I'm launching a Windows VM instance to troubleshoot. Did you create the ZIP file on a Windows box, or another platform? Was it created using the CLI or the GUI? What version of 7-zip? |
Created on Windows, using the shell extension.
I just double checked and it was 7zip version 15.14, I also upgraded to the newest version 16.04 with the same result in the dictionary output. |
It looks like it's common to find both types of layout, so I don't think it's a 7zip bug as such. |
Actually, the truth is that |
Fixed in #39128. There are actually two issues here. One is the |
Thank you for the quick fix. # salt salt-test state.apply testing salt-test: ---------- ID: 7zip_test Function: archive.extracted Name: C:\made_in_7zip Result: True Comment: salt://archive_7zip.zip extracted to C:\made_in_7zip\ Started: 11:34:34.801000 Duration: 203.0 ms Changes: ---------- directories_created: - C:\made_in_7zip\ extracted_files: - New folder/ - New folder/New Text Document.txt - New Text Document.txt ---------- ID: explorer_test Function: archive.extracted Name: C:\made_in_explorer Result: True Comment: salt://archive_explorer.zip extracted to C:\made_in_explorer\ Started: 11:34:35.004000 Duration: 0.0 ms Changes: ---------- directories_created: - C:\made_in_explorer\ extracted_files: - New folder/New Text Document.txt - New Text Document.txt # salt salt-test state.apply testing salt-test: ---------- ID: 7zip_test Function: archive.extracted Name: C:\made_in_7zip Result: True Comment: All files in archive are already present Started: 11:34:57 Duration: 468.0 ms Changes: ---------- ID: explorer_test Function: archive.extracted Name: C:\made_in_explorer Result: True Comment: All files in archive are already present Started: 11:34:57.468000 Duration: 234.0 ms Changes: |
This is probably Windows specific and related to changes here: d6adfb6
Depending on the internal format of the zip file, the archive.extracted state may return a failure, implying that content which is already extracted is the wrong type.
There is no problem applying when the archive hasn't been extracted yet:
...but note the list of extracted files differs between the two. Applying it a second time returns a failure for the first zip file, but not the second:
You can see the difference with zipinfo. The extracted contents are identical, but the internal structure is different between the two.
Modifying to add the force option returns a different error, but I imagine the underlying issue is the same:
This problem is new to 2016.11.2 (did not exist in 2016.11.1).
The text was updated successfully, but these errors were encountered: