#8264 AssertionError from git branch lock file

v1.11.0
closed
None
SCM
nobody
8 hours ago
2018-11-14
No

A temporary or stale branch lock file can cause this error:

File '/var/local/allura/ForgeGit/forgegit/model/git_repo.py', line 610 in branches
  return self._get_refs('branches')
File '/var/local/env-allura/lib/python2.7/site-packages/TimerMiddleware-0.4.4-py2.7.egg/timermiddleware/__init__.py', line 117 in wrapper
  return self.run_and_log(func, inst, *args, **kwargs)
File '/var/local/env-allura/lib/python2.7/site-packages/TimerMiddleware-0.4.4-py2.7.egg/timermiddleware/__init__.py', line 126 in run_and_log
  return func(*args, **kwargs)
File '/var/local/allura/ForgeGit/forgegit/model/git_repo.py', line 566 in _get_refs
  hex_sha = ref.commit.hexsha
File '/var/local/env-allura/lib/python2.7/site-packages/GitPython-2.1.11-py2.7.egg/git/refs/symbolic.py', line 200 in _get_commit
  obj = self._get_object()
File '/var/local/env-allura/lib/python2.7/site-packages/GitPython-2.1.11-py2.7.egg/git/refs/symbolic.py', line 193 in _get_object
  return Object.new_from_sha(self.repo, hex_to_bin(self.dereference_recursive(self.repo, self.path)))
File '/var/local/env-allura/lib/python2.7/site-packages/GitPython-2.1.11-py2.7.egg/git/refs/symbolic.py', line 135 in dereference_recursive
  hexsha, ref_path = cls._get_ref_info(repo, ref_path)
File '/var/local/env-allura/lib/python2.7/site-packages/GitPython-2.1.11-py2.7.egg/git/refs/symbolic.py', line 184 in _get_ref_info
  return cls._get_ref_info_helper(repo, ref_path)
File '/var/local/env-allura/lib/python2.7/site-packages/GitPython-2.1.11-py2.7.egg/git/refs/symbolic.py', line 153 in _get_ref_info_helper
  assert(len(tokens) != 0)
AssertionError:

A quick fix is to rm refs/heads/foo.lock but it'd be better if we ignored this error.

Discussion

  • Dave Brondsema

    Dave Brondsema - 2018-11-14
    • status: in-progress --> review
     
  • Dave Brondsema

    Dave Brondsema - 2018-11-14

    Fix on branch db/8264

     
  • Kenton Taylor

    Kenton Taylor - 2018-11-14
    • status: review --> closed
     
  • Kenton Taylor

    Kenton Taylor - 2018-11-14

    Merged.

     
  • Dave Brondsema

    Dave Brondsema - 8 hours ago
    • Milestone: unreleased --> v1.11.0
     

Log in to post a comment.