bzr-git crashes when trying to update GTK: Invalid sha for Commit

Bug #753155 reported by Andrew Cowie
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Bazaar Git Plugin
Triaged
Medium
Unassigned
Breezy
Fix Released
Medium
Jelmer Vernooij

Bug Description

$ bzr pull
Using saved parent location: git+ssh://<email address hidden>/git/gtk+/
bzr: failed to report crash using apport:
     OSError(13, 'Permission denied')
bzr: ERROR: exceptions.AssertionError: Invalid sha for <Commit 87a5d4f4faa9b24bace2bd1d74cbbbfbc87c5e95>: c8df83a2fee148d871b36ca5ac742dc566c64612

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/bzrlib/commands.py", line 926, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/bzrlib/commands.py", line 1126, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/pymodules/python2.6/bzrlib/commands.py", line 691, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/pymodules/python2.6/bzrlib/commands.py", line 713, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/bzrlib/builtins.py", line 1008, in run
    show_base=show_base)
  File "/usr/lib/pymodules/python2.6/bzrlib/decorators.py", line 194, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/bzrlib/workingtree.py", line 1676, in pull
    local=local)
  File "/usr/lib/pymodules/python2.6/bzrlib/branch.py", line 1086, in pull
    possible_transports=possible_transports, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/branch.py", line 617, in pull
    stop_revision, overwrite=overwrite, graph=graph, limit=limit)
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/branch.py", line 566, in _update_revisions
    determine_wants, self.source.mapping, limit=limit)
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/fetch.py", line 594, in fetch_objects
    progress)
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/remote.py", line 310, in fetch_objects
    lambda x: os.write(fd, x), progress)
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/remote.py", line 301, in fetch_pack
    pack_data, progress)
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/remote.py", line 130, in fetch_pack
    graph_walker, pack_data, progress)
  File "/usr/lib/pymodules/python2.6/dulwich/client.py", line 229, in fetch_pack
    have = graph_walker.next()
  File "/usr/lib/pymodules/python2.6/dulwich/object_store.py", line 771, in next
    ps = self.get_parents(ret)
  File "/usr/lib/pymodules/python2.6/dulwich/object_store.py", line 194, in <lambda>
    return ObjectStoreGraphWalker(heads, lambda sha: self[sha].parents)
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/object_store.py", line 565, in __getitem__
    (type, type_data) = self.lookup_git_sha(sha)
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/object_store.py", line 557, in lookup_git_sha
    return self.lookup_git_shas([sha], update_map=update_map)[sha]
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/object_store.py", line 548, in lookup_git_shas
    self._update_sha_map()
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/object_store.py", line 322, in _update_sha_map
    self._update_sha_map_revision(revid)
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/object_store.py", line 419, in _update_sha_map_revision
    roundtrip=True):
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/object_store.py", line 408, in _revision_to_objects
    _check_expected_sha(foreign_revid, commit_obj)
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/object_store.py", line 139, in _check_expected_sha
    expected_sha))
AssertionError: Invalid sha for <Commit 87a5d4f4faa9b24bace2bd1d74cbbbfbc87c5e95>: c8df83a2fee148d871b36ca5ac742dc566c64612

bzr 2.3.1 on python 2.6.6 (Linux-2.6.35-28-generic-x86_64-with-Ubuntu-10.10-maverick)
arguments: ['/usr/bin/bzr', 'pull']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_CA.utf8'
plugins:
  bash_completion /usr/lib/pymodules/python2.6/bzrlib/plugins/bash_completion [2.3.1]
  builddeb /usr/lib/python2.6/dist-packages/bzrlib/plugins/builddeb [2.7.0dev]
  dbus /usr/lib/python2.6/dist-packages/bzrlib/plugins/dbus [0.1.0dev]
  fastimport /usr/lib/pymodules/python2.6/bzrlib/plugins/fastimport [0.10.0dev]
  git /usr/lib/python2.6/dist-packages/bzrlib/plugins/git [0.5.4]
  gtk /usr/lib/python2.6/dist-packages/bzrlib/plugins/gtk [0.100.0]
  launchpad /usr/lib/pymodules/python2.6/bzrlib/plugins/launchpad [2.3.1]
  netrc_credential_store /usr/lib/pymodules/python2.6/bzrlib/plugins/netrc_credential_store [2.3.1]
  news_merge /usr/lib/pymodules/python2.6/bzrlib/plugins/news_merge [2.3.1]
  rewrite /usr/lib/python2.6/dist-packages/bzrlib/plugins/rewrite [0.6.2]

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.
fatal: The remote end hung up unexpectedly
worthil ~/vcs/gtk+/upstream $

While we're at it, spending half an hour to "update git map" and failing, and then restarting at 0 seems sub-optimal.

AfC

Martin Pool (mbp)
summary: - bzr-git crashes when trying to update GTK
+ bzr-git crashes when trying to update GTK: Invalid sha for Commit
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

> While we're at it, spending half an hour to "update git map" and failing, and then restarting at 0 seems sub-optimal.
FWIW It's not actually doing any duplicate work, it's just that the progress indicator could be better (it does this whole process once for each head in the repository).

affects: bzr → bzr-git
Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 753155] [NEW] bzr-git crashes when trying to update GTK: Invalid sha for Commit
Download full text (4.4 KiB)

On Thu, 2011-04-07 at 03:05 +0000, Andrew Cowie wrote:
> Public bug reported:
>
> $ bzr pull
> Using saved parent location: git+ssh://<email address hidden>/git/gtk+/
> bzr: failed to report crash using apport:
> OSError(13, 'Permission denied')
> bzr: ERROR: exceptions.AssertionError: Invalid sha for <Commit 87a5d4f4faa9b24bace2bd1d74cbbbfbc87c5e95>: c8df83a2fee148d871b36ca5ac742dc566c64612
>
> Traceback (most recent call last):
> File "/usr/lib/pymodules/python2.6/bzrlib/commands.py", line 926, in exception_to_return_code
> return the_callable(*args, **kwargs)
> File "/usr/lib/pymodules/python2.6/bzrlib/commands.py", line 1126, in run_bzr
> ret = run(*run_argv)
> File "/usr/lib/pymodules/python2.6/bzrlib/commands.py", line 691, in run_argv_aliases
> return self.run(**all_cmd_args)
> File "/usr/lib/pymodules/python2.6/bzrlib/commands.py", line 713, in run
> return self._operation.run_simple(*args, **kwargs)
> File "/usr/lib/pymodules/python2.6/bzrlib/cleanup.py", line 135, in run_simple
> self.cleanups, self.func, *args, **kwargs)
> File "/usr/lib/pymodules/python2.6/bzrlib/cleanup.py", line 165, in _do_with_cleanups
> result = func(*args, **kwargs)
> File "/usr/lib/pymodules/python2.6/bzrlib/builtins.py", line 1008, in run
> show_base=show_base)
> File "/usr/lib/pymodules/python2.6/bzrlib/decorators.py", line 194, in write_locked
> result = unbound(self, *args, **kwargs)
> File "/usr/lib/pymodules/python2.6/bzrlib/workingtree.py", line 1676, in pull
> local=local)
> File "/usr/lib/pymodules/python2.6/bzrlib/branch.py", line 1086, in pull
> possible_transports=possible_transports, *args, **kwargs)
> File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/branch.py", line 617, in pull
> stop_revision, overwrite=overwrite, graph=graph, limit=limit)
> File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/branch.py", line 566, in _update_revisions
> determine_wants, self.source.mapping, limit=limit)
> File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/fetch.py", line 594, in fetch_objects
> progress)
> File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/remote.py", line 310, in fetch_objects
> lambda x: os.write(fd, x), progress)
> File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/remote.py", line 301, in fetch_pack
> pack_data, progress)
> File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/remote.py", line 130, in fetch_pack
> graph_walker, pack_data, progress)
> File "/usr/lib/pymodules/python2.6/dulwich/client.py", line 229, in fetch_pack
> have = graph_walker.next()
> File "/usr/lib/pymodules/python2.6/dulwich/object_store.py", line 771, in next
> ps = self.get_parents(ret)
> File "/usr/lib/pymodules/python2.6/dulwich/object_store.py", line 194, in <lambda>
> return ObjectStoreGraphWalker(heads, lambda sha: self[sha].parents)
> File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/object_store.py", line 565, in __getitem__
> (type, type_data) = self.lookup_git_sha(sha)
> File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/object_store....

Read more...

Changed in bzr-git:
status: New → Incomplete
Revision history for this message
Andrew Cowie (afcowie) wrote :

I tried it with a fresh branch and it crashed in the same way.

Running the diagnostic commands you asked for. It's doing the updating git map thing presently.

AfC

P.S. If you quote the entire body of the bugmail you're replying to, then all it appears as in Launchpad is "[...]". I only noticed by chance that you'd asked me to do something.

Revision history for this message
Andrew Cowie (afcowie) wrote :

> $ bzr git-object 87a5d4f4faa9b24bace2bd1d74cbbbfbc87c5e95

  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/object_store.py", line 139, in _check_expected_sha
    expected_sha))
AssertionError: Invalid sha for <Commit 87a5d4f4faa9b24bace2bd1d74cbbbfbc87c5e95>: c8df83a2fee148d871b36ca5ac742dc566c64612

> $ bzr git-object c8df83a2fee148d871b36ca5ac742dc566c64612

  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/object_store.py", line 139, in _check_expected_sha
    expected_sha))
AssertionError: Invalid sha for <Commit 87a5d4f4faa9b24bace2bd1d74cbbbfbc87c5e95>: c8df83a2fee148d871b36ca5ac742dc566c64612

AfC

Revision history for this message
Martin Pool (mbp) wrote :

> P.S. If you quote the entire body of the bugmail you're replying to, then all it appears as in Launchpad is "[...]". I only noticed by chance that you'd asked me to do something.

Wow, you're right. That's quite a nasty bug. I filed bug 754303.

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 753155] Re: bzr-git crashes when trying to update GTK: Invalid sha for Commit

On Fri, 2011-04-08 at 02:12 +0000, Andrew Cowie wrote:
> I tried it with a fresh branch and it crashed in the same way.

> Running the diagnostic commands you asked for. It's doing the updating
> git map thing presently.
If this was in a fresh repository, then I suspect this might be a bug
that's fixed in bzr-git/dulwich trunk.

Cheers,

Jelmer

Revision history for this message
Andrew Cowie (afcowie) wrote :

Ok, well we'll wait for a "fix-released" into the Bazaar PPA and test again then.

AfC

Changed in bzr-git:
status: Incomplete → New
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

On Fri, 2011-04-08 at 23:38 +0000, Andrew Cowie wrote:
> Ok, well we'll wait for a "fix-released" into the Bazaar PPA and test
> again then.
It's already in the daily builds PPA, ppa:bzr/daily

Cheers,

Jelmer

Jelmer Vernooij (jelmer)
Changed in bzr-git:
status: New → Incomplete
Revision history for this message
Andrew Cowie (afcowie) wrote :

Just received bzr-git 0.6.0 via PPA, so tried again per comment #7. It still crashes with:

AssertionError: Invalid sha for <Commit 87a5d4f4faa9b24bace2bd1d74cbbbfbc87c5e95>: c8df83a2fee148d871b36ca5ac742dc566c64612

You can presumably duplicate this if you do:

$ bzr clone git://git.gnome.org/gtk+

It's a public respository.

AfC

Changed in bzr-git:
status: Incomplete → New
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

On Thu, 2011-04-14 at 01:18 +0000, Andrew Cowie wrote:
> Just received bzr-git 0.6.0 via PPA, so tried again per comment #7. It
> still crashes with:
>
> AssertionError: Invalid sha for <Commit
> 87a5d4f4faa9b24bace2bd1d74cbbbfbc87c5e95>:
> c8df83a2fee148d871b36ca5ac742dc566c64612
>
> You can presumably duplicate this if you do:
>
> $ bzr clone git://git.gnome.org/gtk+
>
> It's a public respository.
As I mentioned earlier, I can't reproduce this when cloning into a fresh
repository:

charis:~/tmp% BZR_PDB=1 bzr clone git://git.gnome.org/gtk+
Branched 23346 revision(s).

So the problem is most likely revisions that already are present in your
shared repository. Can you reproduce this problem outside of a shared
repository?

  status incomplete

Cheers,

Jelmer

Changed in bzr-git:
status: New → Incomplete
Revision history for this message
Andrew Cowie (afcowie) wrote :
Download full text (3.2 KiB)

Left it running; it ended with:

$ bzr clone git+ssh://<email address hidden>/git/gtk+ tryagain
bzr: ERROR: The branch git+ssh://<email address hidden>/git/gtk+ has no revision None.
$

And this was in ~/.bzr.log:

Fri 2011-04-15 00:59:37 +1000
0.085 bazaar version: 2.3.1
0.085 bzr arguments: [u'--version']
0.131 looking for plugins in /home/andrew/.bazaar/plugins
0.131 looking for plugins in /usr/lib/pymodules/python2.6/bzrlib/plugins
0.147 looking for plugins in /usr/lib/python2.6/dist-packages/bzrlib/plugins
0.278 encoding stdout as sys.stdout encoding 'UTF-8'
0.298 Transferred: 0kB (0.0kB/s r:0kB w:0kB)
0.299 return code 0
5080.205 Auto-packing repository GCRepositoryPackCollection(CHKInventoryRepository('file:///home/andrew/vcs/gtk%2B/.bzr/repository/')), which has 11 pack files, containing 20000 revisions. Packing 10 files into 1 affecting 10000 revisions
5080.404 repacking 10000 revisions
5090.721 repacking 10000 inventories
5097.277 repacking chk: 9972 id_to_entry roots, 319 p_id_map roots, 59500 total keys
5147.501 repacking 55027 texts
5401.151 repacking 0 signatures
5413.738 Auto-packing repository GCRepositoryPackCollection(CHKInventoryRepository('file:///home/andrew/vcs/gtk%2B/.bzr/repository/')) completed
6262.603 Auto-packing repository GCRepositoryPackCollection(CHKInventoryRepository('file:///home/andrew/vcs/gtk%2B/.bzr/repository/')), which has 12 pack files, containing 30000 revisions. Packing 10 files into 1 affecting 10000 revisions
6262.805 repacking 10000 revisions
6271.347 repacking 10000 inventories
6278.311 repacking chk: 10000 id_to_entry roots, 619 p_id_map roots, 43476 total keys
6319.078 repacking 35011 texts
6494.092 repacking 0 signatures
6503.293 Auto-packing repository GCRepositoryPackCollection(CHKInventoryRepository('file:///home/andrew/vcs/gtk%2B/.bzr/repository/')) completed
6954.518 creating branch <bzrlib.branch.BzrBranchFormat7 object at 0x7f524a96f590> in file:///home/andrew/vcs/gtk%2B/tryagain/
6958.981 Transferred: 0kB (0.0kB/s r:0kB w:0kB)
6958.991 Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/bzrlib/commands.py", line 926, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/bzrlib/commands.py", line 1126, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/pymodules/python2.6/bzrlib/commands.py", line 691, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/pymodules/python2.6/bzrlib/commands.py", line 713, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/bzrlib/builtins.py", line 1233, in run
    raise errors.BzrCommandError(msg)
BzrCommandError: The branch git+ssh://<email address hidden>/git/gtk+ has no revision None.

6958.991 return code 3

I did do this under a (freshly created) shared repository and there are 725 MB of packs there, so presumably the I can try again / resum...

Read more...

Changed in bzr-git:
status: Incomplete → New
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

On Thu, 2011-04-14 at 22:40 +0000, Andrew Cowie wrote:
> Left it running; it ended with:
>
> $ bzr clone git+ssh://<email address hidden>/git/gtk+ tryagain
> bzr: ERROR: The branch git+ssh://<email address hidden>/git/gtk+ has no revision None.
> $
>
> And this was in ~/.bzr.log:
>
> Fri 2011-04-15 00:59:37 +1000
> 0.085 bazaar version: 2.3.1
> 0.085 bzr arguments: [u'--version']
> 0.131 looking for plugins in /home/andrew/.bazaar/plugins
> 0.131 looking for plugins in /usr/lib/pymodules/python2.6/bzrlib/plugins
> 0.147 looking for plugins in /usr/lib/python2.6/dist-packages/bzrlib/plugins
> 0.278 encoding stdout as sys.stdout encoding 'UTF-8'
> 0.298 Transferred: 0kB (0.0kB/s r:0kB w:0kB)
> 0.299 return code 0
> 5080.205 Auto-packing repository GCRepositoryPackCollection(CHKInventoryRepository('file:///home/andrew/vcs/gtk%2B/.bzr/repository/')), which has 11 pack files, containing 20000 revisions. Packing 10 files into 1 affecting 10000 revisions
> 5080.404 repacking 10000 revisions
> 5090.721 repacking 10000 inventories
> 5097.277 repacking chk: 9972 id_to_entry roots, 319 p_id_map roots, 59500 total keys
> 5147.501 repacking 55027 texts
> 5401.151 repacking 0 signatures
> 5413.738 Auto-packing repository GCRepositoryPackCollection(CHKInventoryRepository('file:///home/andrew/vcs/gtk%2B/.bzr/repository/')) completed
> 6262.603 Auto-packing repository GCRepositoryPackCollection(CHKInventoryRepository('file:///home/andrew/vcs/gtk%2B/.bzr/repository/')), which has 12 pack files, containing 30000 revisions. Packing 10 files into 1 affecting 10000 revisions
> 6262.805 repacking 10000 revisions
> 6271.347 repacking 10000 inventories
> 6278.311 repacking chk: 10000 id_to_entry roots, 619 p_id_map roots, 43476 total keys
> 6319.078 repacking 35011 texts
> 6494.092 repacking 0 signatures
> 6503.293 Auto-packing repository GCRepositoryPackCollection(CHKInventoryRepository('file:///home/andrew/vcs/gtk%2B/.bzr/repository/')) completed
> 6954.518 creating branch <bzrlib.branch.BzrBranchFormat7 object at 0x7f524a96f590> in file:///home/andrew/vcs/gtk%2B/tryagain/
This isn't a clean repository; can you reproduce this when pulling into
a clean repository?

Cheers,

Jelmer

Revision history for this message
Andrew Cowie (afcowie) wrote :

Ok, will do, but I'm not sure what part of:

$ rm -r .bzr
$ bzr init-repo .
$ bzr clone URL dir

Doesn't result in a "clean repository".

AfC

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

On Fri, 2011-04-15 at 00:19 +0000, Andrew Cowie wrote:
> Ok, will do, but I'm not sure what part of:
>
> $ rm -r .bzr
> $ bzr init-repo .
> $ bzr clone URL dir
>
> Doesn't result in a "clean repository".
In that case, I'm really not sure what's going on here. I can't
reproduce this behaviour, and I'm using the same versions of bzr-git and
Dulwich. :-/

  status incomplete

Cheers,

Jelmer

Changed in bzr-git:
status: New → Incomplete
Revision history for this message
Andrew Cowie (afcowie) wrote :

Since I had used a shared repository at ., just for the hell of it I ran:

$ bzr clone git+ssh://<email address hidden>/git/gtk+ tryagain

again, and it completed in 30 seconds, building a working tree in tryagain/ like it should have before.

This tree compares favourably with https://code.launchpad.net/~vcs-imports/gtk/trunk

So it having crashed as at comment #12 is probably a different bug, but Bazaar crunching after doing 6000 seconds of work is a shame. I'm glad I did it in a shared repo.

I guess you're going to close this now.

AfC

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

I just managed to reproduce this; it happens when cloning into an empty repository but not when cloning as a standalone branch. This puzzles me a bit as in both cases the initial repository is empty.

Changed in bzr-git:
status: Incomplete → Opinion
status: Opinion → Triaged
importance: Undecided → Medium
Jelmer Vernooij (jelmer)
Changed in brz-git:
status: New → Triaged
importance: Undecided → Medium
status: Triaged → Incomplete
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

This is fixed in brz-git, but resuming from this error may require deleting the original bzr branch.

Changed in brz-git:
status: Incomplete → Fix Released
assignee: nobody → Jelmer Vernooij (jelmer)
Jelmer Vernooij (jelmer)
affects: brz-git → brz
Changed in brz:
milestone: none → 3.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.