Problem with repository

John Arbash Meinel john at arbash-meinel.com
Mon Apr 19 16:43:04 BST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Scott Aubrey wrote:
> HI Guys
> 
> I've just come across this problem and I'm crapping myself a little in
> anticipation of this being unfixable, but just today I've started
> getting a missing index file error on ANY commands I run on a remote
> repository.
> 
> examples (these are running on the remote machine):
> 
>> bzr branch /repo/grace ~/test

So I can certainly give you some stuff you can run to prune the missing
pack file out of the repo so that it doesn't try to access it. But I'd
first really recommend trying to do some analysis to figure out how it
could have gone missing.

Search around to see if you can find any files that look similar,
something like:

  find /repo -name '019ea2*'

Also, it probably be informative to do something like:

  bzr dump-btree --raw .bzr/repository/pack-names


You will want to compare the hashes in that file to the contents of
.bzr/repository/packs and .bzr/repository/indices

There should be a *.pack for every hash in packs/, and a *.[ricts]ix (5
indexes) in indices/

Also, you should be able to run 'md5sum -c packs/*' and the names of
each pack file should match the computed hash value.


In the end, if we can't get it sorted out, then you'll do something like
this in a python script (or from the interpreter):


from bzrlib import repository, btree_index, transport

t = transport.get_transport('/repo/.bzr/repository')
pn_index = btree_index.BTreeGraphIndex(t, 'pack-names', None)
nodes = pn_index.iter_all_entries()

new_index = btree_index.BTreeBuilder(0, 1)

for _, key, value in nodes:
  if key == ('019ea24b5664a247498a7510ba0548c2',):
    continue
  new_index.add_node(key, value)

new_index_content = new_index.finish()
t.put_file('pack-names', new_index_content)

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvMeggACgkQJdeBCYSNAAOreACePKA0XnPwcaAjXvLCEP2sFCOJ
0dwAn3LVRQLyq5Aqlub/RKJIxou3x45M
=xLo0
-----END PGP SIGNATURE-----



More information about the bazaar mailing list