NoSuchId error applying inventory delta

Bug #734145 reported by Eli Zaretskii
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar Git Plugin
Invalid
Medium
Unassigned

Bug Description

"bzr branch git://git.savannah.gnu.org/gnulib.git" crashed (after almost 2 hours of intensive work) with the backtrace below. I have it in the debugger, let me know if I can do something to help debugging this.

Here's the full trace from my .bzr.log:

0.125 bazaar version: 2.3.0
0.125 bzr arguments: [u'branch', u'git://git.savannah.gnu.org/gnulib.git']
0.172 looking for plugins in C:/Documents and Settings/Zaretzky/Application Data/bazaar/2.0/plugins
0.172 looking for plugins in D:/usr/Bazaar/plugins
0.375 encoding stdout as sys.stdout encoding 'cp862'
0.453 bzr-svn: using Subversion 1.6.6 (), subvertpy 0.7.5
1.875 creating repository in file:///D:/gnu/bzr/gnulib.git/.bzr/.
4047.078 Auto-packing repository GCRepositoryPackCollection(CHKInventoryRepository('file:///D:/gnu/bzr/gnulib.git/.bzr/repository/')), which has 10 pack files, containing 10000 revisions. Packing 10 files into 1 affecting 10000 revisions
4047.594 repacking 10000 revisions
4073.797 repacking 10000 inventories
4091.094 repacking chk: 9996 id_to_entry roots, 1367 p_id_map roots, 34202 total keys
4191.391 repacking 31402 texts
4467.938 repacking 0 signatures
4479.250 Auto-packing repository GCRepositoryPackCollection(CHKInventoryRepository('file:///D:/gnu/bzr/gnulib.git/.bzr/repository/')) completed
5136.375 checking remap as size shrunk by 33 to be 3766
6713.438 Transferred: 19415kB (2.9kB/s r:19415kB w:0kB)
6713.438 Traceback (most recent call last):
  File "D:\usr\Bazaar\lib\library.zip\bzrlib\commands.py", line 926, in exception_to_return_code
  File "D:\usr\Bazaar\lib\library.zip\bzrlib\commands.py", line 1126, in run_bzr
  File "D:\usr\Bazaar\lib\library.zip\bzrlib\commands.py", line 691, in run_argv_aliases
  File "D:\usr\Bazaar\lib\library.zip\bzrlib\commands.py", line 713, in run
  File "bzrlib\cleanup.pyo", line 135, in run_simple
  File "bzrlib\cleanup.pyo", line 165, in _do_with_cleanups
  File "bzrlib\builtins.pyo", line 1227, in run
  File "bzrlib\controldir.pyo", line 374, in sprout
  File "bzrlib\cleanup.pyo", line 131, in run
  File "bzrlib\cleanup.pyo", line 165, in _do_with_cleanups
  File "bzrlib\controldir.pyo", line 427, in _sprout
  File "bzrlib\repository.pyo", line 1781, in fetch
  File "D:/usr/Bazaar/plugins\git\fetch.py", line 534, in fetch
  File "D:/usr/Bazaar/plugins\git\fetch.py", line 596, in fetch_objects
  File "D:/usr/Bazaar/plugins\git\fetch.py", line 465, in import_git_objects
  File "D:/usr/Bazaar/plugins\git\fetch.py", line 380, in import_git_commit
  File "bzrlib\repofmt\groupcompress_repo.pyo", line 986, in add_inventory_by_delta
  File "bzrlib\inventory.pyo", line 1713, in create_by_apply_delta
  File "bzrlib\inventory.pyo", line 666, in id2path
  File "bzrlib\inventory.pyo", line 1946, in _iter_file_id_parents
  File "bzrlib\inventory.pyo", line 1909, in __getitem__
NoSuchId: The file id "m4/unistd__h.m4" is not present in the tree <bzrlib.inventory.CHKInventory object at 0x08C4AB50>.

Revision history for this message
Eli Zaretskii (eliz) wrote :
Download full text (3.4 KiB)

I tried that on another Windows XP machine, and this time sat tight and looked at the progress display. This attempt progressed further than the first one (why?), but still crashed. This crash happened during the "Adding files" phase (I think). Here's the full trace from .bzr.log:

0.172 bazaar version: 2.3.0
0.172 bzr arguments: [u'branch', u'git://git.savannah.gnu.org/gnulib.git', u'gnulib']
0.250 looking for plugins in C:/Documents and Settings/p0009057/Application Data/bazaar/2.0/plugins
0.250 looking for plugins in C:/Program Files/Bazaar/plugins
0.687 encoding stdout as sys.stdout encoding 'cp862'
1.969 creating repository in file:///D:/usr/eli/bzr/gnulib/.bzr/.
4776.563 Auto-packing repository GCRepositoryPackCollection(CHKInventoryRepository('file:///D:/usr/eli/bzr/gnulib/.bzr/repository/')), which has 10 pack files, containing 10000 revisions. Packing 10 files into 1 affecting 10000 revisions
4777.032 repacking 10000 revisions
4805.042 repacking 10000 inventories
4821.821 repacking chk: 9996 id_to_entry roots, 1367 p_id_map roots, 34202 total keys
4965.157 repacking 31402 texts
5222.928 repacking 0 signatures
5235.941 Auto-packing repository GCRepositoryPackCollection(CHKInventoryRepository('file:///D:/usr/eli/bzr/gnulib/.bzr/repository/')) completed
5986.415 checking remap as size shrunk by 33 to be 3766
11504.501 Packing repository GCRepositoryPackCollection(CHKInventoryRepository('file:///D:/usr/eli/bzr/gnulib/.bzr/repository/')), which has 6 pack files, containing 14209 revisions with hint ['c79de7dd918fdc13b993e076cc304930', 'c5262f497d1d2ef891abfdd4e081f78f', '44e334ecb978accce329a6869f16ba0a', '5bc887639994a43ffb41398ac364cf62', 'a1f0e2b578cf6cc997f612bb18449d9b', '92ff782999555875a58a42a006a73568', '1bb733c88ad0365ec65652b452f00eb5', '0ac4fe4c63fdf5562d81b960e3478bf5', '6845b86e17dc8696b823643f778676f6', 'ba338f71996ff1d4d6a05b5c3908ba1b', 'd7bf1202fc064565672808fa36904f2f', '468d78af6244482fcf198acd2af0f5bf', 'c534f399ecef73aa2b7f9b9a031e67b9', '4e5303b693dab42a8ee82c68e4818885', '1b328727266c999551430a67774c903b'].
11505.063 repacking 14209 revisions
11550.681 repacking 14209 inventories
11574.271 repacking chk: 14203 id_to_entry roots, 2242 p_id_map roots, 62418 total keys
11763.256 repacking 65256 texts
12245.507 repacking 0 signatures
12268.925 creating branch <bzrlib.branch.BzrBranchFormat7 object at 0x00CE9BB0> in file:///D:/usr/eli/bzr/gnulib/
12272.128 created new branch BzrBranch7(file:///D:/usr/eli/bzr/gnulib/)
12272.300 opening working tree 'D:/usr/eli/bzr/gnulib'
12441.304 Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 923, in exception_to_return_code
  File "bzrlib\commands.pyo", line 1123, in run_bzr
  File "bzrlib\commands.pyo", line 691, in run_argv_aliases
  File "bzrlib\commands.pyo", line 710, in run
  File "bzrlib\cleanup.pyo", line 135, in run_simple
  File "bzrlib\cleanup.pyo", line 165, in _do_with_cleanups
  File "bzrlib\builtins.pyo", line 1234, in run
  File "bzrlib\tag.pyo", line 298, in _merge_tags_if_possible
  File "C:/Program Files/Bazaar/plugins\git\branch.py", line 149, in merge_to
  File "C:/Program Files/Bazaar/plugins\git\branch.py", line 1...

Read more...

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 734145] Re: bzr-git crashes branching from gnulib
Download full text (3.7 KiB)

On Sun, 2011-03-13 at 09:51 +0000, Eli Zaretskii wrote:
> I tried that on another Windows XP machine, and this time sat tight and
> looked at the progress display. This attempt progressed further than
> the first one (why?), but still crashed. This crash happened during the
> "Adding files" phase (I think). Here's the full trace from .bzr.log:
>
> 0.172 bazaar version: 2.3.0
> 0.172 bzr arguments: [u'branch', u'git://git.savannah.gnu.org/gnulib.git', u'gnulib']
> 0.250 looking for plugins in C:/Documents and Settings/p0009057/Application Data/bazaar/2.0/plugins
> 0.250 looking for plugins in C:/Program Files/Bazaar/plugins
> 0.687 encoding stdout as sys.stdout encoding 'cp862'
> 1.969 creating repository in file:///D:/usr/eli/bzr/gnulib/.bzr/.
> 4776.563 Auto-packing repository GCRepositoryPackCollection(CHKInventoryRepository('file:///D:/usr/eli/bzr/gnulib/.bzr/repository/')), which has 10 pack files, containing 10000 revisions. Packing 10 files into 1 affecting 10000 revisions
> 4777.032 repacking 10000 revisions
> 4805.042 repacking 10000 inventories
> 4821.821 repacking chk: 9996 id_to_entry roots, 1367 p_id_map roots, 34202 total keys
> 4965.157 repacking 31402 texts
> 5222.928 repacking 0 signatures
> 5235.941 Auto-packing repository GCRepositoryPackCollection(CHKInventoryRepository('file:///D:/usr/eli/bzr/gnulib/.bzr/repository/')) completed
> 5986.415 checking remap as size shrunk by 33 to be 3766
> 11504.501 Packing repository GCRepositoryPackCollection(CHKInventoryRepository('file:///D:/usr/eli/bzr/gnulib/.bzr/repository/')), which has 6 pack files, containing 14209 revisions with hint ['c79de7dd918fdc13b993e076cc304930', 'c5262f497d1d2ef891abfdd4e081f78f', '44e334ecb978accce329a6869f16ba0a', '5bc887639994a43ffb41398ac364cf62', 'a1f0e2b578cf6cc997f612bb18449d9b', '92ff782999555875a58a42a006a73568', '1bb733c88ad0365ec65652b452f00eb5', '0ac4fe4c63fdf5562d81b960e3478bf5', '6845b86e17dc8696b823643f778676f6', 'ba338f71996ff1d4d6a05b5c3908ba1b', 'd7bf1202fc064565672808fa36904f2f', '468d78af6244482fcf198acd2af0f5bf', 'c534f399ecef73aa2b7f9b9a031e67b9', '4e5303b693dab42a8ee82c68e4818885', '1b328727266c999551430a67774c903b'].
> 11505.063 repacking 14209 revisions
> 11550.681 repacking 14209 inventories
> 11574.271 repacking chk: 14203 id_to_entry roots, 2242 p_id_map roots, 62418 total keys
> 11763.256 repacking 65256 texts
> 12245.507 repacking 0 signatures
> 12268.925 creating branch <bzrlib.branch.BzrBranchFormat7 object at 0x00CE9BB0> in file:///D:/usr/eli/bzr/gnulib/
> 12272.128 created new branch BzrBranch7(file:///D:/usr/eli/bzr/gnulib/)
> 12272.300 opening working tree 'D:/usr/eli/bzr/gnulib'
> 12441.304 Traceback (most recent call last):
> File "bzrlib\commands.pyo", line 923, in exception_to_return_code
> File "bzrlib\commands.pyo", line 1123, in run_bzr
> File "bzrlib\commands.pyo", line 691, in run_argv_aliases
> File "bzrlib\commands.pyo", line 710, in run
> File "bzrlib\cleanup.pyo", line 135, in run_simple
> File "bzrlib\cleanup.pyo", line 165, in _do_with_cleanups
> File "bzrlib\builtins.pyo", line 1234, in run
> File "bzrlib\tag.pyo", line 298, in _merge_tags_if_possible
> File "...

Read more...

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: bzr-git crashes branching from gnulib

I suspect the original bug is due to some / and \ mismatching on Windows.

Revision history for this message
Eli Zaretskii (eliz) wrote :

Yes, I have ./bzr/repository/git-unpeel-map file. This is what it contains (note: this is on the machine where I produced the _second_ traceback; will show the one from the first one later today):

unpeel map version 1
d5daff19f4a26e67e7c410cefa9ddc13e036162a: d11be07eab194fc5e039c8d14eb423207409ff27
692e80d36f3d6aea3e812600815c97389d6bc4fb: e53ea8ba3ca2f871dee6b3550eda061aba64b87d

Revision history for this message
Eli Zaretskii (eliz) wrote :

OK, I will try on GNU/Linux next. Stay tuned.

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 734145] Re: bzr-git crashes branching from gnulib

On Sun, 2011-03-13 at 15:17 +0000, Eli Zaretskii wrote:
> OK, I will try on GNU/Linux next. Stay tuned.
That works, but if you're interested it'd be great to sort out these
windows issues..

Cheers,

Jelmer

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

On Sun, 2011-03-13 at 16:46 +0000, Jelmer Vernooij wrote:
> On Sun, 2011-03-13 at 15:17 +0000, Eli Zaretskii wrote:
> > OK, I will try on GNU/Linux next. Stay tuned.
> That works, but if you're interested it'd be great to sort out these
> windows issues..
Hmm, just failed here too:

charis:~/tmp% bzr git-import git://git.savannah.gnu.org/gnulib.git
bzr: ERROR: Revision {('modules/lock-tests',
'git-v1:dcf49e35108a6a1897f15090e22dcd9763872292')} not present in
"CHKInventoryRepository('file:///home/jelmer/tmp/gnulib.git/.bzr/repository/')".

Cheers,

Jelmer

Revision history for this message
Eli Zaretskii (eliz) wrote : Re: bzr-git crashes branching from gnulib

Yes, of course, I'm interested to figure out the Windows issues. My main development platform is Windows.

So I take it that it crashed for you on GNU/Linux also, and so I no longer need to try that myself?

Anyway, let me know how I can help you. Both crashed sessions on both Windows machines are sitting in the debugger.

Revision history for this message
Eli Zaretskii (eliz) wrote :

Any news? Is there anything I can do to help investigating this problem?

I tried several more git repositories on git.savannah.gnu.org, and quite a few of them crashed "bzr branch" in the same way, with this error message:

ValueError: need more than 1 value to unpack

This happens at the very end, when bzr is already done creating the branch and populating the tree. And the branch seems to be functional, the crash notwithstanding: "bzr check" does not report any problem and "bzr log" works as expected.

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

Please file a separate bug report about the ValueError as it's a different issue than this bug report.

Changed in bzr-git:
status: New → Triaged
importance: Undecided → Medium
summary: - bzr-git crashes branching from gnulib
+ NoSuchId error applying inventory delta
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

I've filed bug 737936 aboiut the ValueError issue.

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

Can you try this again with bzr-git trunk?

Revision history for this message
Eli Zaretskii (eliz) wrote :

The good news are, the original bug is probably gone. The bad news... well, see for yourself:

I needed to install the latest trunk of dulwich, because the new bzr-git won't work with dulwich 0.7.0, which is the latest released version. After that, it worked all the way, but crashed at the end with this traceback:

12036.188 Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 926, in exception_to_return_code
  File "bzrlib\commands.pyo", line 1126, in run_bzr
  File "bzrlib\commands.pyo", line 691, in run_argv_aliases
  File "bzrlib\commands.pyo", line 713, in run
  File "bzrlib\cleanup.pyo", line 135, in run_simple
  File "bzrlib\cleanup.pyo", line 165, in _do_with_cleanups
  File "bzrlib\builtins.pyo", line 1230, in run
  File "bzrlib\transport\__init__.pyo", line 1173, in delete_tree
  File "bzrlib\transport\__init__.pyo", line 1154, in delete_multi
  File "bzrlib\transport\__init__.pyo", line 450, in _iterate_over
  File "bzrlib\transport\local.pyo", line 434, in delete
  File "bzrlib\transport\__init__.pyo", line 316, in _translate_error
PermissionDenied: Permission denied: "D:/gnu/bzr/gnulib.test/./.bzr/repository/git/idmap.db": [Error 32] The process cannot access the file because it is being used by another process: u'D:/gnu/bzr/gnulib.test/./.bzr/repository/git/idmap.db'

I can assure you that no other bzr was running in that repository at the time. So it's probably bzr-git stepping on its own toes.

Let me know if I can help you investigate that.

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 734145] Re: NoSuchId error applying inventory delta

On Tue, 2011-04-05 at 20:42 +0000, Eli Zaretskii wrote:
> The good news are, the original bug is probably gone. The bad news...
> well, see for yourself:
>
> I needed to install the latest trunk of dulwich, because the new bzr-git
> won't work with dulwich 0.7.0, which is the latest released version.
> After that, it worked all the way, but crashed at the end with this
> traceback:
>
> 12036.188 Traceback (most recent call last):
> File "bzrlib\commands.pyo", line 926, in exception_to_return_code
> File "bzrlib\commands.pyo", line 1126, in run_bzr
> File "bzrlib\commands.pyo", line 691, in run_argv_aliases
> File "bzrlib\commands.pyo", line 713, in run
> File "bzrlib\cleanup.pyo", line 135, in run_simple
> File "bzrlib\cleanup.pyo", line 165, in _do_with_cleanups
> File "bzrlib\builtins.pyo", line 1230, in run
> File "bzrlib\transport\__init__.pyo", line 1173, in delete_tree
> File "bzrlib\transport\__init__.pyo", line 1154, in delete_multi
> File "bzrlib\transport\__init__.pyo", line 450, in _iterate_over
> File "bzrlib\transport\local.pyo", line 434, in delete
> File "bzrlib\transport\__init__.pyo", line 316, in _translate_error
> PermissionDenied: Permission denied: "D:/gnu/bzr/gnulib.test/./.bzr/repository/git/idmap.db": [Error 32] The process cannot access the file because it is being used by another process: u'D:/gnu/bzr/gnulib.test/./.bzr/repository/git/idmap.db'
>
> I can assure you that no other bzr was running in that repository at the
> time. So it's probably bzr-git stepping on its own toes.
>
> Let me know if I can help you investigate that.
This happens because bzr encountered an error during the fetch and then
tried to remove the branch so it wouldn't leave any broken data around.
That delete happened while there was a file still open (which works fine
on POSIX but breaks on Windows, which doesn't allow removing open
files).

Can you try again with the delete_tree stuff skipped? This should be a
matter of adding "raise" on a new line 1230 of bzrlib/builtins.py,
before the delete_tree call.

Cheers,

Jelmer

Revision history for this message
Eli Zaretskii (eliz) wrote :

Just so I'm sure I make the right change in builtins.py, could you please show the exact line I should insert?

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

On Wed, 2011-04-06 at 03:03 +0000, Eli Zaretskii wrote:
> Just so I'm sure I make the right change in builtins.py, could you
> please show the exact line I should insert?
just the word "raise" as the single statement in that line, indented one
level more than the previous line.

Cheers,

Jelmer

Revision history for this message
Eli Zaretskii (eliz) wrote :

After adding that "raise" line, "bzr brach" succeeded. Very frustrating.

I will try again a couple of times, including with the original builtins.pyo as it came with the installer. If it doesn't crash again, I guess we can consider this bug resolved.

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

I'm going to consider this fix released, feel free to open if you can reproduce it again.

Changed in bzr-git:
status: Incomplete → Invalid
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.