git-annex/doc/bugs/git-annex-repair_claims_success_then_failure.mdwn
Joey Hess 928b2a4839
create journal directory in withJournalHandle
Fixes a crash by git-annex repair when .git/annex/journal/ does not exist.

Normally the journal directory is created before withJournalHandle gets
run, but git-annex repair can be run in a situation where it does not
exist.
2023-06-21 15:23:59 -04:00

52 lines
2.4 KiB
Markdown

Hello.
What does this log mean? It seems to tell" "success", then "openDirStream" fails, then "1 failed". What failed?
Context is in [todo/git annex repair: performance can be abysmal, huge improvements possible](https://git-annex.branchable.com/ikiwiki.cgi?do=goto&page=todo%2Fgit_annex_repair__58___performance_can_be_abysmal__44___huge_improvements_possible)
fatal: bad object refs/heads/git-annex
fatal: bad object refs/heads/git-annex
fatal: bad object refs/heads/git-annex
error: Could not read somehashA
fatal: Failed to traverse parents of commit somehashB
error: Could not read somehashA
fatal: Failed to traverse parents of commit somehashB
error: Could not read somehashA
fatal: Failed to traverse parents of commit somehashB
error: Could not read somehashA
fatal: Failed to traverse parents of commit somehashB
Deleted these local branches, which could not be recovered due to missing objects:
refs/heads/master
refs/heads/git-annex
You currently have refs/heads/master checked out. You may have staged changes in the index that can be committed to recover the lost state of this branch!
Successfully recovered repository!
Please carefully check that the changes mentioned above are ok..
git-annex: .git/annex/journal/: openDirStream: does not exist (No such file or directory)
failed
git-annex: repair: 1 failed
The fact is: this repo is a plain git clone of a git annex repository.
There is no `.git/annex` directory there before `git-annex-repair` is run.
After it ran, there is a `.git/annex` directory with that content:
total 24
drwxrwxr-x 3 4096 Jul 22 15:41 .
drwxrwxr-x 9 4096 Jul 23 07:24 ..
-rw-rw-r-- 1 65 Jul 20 11:59 index
-rw-rw-r-- 1 41 Jul 20 11:59 index.lck
-rw-rw-r-- 1 0 Jul 22 15:41 journal.lck
-rw-rw-r-- 1 211 Jul 20 11:59 mergedrefs
drwxrwxr-x 2 4096 Jul 22 15:41 misctmp
Perhaps git-annex-repair gets confused when recovering a repository that is a plain git clone of a git annex repository?
I did that because annexed objects are 1.7TB big here, so I wanted a local copy of pure git part only to perform repair of the repo, and propagate things somehow the objects at a later stage.
I'll keep the repo lying around for a few days, maybe weeks, if some experiment or further feedback is needed.
Thank you for your attention.
> [[fixed|done]].. sorry for the delay and thanks for reporting --[[Joey]]