git: bzrlib.errors.NoSuchId: The file id "None" is not present in the tree <bzrlib.inventory.CHKInventory object at 0xdc378d0>

Bug #937235 reported by jugglefish on 2012-02-20
62
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Bazaar Git Plugin
Medium
William Grant
Breezy
Medium
William Grant

Bug Description

bzrlib.errors.NoSuchId: The file id "None" is not present in the tree <bzrlib.inventory.CHKInventory object at 0xdc378d0>.
Fehler

git fetch bzr::/opt/openerp-bzr-WIP/addons/trunk :refs/remotes/bzr/trunk
Traceback (most recent call last):
  File "/usr/lib/git-core/git-remote-bzr", line 49, in <module>
    helper.process(sys.stdin, sys.stdout)
  File "/home/pn/.bazaar/plugins/git/git_remote_helper.py", line 168, in process
    self.process_line(l, outf)
  File "/home/pn/.bazaar/plugins/git/git_remote_helper.py", line 184, in process_line
    self.commands[argv[0]](self, outf, argv)
  File "/home/pn/.bazaar/plugins/git/git_remote_helper.py", line 120, in cmd_list
    for ref, git_sha1 in refs.as_dict().iteritems():
  File "/usr/local/lib/python2.7/dist-packages/dulwich-0.8.4-py2.7-linux-x86_64.egg/dulwich/repo.py", line 202, in as_dict
    ret[key] = self[("%s/%s" % (base, key)).strip("/")]
  File "/usr/local/lib/python2.7/dist-packages/dulwich-0.8.4-py2.7-linux-x86_64.egg/dulwich/repo.py", line 273, in __getitem__
    _, sha = self._follow(name)
  File "/usr/local/lib/python2.7/dist-packages/dulwich-0.8.4-py2.7-linux-x86_64.egg/dulwich/repo.py", line 255, in _follow
    contents = self.read_ref(refname)
  File "/usr/local/lib/python2.7/dist-packages/dulwich-0.8.4-py2.7-linux-x86_64.egg/dulwich/repo.py", line 231, in read_ref
    contents = self.read_loose_ref(refname)
  File "/home/pn/.bazaar/plugins/git/refs.py", line 134, in read_loose_ref
    return self.object_store._lookup_revision_sha1(revid)
  File "/home/pn/.bazaar/plugins/git/object_store.py", line 577, in _lookup_revision_sha1
    self._update_sha_map(revid)
  File "/home/pn/.bazaar/plugins/git/object_store.py", line 380, in _update_sha_map
    self._update_sha_map_revision(revid)
  File "/home/pn/.bazaar/plugins/git/object_store.py", line 480, in _update_sha_map_revision
    for path, obj, ie in self._revision_to_objects(rev, tree, lossy=(not self.mapping.roundtripping)):
  File "/home/pn/.bazaar/plugins/git/object_store.py", line 434, in _revision_to_objects
    self._cache.idmap, unusual_modes, self.mapping.BZR_DUMMY_FILE):
  File "/home/pn/.bazaar/plugins/git/object_store.py", line 292, in _tree_to_objects
    assert tree.kind(file_id) == 'directory'
  File "/usr/lib/python2.7/dist-packages/bzrlib/revisiontree.py", line 165, in kind
    return self._inventory[file_id].kind
  File "/usr/lib/python2.7/dist-packages/bzrlib/inventory.py", line 1902, in __getitem__
    raise errors.NoSuchId(self, file_id)
bzrlib.errors.NoSuchId: The file id "None" is not present in the tree <bzrlib.inventory.CHKInventory object at 0xdc378d0>.
Fehler

Jelmer Vernooij (jelmer) wrote :

Can you perhaps try again with trunk ? You should get a different exception now that will help with debugging.

jugglefish (pniederlag) wrote :

rm -rf BZR-BRANCH/.bzr/repository/git

(* master 49e1d34 Add assertion) seems to still be the same expception though:

git fetch bzr::/opt/openerp-bzr-WIP/addons/trunk :refs/remotes/bzr/trunk
Traceback (most recent call last):
  File "/usr/lib/git-core/git-remote-bzr", line 49, in <module>
    helper.process(sys.stdin, sys.stdout)
  File "/home/pn/.bazaar/plugins/git/git_remote_helper.py", line 168, in process
    self.process_line(l, outf)
  File "/home/pn/.bazaar/plugins/git/git_remote_helper.py", line 174, in process_line
    fetch(outf, self.wants, self.shortname, self.remote_dir, self.local_dir)
  File "/home/pn/.bazaar/plugins/git/git_remote_helper.py", line 79, in fetch
    inter.fetch_refs(update_refs, lossy=lossy)
  File "/home/pn/.bazaar/plugins/git/push.py", line 257, in fetch_refs
    old_refs = self._get_target_bzr_refs()
  File "/home/pn/.bazaar/plugins/git/push.py", line 241, in _get_target_bzr_refs
    for (kind, type_data) in self.source_store.lookup_git_sha(v):
  File "/home/pn/.bazaar/plugins/git/object_store.py", line 649, in lookup_git_sha
    return self.lookup_git_shas([sha])[sha]
  File "/home/pn/.bazaar/plugins/git/object_store.py", line 641, in lookup_git_shas
    self._update_sha_map()
  File "/home/pn/.bazaar/plugins/git/object_store.py", line 382, in _update_sha_map
    self._update_sha_map_revision(revid)
  File "/home/pn/.bazaar/plugins/git/object_store.py", line 482, in _update_sha_map_revision
    for path, obj, ie in self._revision_to_objects(rev, tree, lossy=(not self.mapping.roundtripping)):
  File "/home/pn/.bazaar/plugins/git/object_store.py", line 436, in _revision_to_objects
    self._cache.idmap, unusual_modes, self.mapping.BZR_DUMMY_FILE):
  File "/home/pn/.bazaar/plugins/git/object_store.py", line 294, in _tree_to_objects
    assert tree.kind(file_id) == 'directory'
  File "/usr/lib/python2.7/dist-packages/bzrlib/revisiontree.py", line 165, in kind
    return self._inventory[file_id].kind
  File "/usr/lib/python2.7/dist-packages/bzrlib/inventory.py", line 1902, in __getitem__
    raise errors.NoSuchId(self, file_id)
bzrlib.errors.NoSuchId: The file id "None" is not present in the tree <bzrlib.inventory.CHKInventory object at 0xe01df50>.
Fehler

Jelmer Vernooij (jelmer) on 2012-03-04
Changed in bzr-git:
status: New → Triaged
importance: Undecided → Medium
narnie (signupnarnie) wrote :

Any news on a work-around so we can push our updates to git?

jugglefish (pniederlag) wrote :

any way we can help to narrow down the problem?

jugglefish (pniederlag) wrote :

Repo,read_ref is called with 'HEAD' as argument, which in my case is still empty (no commit yet).

weird though this doesn't happen on the very first commit but somewhere in the history. maybe this happens on some brachpoint?

Jelmer Vernooij (jelmer) wrote :

The _revision_to_objects method is broken and needs a rewrite. There are some corner cases it doesn't handle - including this one.

I haven't had time for this yet.

narnie (signupnarnie) wrote :

As a point of information, I have no branchpoint in the project this happened on in my case.

narnie (signupnarnie) wrote :

Due to the slow response of what seems like an important issue, I am abandoning bzr (as has sourceforge.org which hosts my project) as my DVCS. I have spent much time with git over the past several days and am liking how fast and stable it seems to be (and the fact that I can actually push my code to sourceforge.org.).

Another strike for Canonical (I have moved from Ubuntu to Linux Mint Debian Edition tracking testing).

Regretfully,
Narnie

edice (harris-pc) wrote :

This is also an issue for me too.

I've just noticed git works on windows now, so will be looking at that.

Michael Gratton (mjog) wrote :

I was having this problem yesterday attempting to dpush to a git repo. I have already worked around it, but on reflection, it may have been caused by any of:

1. Having merged a number of other bzr branches using `bzr join` to the one I was trying to dpush from
2. Creating/moving an empty directory in the bzr repo
3. Some combination of the two - they both happened at the same time that this error started to happen

Luis Arias (kaaloo) wrote :

I was wondering what kind of workaround you found Mike ? I just ran into this same issue while dpushing one of our bigger bzr repositories to github.

William Grant (wgrant) on 2015-05-08
Changed in bzr-git:
assignee: nobody → William Grant (wgrant)
status: Triaged → In Progress
William Grant (wgrant) on 2015-10-05
Changed in bzr-git:
status: In Progress → Fix Committed
Jelmer Vernooij (jelmer) on 2018-03-05
Changed in brz-git:
status: New → Fix Released
importance: Undecided → Medium
assignee: nobody → William Grant (wgrant)
Jelmer Vernooij (jelmer) on 2018-03-28
Changed in brz-git:
milestone: none → integration
Jelmer Vernooij (jelmer) on 2018-05-10
affects: brz-git → brz
Changed in brz:
milestone: integration → none
milestone: none → 3.0.0
summary: - bzrlib.errors.NoSuchId: The file id "None" is not present in the tree
- <bzrlib.inventory.CHKInventory object at 0xdc378d0>
+ git: bzrlib.errors.NoSuchId: The file id "None" is not present in the
+ tree <bzrlib.inventory.CHKInventory object at 0xdc378d0>
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers