#3759 KeyError in updated commit_browser, for many repos - NEEDS SCRIPT

v1.0.0
closed
sf-2 (994)
SCM
2015-08-20
2012-02-17
No

Some repos are fine, but many error with a trace like this. I don't remember what repo this was from (allura?) so may need to get another example to figure out what's wrong exactly.

Module allura.controllers.repository:181 in commit_browser_data
<<      def commit_browser_data(self):
               head_ids = [ head.object_id for head in c.app.repo.heads ]
               commit_ids = list(M.repo.commitlog(head_ids))
               log.info('Grab %d commit objects by ID', len(commit_ids))
               commits_by_id = dict(
>>  commit_ids = list(M.repo.commitlog(head_ids))
Module allura.model.repo:402 in _gen_ids
<<              # parents to the 'ready set'
                   new_parent = None
                   for oid in ci_parents[ci]:
                       children = ci_children[oid]
                       children.discard(ci)
>>  for oid in ci_parents[ci]:
KeyError: u'fe0c660f87d355d39886d3d013868a6d83a65643'

Related

Tickets: #3059
Tickets: #3146
Tickets: #3975

Discussion

  • Dave Brondsema

    Dave Brondsema - 2012-02-17
    • size: --> 2
     
    • status: open --> in-progress
    • assigned_to: Tim Van Steenburgh
     
    • summary: KeyError in updated commit_browser, for many repos --> KeyError in updated commit_browser, for many repos - NEEDS SCRIPT
    • status: in-progress --> code-review
    • qa: Dave Brondsema
     
  • forge:tv/3759 (branched off of tv/3059)

    You can repro the problem on dev by doing the following:

    1. Create a git tool.
    2. Clone the repo on your sandbox.
    3. Commit, then push. Do this 3 times.

    After the 3rd push, the commit browser will break, and you'll see the KeyError in the log.

    On tv/3759, the commit browser will work as expected using the same steps. You can also try doing some branching and merging and make sure the commit browser works as expected (I did).

    In prod, we now have CommitRunDoc mongo docs that are missing commit_times. To fix this we'll need to run:

    paster script production.ini ../scripts/refresh-all-repos.py -- --all
    

    You can do this on your sandbox to fix the repo from steps 1-3 above, and then verify the commit browser is working.

     
  • Dave Brondsema

    Dave Brondsema - 2012-03-02
    • status: code-review --> open
     
  • Dave Brondsema

    Dave Brondsema - 2012-03-02

    After making several hg commits on dev, i switched and reindexed. I got a new error. This also appeared when trying to browse the history.

    If you want to look at the specific commits, it is on 7024. Repo at /hg/p/xyz/code-1/

    File '/home/dbrondsema/dbrondsema-7024/forge/Allura/allura/controllers/repository.py', line 181 in commit_browser_data
      commit_ids = list(M.repo.commitlog(head_ids))
    File '/home/dbrondsema/dbrondsema-7024/forge/Allura/allura/model/repo.py', line 499 in _gen_ids
      ci = max(commits, key=lambda ci:ci_times[ci])
    File '/home/dbrondsema/dbrondsema-7024/forge/Allura/allura/model/repo.py', line 499 in <lambda>
      ci = max(commits, key=lambda ci:ci_times[ci])
    KeyError: u'a355155b8f4861b9b88ef316ade2519db6d118a3'
    
     
  • Dave Brondsema

    Dave Brondsema - 2012-03-02

    Also if we could get a test that'd be nice.

     
    • status: open --> in-progress
     
  • To ssh://engr.geek.net/forge
    + a7bc048...98f7792 tv/3759 -> tv/3759 (forced update)

    Fixed Hg problem and added tests for CommitRunBuilder for Git and Hg. Rick fixed the SVN last_commit problem and added a test for that.

     
    • status: in-progress --> code-review
     
  • Dave Brondsema

    Dave Brondsema - 2012-03-22

    This particular issue is fixed. Will merge with [#3059] though

     

    Related

    Tickets: #3059

  • Dave Brondsema

    Dave Brondsema - 2012-03-22
    • status: code-review --> closed
     

Log in to post a comment.