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

Error while creating backup - 'Repository' object has no attribute 'segments' #205

Open
shrx opened this issue Feb 26, 2015 · 15 comments
Open

Comments

@shrx
Copy link

shrx commented Feb 26, 2015

I have initialized attic with

attic init kanta.attic

and then wanted to create a backup with

sudo attic create kanta.attic::backup-$(date +%Y-%m-%d) / --do-not-cross-mountpoints
attic: /bin/bash: [Errno 95] Operation not supported: 'kanta.attic/index.tmp'
Traceback (most recent call last):
  File "/usr/bin/attic", line 3, in <module>
    main()
  File "/usr/lib/python3/dist-packages/attic/archiver.py", line 715, in main
    exit_code = archiver.run(sys.argv[1:])
  File "/usr/lib/python3/dist-packages/attic/archiver.py", line 705, in run
    return args.func(args)
  File "/usr/lib/python3/dist-packages/attic/archiver.py", line 128, in do_create
    self._process(archive, cache, args.excludes, args.exclude_caches, skip_inodes, path, restrict_dev)
  File "/usr/lib/python3/dist-packages/attic/archiver.py", line 177, in _process
    os.path.join(path, filename), restrict_dev)
  File "/usr/lib/python3/dist-packages/attic/archiver.py", line 177, in _process
    os.path.join(path, filename), restrict_dev)
  File "/usr/lib/python3/dist-packages/attic/archiver.py", line 163, in _process
    archive.process_file(path, st, cache)
  File "/usr/lib/python3/dist-packages/attic/archive.py", line 402, in process_file
    chunks.append(cache.add_chunk(self.key.id_hash(chunk), chunk, self.stats))
  File "/usr/lib/python3/dist-packages/attic/cache.py", line 180, in add_chunk
    self.repository.put(id, data, wait=False)
  File "/usr/lib/python3/dist-packages/attic/repository.py", line 360, in put
    self.segments.setdefault(segment, 0)
AttributeError: 'Repository' object has no attribute 'segments'

How to fix this?

@shrx
Copy link
Author

shrx commented Feb 26, 2015

The issue seems to be with the filesystem - I want to create the backup on a HFS+ formatted disk.

@ThomasWaldmann
Copy link
Contributor

So, just to clarify, can you please give attic version, OS informations about where attic is running (OS X? Release?) / backing up to (locally mounted disk?).

Besides the traceback, there was already a error msg before the exception happened:

attic: /bin/bash: [Errno 95] Operation not supported: 'kanta.attic/index.tmp'

So, precisely what operations needed were not supported?

@ThomasWaldmann
Copy link
Contributor

Note: this could be related to issue #202, similar exception there.

@shrx
Copy link
Author

shrx commented Mar 9, 2015

Sorry for late response.
attic version: 0.13-1
OS: Xubuntu 14.10
backing up to: external disk connected via USB
I don't know about the specific error, will have to check again.

@ThomasWaldmann
Copy link
Contributor

Maybe also try attic 0.14.

@shrx
Copy link
Author

shrx commented Mar 14, 2015

The error is just with one folder with afuse-mounted remote directories not accessible to attic.

@ThomasWaldmann
Copy link
Contributor

Interesting. Can you clarify what you mean with "not accessible to attic"?

@shrx
Copy link
Author

shrx commented Mar 14, 2015

This is the only error I get from attic:

attic: /home/shrx/net: [Errno 13] Permission denied: '/home/shrx/net'

The permissions are

drwx------  1 shrx shrx      0 1970/01/01 01:00:00 net

@ThomasWaldmann
Copy link
Contributor

@shrx so when you ran attic, you were using another user/group than shrx/shrx?

as a side note, the time stamp on that directory looks suspicious, like a 0 timestamp + 1h tz offset.

@shrx
Copy link
Author

shrx commented Mar 14, 2015

Yes, I am running attic with sudo.

@ThomasWaldmann
Copy link
Contributor

sudo root? or sudo someoneelse?

@shrx
Copy link
Author

shrx commented Mar 14, 2015

just sudo attic

@ThomasWaldmann
Copy link
Contributor

hmm, just a guessing: could the error when accessing the afuse-mounted stuff maybe be related to ACL / xattr support code (like trying to read ACLs/xattrs although they are not supported there)?

@shrx could you reproduce on unmodified and slightly modified code?

@theamk
Copy link

theamk commented Jul 11, 2015

I have a backup system which involves three hosts making backups to a same repository on a central server. I am hitting this bug fairly regularly. I added some debug prints and it seems the problem is in repository.prepare_txn: it immediately sets self._active_txn to True, then tries to obtain a lock. The lock fails with:
OSError: [Errno 35] Resource deadlock avoided
This is translated to WriteLockFailed exception; However, the caller seems to ignore the exception and calls put() instead. It thinks that transaction is already active (since _active_txn is true) and fails when trying to access segments().

@ThomasWaldmann
Copy link
Contributor

@theamk I fixed that already, see the 2nd commit in #228

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

No branches or pull requests

3 participants