jborg / attic

Deduplicating backup program
Other
1.11k stars 104 forks source link

attic cache config corruption #177

Open fhaust opened 9 years ago

fhaust commented 9 years ago

There seems to be a problem with ... something ... ?

# attic create --stats --exclude-from $EXCLUDE_FILE --exclude-caches $REPOSITORY_VIA_SSH $FOLDER
Traceback (most recent call last):
  File "/usr/lib/python3.4/configparser.py", line 1116, in _unify_values
    sectiondict = self._sections[section]
KeyError: 'cache'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/attic", line 3, in <module>
    main()
  File "/usr/lib/python3.4/site-packages/attic/archiver.py", line 727, in main
    exit_code = archiver.run(sys.argv[1:])
  File "/usr/lib/python3.4/site-packages/attic/archiver.py", line 717, in run
    return args.func(args)
  File "/usr/lib/python3.4/site-packages/attic/archiver.py", line 100, in do_create
    cache = Cache(repository, key, manifest)
  File "/usr/lib/python3.4/site-packages/attic/cache.py", line 28, in __init__
    self.open()
  File "/usr/lib/python3.4/site-packages/attic/cache.py", line 63, in open
    if self.config.getint('cache', 'version') != 1:
  File "/usr/lib/python3.4/configparser.py", line 781, in getint
    return self._get(section, int, option, raw=raw, vars=vars)
  File "/usr/lib/python3.4/configparser.py", line 776, in _get
    return conv(self.get(section, option, **kwargs))
  File "/usr/lib/python3.4/configparser.py", line 754, in get
    d = self._unify_values(section, vars)
  File "/usr/lib/python3.4/configparser.py", line 1119, in _unify_values
    raise NoSectionError(section)
configparser.NoSectionError: No section: 'cache'
ThomasWaldmann commented 9 years ago

A config file (see .cache/attic/XXXXXX/config) usually looks like this:

[cache]
version = 1
repository = 003aeedbd89963c55f2621e6684ad155c1e9a5eb3a1c4daf43e77a13c9ef9360
manifest = e60ce0e7e0878c58d42a687264af8278d5bc1c381736bfbedc521644f85a415a
timestamp = 2015-03-02T22:34:53.897209

In your case, it did not find the [cache] section, which likely means it is somehow corrupted or maybe empty. Maybe kill the cache so it gets rebuilt.

fhaust commented 9 years ago

That file was empty, but deleting the .cache/attic folder solved the problem. Kind of curious as I think that was the first thing I tried when this failed.

But thanks nevertheless. Attic is a great piece of software and I am glad it works again.

2015-03-08 4:44 GMT+01:00 TW notifications@github.com:

A config file (see .cache/attic/XXXXXX/config) usually looks like this:

[cache] version = 1 repository = 003aeedbd89963c55f2621e6684ad155c1e9a5eb3a1c4daf43e77a13c9ef9360 manifest = e60ce0e7e0878c58d42a687264af8278d5bc1c381736bfbedc521644f85a415a timestamp = 2015-03-02T22:34:53.897209

In your case, it did not find the [cache] section, which likely means it is somehow corrupted or maybe empty. Maybe kill the cache so it gets rebuilt.

— Reply to this email directly or view it on GitHub https://github.com/jborg/attic/issues/177#issuecomment-77731187.

fhaust commented 9 years ago

Actually the problem persists ... I was able to do some backups. But somehow the cache was corrupted again. Deleting it fixes this (again).

Anything I could do to help you find the cause of this problem?

ThomasWaldmann commented 9 years ago

did you run out of disk space? did attic crash before the file was zero length? also, can you try to reproduce with a local repository (without ssh)?

fhaust commented 9 years ago

Attic probably crashed before this corruption happened. I have it running hourly and the target server is not available all of the time. Probably it even loses the server mid-backup.

Haven't encountered the problem again after deleting the cache. So I probably can't reproduce it locally.

Can't change the title just now. If I don't the next days please remind me again. Am 14.05.2015 17:17 schrieb "TW" notifications@github.com:

@fhaust https://github.com/fhaust could you edit the issue title and change it to "attic cache config corruption"? See the button to the right of the title. also see my last comment for some open questions.

— Reply to this email directly or view it on GitHub https://github.com/jborg/attic/issues/177#issuecomment-102069171.