#6938 AttributeError on /p/fonttools/code/forks/ [ss5849]

v1.1.0
closed
nobody
General
2015-08-20
2013-12-03
Chris Tsai
No

[forge:site-support:#5849]

Consistent 500s on https://sourceforge.net/p/fonttools/code/forks/

I think this is the right trace:

File does not exist: /var/www/icons/pi, referer: http://sourceforge.net/projects/pidgin/files/Pidgin/2.10.7/pidgin-2.10.7.exe/down
load?accel_key=62%3A1386079262%3Ahttp%253A//www.pidgin.im/download/%3Afbca0263%242bb869b00cf93408f4fb85a0833b62c8d789bd8e&click_id=583ec1de-5c23-11e3-944e-0200ac1d1d97&source=accel
File does not exist: /var/www/icons/re, referer: http://sourceforge.net/projects/repsnapper/files/latest/download
File does not exist: /var/www/icons/pi, referer: http://sourceforge.net/projects/pidgin/files/Pidgin/2.10.7/pidgin-2.10.7.exe/down
load?accel_key=62%3A1386079364%3Ahttp%253A//pidgin.im/%3Ab2743f29%245464321eb2b91289b9a5bd284245661059cb190e&click_id=9514bec4-5c23-11e3-9248-0200ac1d1d8c&source=accel
File does not exist: /var/www/icons/pi, referer: http://sourceforge.net/projects/trillianotr/
mod_wsgi (pid=3064): Exception occurred processing WSGI script '/etc/httpd/conf.d/allura.wsgi'.
IOError: failed to write data
mod_wsgi (pid=3064): Exception occurred processing WSGI script '/etc/httpd/conf.d/allura.wsgi'.
IOError: failed to write data
Error - <type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'url'
URL: https://sourceforge.net/p/fonttools/code/forks/
File '/var/local/env-allura/lib/python2.7/site-packages/WebError-0.10.3_20130423-py2.7.egg/weberror/errormiddleware.py', line 242 
in next
  return self.app_iterator.next()
File '/var/local/env-allura/lib/python2.7/site-packages/Paste-1.7.5.1-py2.7.egg/paste/registry.py', line 409 in streaming_iter
  for item in self.application(environ, start_response):
File '/var/local/env-allura/lib/python2.7/site-packages/Ming-0.4.2-py2.7.egg/ming/odm/middleware.py', line 20 in __call__
  result = self.app(environ, start_response)
File '/var/local/allura/Allura/allura/lib/custom_middleware.py', line 59 in __call__
  return self.app(environ, start_response)
File '/var/local/env-allura/lib/python2.7/site-packages/EasyWidgets-0.2dev_20130716-py2.7.egg/ew/middleware.py', line 65 in __call
__
  result = self.app(environ, start_response)
File '/var/local/allura/Allura/allura/lib/custom_middleware.py', line 180 in __call__
  return resp(environ, start_response)
File '/var/local/allura/Allura/allura/config/middleware.py', line 197 in AlluraGlobalsMiddleware
  return app(environ, start_response)
File '/var/local/allura/Allura/allura/lib/custom_middleware.py', line 140 in __call__
  return self._app(environ, session_start_response)
File '/var/local/env-allura/lib/python2.7/site-packages/TimerMiddleware-0.4.4-py2.7.egg/timermiddleware/__init__.py', line 196 in 
__call__
  resp = req.get_response(self.app)
File '/var/local/env-allura/lib/python2.7/site-packages/WebOb-1.0.8-py2.7.egg/webob/request.py', line 1053 in get_response
  application, catch_exc_info=False)
File '/var/local/env-allura/lib/python2.7/site-packages/WebOb-1.0.8-py2.7.egg/webob/request.py', line 1022 in call_application
  app_iter = application(self.environ, start_response)
File '/var/local/allura/Allura/allura/lib/custom_middleware.py', line 96 in __call__
  self.app, environ, catch_exc_info=True)
File '/var/local/env-allura/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/util.py', line 48 in call_wsgi_application
  app_iter = application(environ, start_response)
File '/var/local/env-allura/lib/python2.7/site-packages/Beaker-1.5.4-py2.7.egg/beaker/middleware.py', line 152 in __call__
  return self.wrap_app(environ, session_start_response)
File '/var/local/env-allura/lib/python2.7/site-packages/Routes-1.12.3-py2.7.egg/routes/middleware.py', line 131 in __call__
  response = self.app(environ, start_response)
File '/var/local/forge-classic/sfx/middleware.py', line 49 in __call__
  resp = request.get_response(self.app)
File '/var/local/env-allura/lib/python2.7/site-packages/WebOb-1.0.8-py2.7.egg/webob/request.py', line 1053 in get_response
  application, catch_exc_info=False)
File '/var/local/env-allura/lib/python2.7/site-packages/WebOb-1.0.8-py2.7.egg/webob/request.py', line 1022 in call_application
  app_iter = application(self.environ, start_response)
File '/var/local/env-allura/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/wsgiapp.py', line 107 in __call__
  response = self.dispatch(controller, environ, start_response)
File '/var/local/env-allura/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/wsgiapp.py', line 312 in dispatch
  return controller(environ, start_response)
File '/var/local/allura/Allura/allura/lib/base.py', line 46 in __call__
  response = super(WsgiDispatchController, self).__call__(environ, start_response)
File '/var/local/env-allura/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/controllers/core.py', line 211 in __call__
  response = self._dispatch_call()
File '/var/local/env-allura/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/controllers/core.py', line 162 in _dispatch_ca
ll
  response = self._inspect_call(func)
File '/var/local/env-allura/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/controllers/core.py', line 105 in _inspect_cal
l
  result = self._perform_call(func, args)
File '/var/local/env-allura/lib/python2.7/site-packages/TurboGears2-2.1.5-py2.7.egg/tg/controllers/dispatcher.py', line 258 in _pe
rform_call
  r = self._call(func, params, remainder=remainder)
File '/var/local/allura/Allura/allura/lib/patches.py', line 116 in _call
  return old_controller_call(self, controller, *args, **kwargs)
File '/var/local/env-allura/lib/python2.7/site-packages/TurboGears2-2.1.5-py2.7.egg/tg/controllers/decoratedcontroller.py', line 1
20 in _call
  output = controller_callable(*remainder, **dict(params))
File '<string>', line 2 in forks
File '/var/local/allura/Allura/allura/lib/patches.py', line 82 in with_trailing_slash
  return func(*args, **kwargs)
File '/var/local/allura/Allura/allura/controllers/repository.py', line 94 in forks
  repo_path_parts = f.url().strip('/').split('/')
File '/var/local/allura/Allura/allura/model/repository.py', line 448 in url
  return self.app_config.url()
File '/var/local/allura/Allura/allura/model/project.py', line 974 in url
  return project.url() + self.options.mount_point + '/'
AttributeError: 'NoneType' object has no attribute 'url'

Discussion

  • Chris Tsai - 2013-12-03
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -4,6 +4,7 @@
    
     I think this is the right trace:
    
    +~~~~
     File does not exist: /var/www/icons/pi, referer: http://sourceforge.net/projects/pidgin/files/Pidgin/2.10.7/pidgin-2.10.7.exe/down
     load?accel_key=62%3A1386079262%3Ahttp%253A//www.pidgin.im/download/%3Afbca0263%242bb869b00cf93408f4fb85a0833b62c8d789bd8e&click_id=583ec1de-5c23-11e3-944e-0200ac1d1d97&source=accel
     File does not exist: /var/www/icons/re, referer: http://sourceforge.net/projects/repsnapper/files/latest/download
    @@ -87,5 +88,4 @@
     File '/var/local/allura/Allura/allura/model/project.py', line 974 in url
       return project.url() + self.options.mount_point + '/'
     AttributeError: 'NoneType' object has no attribute 'url'
    -
    -
    +~~~~
    
     
  • Dave Brondsema

    Dave Brondsema - 2013-12-20
    • Labels: support, p3 --> p3, support, 42cc
    • Status: open --> in-progress
     
  • Igor Bondarenko

    Igor Bondarenko - 2014-01-14

    The problem is that one of repo's forks don't have an options in AppConfig. We have no idea how it might happen. Deleting repo's fork doesn't reproduce that error. Can you check in mongo directly if this is the case?

    Workaround for this could be:

    diff --git Allura/allura/model/repository.py Allura/allura/model/repository.py
    index 06ade3f..c5c295a 100644
    --- Allura/allura/model/repository.py
    +++ Allura/allura/model/repository.py
    @@ -589,7 +589,7 @@ def pending_upstream_merges(self):
         @property
         def forks(self):
             all_forks = self.query.find({'upstream_repo.name': self.url()}).all()
    -        return filter(lambda fork: fork.app_config is not None, all_forks)
    +        return filter(lambda fork: fork.app_config is not None and fork.app_config.options is not None, all_forks)
    

    I've keeping ticket on our side open, maybe you'll have some ideas how that might happen? If workaround above is good enough for now - let me know and I'll close the ticket.

     
  • Dave Brondsema

    Dave Brondsema - 2014-01-14

    I checked db['git-repository'].find({'upstream_repo.name': '/p/fonttools/code/'}) and the 3 forks' app_config_ids all have entries in the config collection. But 2 of those configs do not have their associated projects any more. So somehow the project got removed but its app configs didn't get removed at that time.

     
  • Igor Bondarenko

    Igor Bondarenko - 2014-01-15

    Ok, so I think workaround that I mentioned earlier must be:

    return filter(lambda fork: fork.app_config is not None and fork.app_config.project is not None, all_forks)
    

    I don't know how projects end up missing, since AFAIR project deletion just marks project as deleted and doesn't remove actual entry.

     
  • Dave Brondsema

    Dave Brondsema - 2014-01-15
    • status: in-progress --> validation
    • QA: Dave Brondsema
    • Milestone: limbo --> forge-jan-24
     
  • Dave Brondsema

    Dave Brondsema - 2014-01-15

    I've committed the change you suggested.

    I don't know how the projects would've been removed either. They were user-projects. And we have a private script we use to actually remove tools, but it removes app configs too, and I don't see any logs for it having run for the projects. Oh well.. not a concern at this point.

     
  • Dave Brondsema

    Dave Brondsema - 2014-01-16
    • status: validation --> closed
     

Log in to post a comment.