#5855 KeyError on path building for SCM file view

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

we get this error fairly frequently (mostly from spiders)

File '/var/local/allura/Allura/allura/controllers/repository.py', line 541 in index
  context = self._blob.context()
File '/var/local/allura/Allura/allura/model/repo.py', line 708 in context
  if prev is not None: prev = prev.get_path(path, create=False)
File '/var/local/allura/Allura/allura/model/repo.py', line 357 in get_path
  cur = cur[part]
File '/var/local/allura/Allura/allura/model/repo.py', line 428 in __getitem__
  obj = self.by_name[name]
KeyError: u'trunk2'

  PATH_INFO: '/p/sakura-editor/code/2537/tree/sakura/trunk2/sakura_core/convert/CConvert_Trim.h'

other examples:
  PATH_INFO: '/p/zeoslib/code-0/652/tree/branches/6.6-patches/build/build.cmd'
  PATH_INFO: '/p/zeoslib/code-0/2070/tree/trunk/packages/Delphi2010/ZComponent.dpk'
  PATH_INFO: '/p/mifos/git-1/ci/75a13b503ae0c9a9f2a91839aae602fc7e41d5a9/tree/reports/standardReports/resources/style/images/mifoslogo.jpg'

Discussion

  • Dave Brondsema

    Dave Brondsema - 2013-02-22
    • size: --> 2
     
  • Cory Johns - 2013-03-01
    • status: open --> in-progress
    • assigned_to: Cory Johns
     
  • Cory Johns - 2013-03-01

    allura:cj/5896

    I couldn't actually reproduce the error, but this change should resolve it anyway.

     
  • Cory Johns - 2013-03-01
    • status: in-progress --> code-review
     
    • qa: Tim Van Steenburgh
     
    • status: code-review --> in-progress
     
  • Looks good but I got a test failure:

    ERROR: allura.tests.unit.test_repo:TestBlob.test_prev_commit_no_create
      vim +140 allura/tests/unit/test_repo.py  # test_prev_commit_no_create
        pc = blob.prev_commit  vim +18  /var/local/env-allura/lib/python2.7/site-packages/Ming-0.3.2dev_20121101-py2.7.egg/ming/utils.py  # __get__
        result = obj.__dict__[self.__name__] = self._func(obj)
      vim +668 allura/model/repo.py  # prev_commit    pcid = LastCommit._prev_commit_id(self.commit, self.path().strip('/'))
      vim +661 allura/model/repo.py  # path
        return self.tree.path() + h.really_unicode(self.name)TypeError: unsupported operand type(s) for +: 'Mock' and 'unicode'
    
     
  • Cory Johns - 2013-03-06

    Moved to allura:cj/5855 where it was supposed to be and fixed test.

     
  • Cory Johns - 2013-03-06
    • status: in-progress --> code-review
     
    • status: code-review --> closed
     

Log in to post a comment.