Skip to content

Borg2: ValueError on date-based matching #7522

Description

@jetchirag

Have you checked borgbackup docs, FAQ, and open GitHub issues?

Yes

Is this a BUG / ISSUE report or a QUESTION?

BUG

System information. For client/server mode post info for both machines.

Your borg version (borg -V).

borg 2.0.0b5

Operating system (distribution) and version.

Tested on WSL2 (Debian 11) and Kali

How much data is handled by borg?

2 archives adding one new file each (total text 2 files)

Full borg commandline that lead to the problem (leave away excludes and passwords)

borg rlist --older 1d --repo XXX

Describe the problem you're observing.

I'm getting ValueError on running borg rlist --older 1d on a new repo which does not have archives older than a day.

Introduced in #7272

https://github.com/borgbackup/borg/pull/7272/files#diff-56ce27fae07c0d4ca00050b58f86125f91d88cb4016e38f7c2d5890de9a4e0f7R39-R40

archives_list is empty so min raises ValueError. Perhaps add a check?

Traceback (most recent call last):
...
  File "/home/xxx/Projects/borg/env/lib/python3.9/site-packages/borg/manifest.py", line 141, in list
    archives = filter_archives_by_date(archives, oldest=oldest, newest=newest, newer=newer, older=older)
  File "/home/xxx/Projects/borg/env/lib/python3.9/site-packages/borg/manifest.py", line 50, in filter_archives_by_date
    earliest_ts, latest_ts = get_first_and_last_archive_ts(archives)
  File "/home/xxx/Projects/borg/env/lib/python3.9/site-packages/borg/manifest.py", line 41, in get_first_and_last_archive_ts
    return min(timestamps), max(timestamps)
ValueError: min() arg is an empty sequence

Can you reproduce the problem? If so, describe how. If not, describe troubleshooting steps you took before opening the issue.

create a new repo with two archives (both adding one new file). Now run the rlist command with --older 1d

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions