summaryrefslogtreecommitdiff
path: root/doc/bugs/fsck_--from___36__remote__44___copies_symlinks_instead_of_content.mdwn
blob: 732af29909a7d5bf9a9fbb07aacd4140a917d834 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
### Please describe the problem.

    git annex fsck --from $remote

copies the symlinks from the remote into *.git/annex/tmp*, which then fail to fsck as they don't point to content.

In the transcript below, the 'a' file should fail fsck, but the rest pass.

### What steps will reproduce the problem?

See transcript

### What version of git-annex are you using? On what operating system?

* git-annex version: 5.20150409-g3575ee5
* Arch Linux (git-annex-bin)

### Please provide any additional information below.

    ## git init origin
    ## cd corrupt/
    ## git annex init corrupt
    ## echo a > a.txt
    ## echo b > b.txt
    ## echo c > c.txt

    ## git annex add .
    add a.txt ok
    add b.txt ok
    add c.txt ok
    (recording state in git...)

    ## git commit -m "add files"
    [master (root-commit) 1d670a5] add files
     3 files changed, 3 insertions(+)
     create mode 120000 a.txt
     create mode 120000 b.txt
     create mode 120000 c.txt

("corrupting" a file not needed but here for completeness)

    ## chmod +w .git/annex/objects/41/pJ/SHA256E-s2--87428fc522803d31065e7bce3cf03fe475096631e5e07bbd7a0fde60c4cf25c7.txt/
    ## echo 'd' > .git/annex/objects/41/pJ/SHA256E-s2--87428fc522803d31065e7bce3cf03fe475096631e5e07bbd7a0fde60c4cf25c7.txt/SHA256E-s2--87428fc522803d31065e7bce3cf03fe475096631e5e07bbd7a0fde60c4cf25c7.txt

    ## cd ..

    ## git clone corrupt/ recovery/
    Cloning into 'recovery'...
    done.

    ## cd recovery/

    ## git annex init recovery
    init recovery (merging origin/git-annex into git-annex...)
    (recording state in git...)
    ok
    (recording state in git...)

    ## git annex fsck --from origin
    fsck a.txt 
    git-annex: .git/annex/tmp/fsck24477.SHA256E-s2--87428fc522803d31065e7bce3cf03fe475096631e5e07bbd7a0fde60c4cf25c7.txt: getFileStatus: does not exist (No such file or directory)
    failed
    fsck b.txt 
    git-annex: .git/annex/tmp/fsck24477.SHA256E-s2--0263829989b6fd954f72baaf2fc64bc2e2f01d692d4de72986ea808f6e99813f.txt: getFileStatus: does not exist (No such file or directory)
    failed
    fsck c.txt 
    git-annex: .git/annex/tmp/fsck24477.SHA256E-s2--a3a5e715f0cc574a73c3f9bebb6bc24f32ffd5b67b387244c2c909da779a1478.txt: getFileStatus: does not exist (No such file or directory)
    failed
    (recording state in git...)
    git-annex: fsck: 3 failed

    ## ls -lah .git/annex/tmp/
    total 20K
    drwxr-xr-x 2 gemma users 4.0K Apr 18 17:27 ..
    drwxr-xr-x 5 gemma users 4.0K Apr 18 17:27 ..
    lrwxrwxrwx 1 gemma users  197 Apr 18 17:27 fsck24477.SHA256E-s2--0263829989b6fd954f72baaf2fc64bc2e2f01d692d4de72986ea808f6e99813f.txt -> ../corrupt/.git/annex/objects/x7/01/SHA256E-s2--0263829989b6fd954f72baaf2fc64bc2e2f01d692d4de72986ea808f6e99813f.txt/SHA256E-s2--0263829989b6fd954f72baaf2fc64bc2e2f01d692d4de72986ea808f6e99813f.txt
    lrwxrwxrwx 1 gemma users  197 Apr 18 17:27 fsck24477.SHA256E-s2--87428fc522803d31065e7bce3cf03fe475096631e5e07bbd7a0fde60c4cf25c7.txt -> ../corrupt/.git/annex/objects/41/pJ/SHA256E-s2--87428fc522803d31065e7bce3cf03fe475096631e5e07bbd7a0fde60c4cf25c7.txt/SHA256E-s2--87428fc522803d31065e7bce3cf03fe475096631e5e07bbd7a0fde60c4cf25c7.txt
    lrwxrwxrwx 1 gemma users  197 Apr 18 17:27 fsck24477.SHA256E-s2--a3a5e715f0cc574a73c3f9bebb6bc24f32ffd5b67b387244c2c909da779a1478.txt -> ../corrupt/.git/annex/objects/Vw/zz/SHA256E-s2--a3a5e715f0cc574a73c3f9bebb6bc24f32ffd5b67b387244c2c909da779a1478.txt/SHA256E-s2--a3a5e715f0cc574a73c3f9bebb6bc24f32ffd5b67b387244c2c909da779a1478.txt

> reproduced, test cased, fixed, [[done]] --[[Joey]]