summaryrefslogtreecommitdiff
path: root/doc/bugs/backend_version_upgrade_leaves_repo_unusable.mdwn
blob: 964a176bd19d9d517e8f325976673f8da8abc3f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
foo is a local repo, bar is a bare remote.

I upgraded foo's git-annex to 0.20110325 and upgraded a local repo backend
to version 2. I then ran `git annex copy . --to bar` and checked the
remote. This created WORM:SHA512--123123 files in annex/objects.
Understandable but unwanted. So I upgraded git-annex on bar's machine, as
well.

    % git annex copy . --to bar
    copy quux (checking bar) git-annex-shell: Repository version 1 is not supported. Upgrade this repository: git-annex upgrade (to bar)
    git-annex-shell: Repository version 1 is not supported. Upgrade this repository: git-annex upgrade
    rsync: connection unexpectedly closed (0 bytes received so far) [sender]
    rsync error: error in rsync protocol data stream (code 12) at io.c(601) [sender=3.0.7]
    
      rsync failed -- run git annex again to resume file transfer
    failed

Running `git annex upgrade` on bar's machine I get:

    % git annex upgrade
    upgrade  (v1 to v2) (moving content...) git-annex: Prelude.read: no parse

Again, bar is a bare repo.
Running the copy job again, I am still getting the same error as above (as expected). Partial contents of annex/objects on bar:

    [...]
    SHA512:123
    WORM:SHA512--234
    [...]


-- RichiH

> Upgrading bare repos to v2 generally works fine, so I actually need
> to see the full content of annex/, not a fragment, in order to debug this.
> (Filename contents I don't need to see.) Feel free to email me the details at
> joey@kitenet.net if you don't want to post them here. --[[Joey]]

>> Sent. -- RichiH

>>> Ok, I'm going to go work on my reading comprehension. I see now
>>> that you
>>> explained the problem pretty well. The problem is caused by these
>>> few weird v1 mixed with v2 keys in the annex.
>>> Ones like "annex/objects/WORM:SHA512--$sha512".
>>>
>>> That's a v1 key, but a corrupt form of the key; it's missing the 
>>> size and mtime fields that all WORM keys have in v1. And 
>>> the filename is itself a key, a v2 SHA512 key. My guess at what
>>> happened is that these were created when you did the `git annex copy`
>>> to the v1 bare repo.
>>>
>>> So, assuming none of these are the only copy of your data
>>> (which you should check), the best thing to do is delete those
>>> keys, and re-run the copy now that it's upgraded. Not sure 
>>> it even makes sense to fix the crash. I should probably focus
>>> on fixing what let these mixed keys be created by the mixed-version
>>> copy.
>>> --[[Joey]]