Skip to content
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

launcher.py: delete corrupt 7z files #366

Closed
nemobis opened this issue Feb 12, 2020 · 3 comments
Closed

launcher.py: delete corrupt 7z files #366

nemobis opened this issue Feb 12, 2020 · 3 comments
Milestone

Comments

@nemobis
Copy link
Member

nemobis commented Feb 12, 2020

Not good to have such stuff lying around:

ERROR: ./riordanfandomcom_ru-20200211-history.xml.7z : ./riordanfandomcom_ru-20200211-history.xml.7z
Open ERROR: Can not open the file as [7z] archive


ERRORS:
Is not archive
@nemobis
Copy link
Member Author

nemobis commented Feb 14, 2020

In any case we need to handle the exception:

ERROR: pawpatrolfandomcom-20200213-history.xml.7z : pawpatrolfandomcom-20200213-history.xml.7z
Open ERROR: Can not open the file as [7z] archive


ERRORS:
Is not archive

Traceback (most recent call last):
  File "launcher.py", line 126, in <module>
    main()
  File "launcher.py", line 58, in main
    archivecontent = subprocess.check_output (['7za', 'l', zipfilename])
  File "/usr/lib64/python2.7/subprocess.py", line 223, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['7za', 'l', 'pawpatrolfandomcom-20200213-history.xml.7z']' returned non-zero exit status 2

@nemobis nemobis added this to the 0.4 milestone Feb 14, 2020
@nemobis
Copy link
Member Author

nemobis commented Feb 14, 2020

It also helps if we don't create them in the first place. Don't move the tmp file to 7z unless it's good. Especially relevant when running low on memory:


Items to compress: 7

  0% 5 + tinyvillagefandomcom-20200214-history.xml/usr/bin/7za: line 2: 1127942 Killed                  "/usr/libexec/p7zip/7za" "$@"

@nemobis
Copy link
Member Author

nemobis commented Feb 15, 2020

To find them it's enough to do a 7z l, for instance:

$ find -name "*7z" | xargs -I§ -n1 -P128 sh -c "7z l § 2>&1 | grep ^ERROR:" | tee 7z.error.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant