Skip to content

ValueError on attic check --repair #352

@jscinoz

Description

@jscinoz

Similar to #232, I also encounter a crash on running check --repair. However, as the error is completely different, I figured it was more appropriate to log this as a separate issue. For the record, this crash occurs with Attic 0.16.

I'm attempting to run a check on what I believe to be a slightly damaged repository. The check runs for several hours, before crashing with the following error:

attic: Warning: 'check --repair' is an experimental feature that might result
in data loss.

Type "Yes I am sure" if you understand this and want to continue.

Do you want to continue? Yes I am sure
Starting repository check...
Traceback (most recent call last):
  File "/usr/bin/attic", line 3, in <module>
    main()
  File "/usr/lib64/python3.4/site-packages/attic/archiver.py", line 730, in main
    exit_code = archiver.run(sys.argv[1:])
  File "/usr/lib64/python3.4/site-packages/attic/archiver.py", line 720, in run
    return args.func(args)
  File "/usr/lib64/python3.4/site-packages/attic/archiver.py", line 81, in do_check
    if repository.check(repair=args.repair):
  File "/usr/lib64/python3.4/site-packages/attic/repository.py", line 268, in check
    objects = list(self.io.iter_objects(segment))
  File "/usr/lib64/python3.4/site-packages/attic/repository.py", line 500, in iter_objects
    rest = fd.read(size - self.header_fmt.size)
ValueError: read length must be positive or -1

Is there some way to work around this (removing an individual corrupted object/archive), or is my repository essentially gone at this point?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions