sinnwerkstatt/runrestic

Broken prune output parsing with Restic 0.13.0

NilsGriebner opened this issue · 4 comments

Just updated to Restic 0.13.0 and faced a traceback in the prune stage, which is likely caused by changed output

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/runrestic/restic/runner.py", line 204, in prune
    process_infos
  File "/usr/local/lib/python3.7/dist-packages/runrestic/restic/output_parsing.py", line 64, in parse_prune
    )[0]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/runrestic", line 10, in <module>
    sys.exit(runrestic())
  File "/usr/local/lib/python3.7/dist-packages/runrestic/runrestic/runrestic.py", line 75, in runrestic
    runner.run()
  File "/usr/local/lib/python3.7/dist-packages/runrestic/restic/runner.py", line 57, in run
    self.prune()
  File "/usr/local/lib/python3.7/dist-packages/runrestic/restic/runner.py", line 210, in prune
    ] = parse_new_prune(process_infos)
  File "/usr/local/lib/python3.7/dist-packages/runrestic/restic/output_parsing.py", line 105, in parse_new_prune
    )[0]
IndexError: list index out of range

Hey @NilsGriebner thanks for the bug report.

I'm pretty swamped. Would you be able to create a PR?

Yep, I'll look into it when I find a minute :)

The issue is a missing ":" after "this removes":

r"this removes[\s]+([0-9]+) blobs / (-?[0-9.]+ ?[a-zA-Z]*B)", output

In my fork this is fixed together with a few other fixes and improvements (#46, #47, successful tests on travis), but I'm afraid the changes are to significant for one PR already. My previous PR #52 for #46 is still open...

I think @palto42 fixed this, right? Thanks!