1. Marcin Kuzminski
  2. RhodeCode
  3. Issues

Issues

Issue #544 resolved

Error when opening repo summary page

randy2009
created an issue

Hi, when we try to open 1 repo's summary page, we get an error (see attachment for stacktrace).

We restarted rhodecode/apache and it didn't solve the problem. Some other pages throw the same error, while other repo pages work well.

Comments (9)

  1. Bart Schapendonk

    I have some more info, This only seems to happen to repositories that have statistics enabled. Disabling statistics seems to fix it.

    URL: https://server/unit/project/summary
    File '/var/www/rhodecode-venv/lib/python2.7/site-packages/WebError-0.10.3-py2.7.egg/weberror/errormiddleware.py', line 162 in __call__
      app_iter = self.application(environ, sr_checker)
    File '/var/www/rhodecode-venv/lib/python2.7/site-packages/Beaker-1.6.3-py2.7.egg/beaker/middleware.py', line 155 in __call__
      return self.wrap_app(environ, session_start_response)
    File '/var/www/rhodecode-venv/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/www/rhodecode-venv/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/www/rhodecode-venv/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/www/rhodecode-venv/lib/python2.7/site-packages/RhodeCode-1.3.6-py2.7.egg/rhodecode/lib/base.py', line 180 in __call__
      return WSGIController.__call__(self, environ, start_response)
    File '/var/www/rhodecode-venv/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/www/rhodecode-venv/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/controllers/core.py', line 162 in _dispatch_call
      response = self._inspect_call(func)
    File '/var/www/rhodecode-venv/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/controllers/core.py', line 105 in _inspect_call
      result = self._perform_call(func, args)
    File '/var/www/rhodecode-venv/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/controllers/core.py', line 57 in _perform_call
      return func(**args)
    File '/var/www/rhodecode-venv/lib/python2.7/site-packages/RhodeCode-1.3.6-py2.7.egg/rhodecode/controllers/summary.py', line 185 in index
      return render('summary/summary.html')
    File '/var/www/rhodecode-venv/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/templating.py', line 243 in render_mako
      cache_type=cache_type, cache_expire=cache_expire)
    File '/var/www/rhodecode-venv/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/templating.py', line 218 in cached_template
      return render_func()
    File '/var/www/rhodecode-venv/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/templating.py', line 240 in render_template
      return literal(template.render_unicode(**globs))
    File '/var/www/rhodecode-venv/lib/python2.7/site-packages/Mako-0.7.0-py2.7.egg/mako/template.py', line 406 in render_unicode
      as_unicode=True)
    File '/var/www/rhodecode-venv/lib/python2.7/site-packages/Mako-0.7.0-py2.7.egg/mako/runtime.py', line 764 in _render
      **_kwargs_for_callable(callable_, data))
    File '/var/www/rhodecode-venv/lib/python2.7/site-packages/Mako-0.7.0-py2.7.egg/mako/runtime.py', line 796 in _render_context
      _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
    File '/var/www/rhodecode-venv/lib/python2.7/site-packages/Mako-0.7.0-py2.7.egg/mako/runtime.py', line 817 in _exec_template
      _render_error(template, context, e)
    File '/var/www/rhodecode-venv/lib/python2.7/site-packages/Mako-0.7.0-py2.7.egg/mako/runtime.py', line 826 in _render_error
      result = template.error_handler(context, error)
    File '/var/www/rhodecode-venv/lib/python2.7/site-packages/Mako-0.7.0-py2.7.egg/mako/runtime.py', line 815 in _exec_template
      callable_(context, *args, **kwargs)
    File '/var/www/rhodecode/data/templates/base/root.html.py', line 64 in render_body
      __M_writer(escape(next.body()))
    File '/var/www/rhodecode/data/templates/base/base.html.py', line 75 in render_body
      __M_writer(escape(next.main()))
    File '/var/www/rhodecode/data/templates/summary/summary.html.py', line 185 in render_main
      __M_writer(escape(h.repo_link(c.dbrepo.groups_and_repo)))
    File '/var/www/rhodecode-venv/lib/python2.7/site-packages/RhodeCode-1.3.6-py2.7.egg/rhodecode/model/db.py', line 575 in groups_and_repo
      return self.groups_with_parents, self.just_name
    File '/var/www/rhodecode-venv/lib/python2.7/site-packages/RhodeCode-1.3.6-py2.7.egg/rhodecode/model/db.py', line 565 in groups_with_parents
      gr = getattr(cur_gr, 'parent_group', None)
    File '/var/www/rhodecode-venv/lib/python2.7/site-packages/SQLAlchemy-0.7.6-py2.7-linux-x86_64.egg/sqlalchemy/orm/attributes.py', line 168 in __get__
      return self.impl.get(instance_state(instance),dict_)
    File '/var/www/rhodecode-venv/lib/python2.7/site-packages/SQLAlchemy-0.7.6-py2.7-linux-x86_64.egg/sqlalchemy/orm/attributes.py', line 453 in get
      value = self.callable_(state, passive)
    File '/var/www/rhodecode-venv/lib/python2.7/site-packages/SQLAlchemy-0.7.6-py2.7-linux-x86_64.egg/sqlalchemy/orm/strategies.py', line 481 in _load_for_state
      (mapperutil.state_str(state), self.key)
    DetachedInstanceError: Parent instance <RepoGroup at 0x7fb82081fc10> is not bound to a Session; lazy load operation of attribute 'parent_group' cannot proceed
    [Thu Aug 30 12:58:59 2012] [error] [client 192.168.x.x]
    [Thu Aug 30 12:58:59 2012] [error] [client 192.168.x.x]
    CGI Variables
    -------------
      CONTENT_TYPE: '; charset="utf-8"'
      DOCUMENT_ROOT: '/var/www'
      GATEWAY_INTERFACE: 'CGI/1.1'
      HTTPS: '1'
      HTTP_ACCEPT: 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
      HTTP_ACCEPT_CHARSET: 'ISO-8859-1,utf-8;q=0.7,*;q=0.3'
      HTTP_ACCEPT_ENCODING: 'gzip,deflate,sdch'
      HTTP_ACCEPT_LANGUAGE: 'en-US,en;q=0.8,nl;q=0.6'
      HTTP_CONNECTION: 'keep-alive'
      HTTP_COOKIE: 'rhodecode='
      HTTP_HOST: 'server'
      HTTP_REFERER: 'https://server/unit'
      HTTP_USER_AGENT: 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.8 (KHTML, like Gecko) Chrome/23.0.1246.0 Safari/537.8'
      HTTP_X_URL_SCHEME: 'https'
      PATH_INFO: '/unit/project/summary'
      PATH_TRANSLATED: '/var/www/rhodecode/hg.wsgi/unit/project/summary'
      REMOTE_ADDR: '192.168.x.x'
      REMOTE_PORT: '53089'
      REQUEST_METHOD: 'GET'
      REQUEST_URI: '/unit/project/summary'
      SCRIPT_FILENAME: '/var/www/rhodecode/hg.wsgi'
      SERVER_ADDR: '192.168.x.x'
      SERVER_ADMIN: '[no address given]'
      SERVER_NAME: 'server'
      SERVER_PORT: '443'
      SERVER_PROTOCOL: 'HTTP/1.1'
      SERVER_SOFTWARE: 'Apache'
      SSL_TLS_SNI: 'server'
    [Thu Aug 30 12:58:59 2012] [error] [client 192.168.x.x]
    [Thu Aug 30 12:58:59 2012] [error] [client 192.168.x.x]
    WSGI Variables
    --------------
      application: <beaker.middleware.SessionMiddleware object at 0x7fb81931db10>
      beaker.get_session: <bound method SessionMiddleware._get_session of <beaker.middleware.SessionMiddleware object at 0x7fb81931db10>>
      beaker.session: {'_authentication_token': '0', 'rhodecode_user': {'username': u'yser', 'is_authenticated': True, 'user_id': 3}, '_accessed_time': 0.0, '_creation_time': 0.0}
      mod_wsgi.application_group: 'hg'
      mod_wsgi.callable_object: 'application'
      mod_wsgi.handler_script: ''
      mod_wsgi.input_chunked: '0'
      mod_wsgi.listener_host: ''
      mod_wsgi.listener_port: '443'
      mod_wsgi.process_group: 'hg'
      mod_wsgi.request_handler: 'wsgi-script'
      mod_wsgi.script_reloading: '1'
      mod_wsgi.version: (3, 3)
      paste.registry: <paste.registry.Registry object at 0x7fb820b7b150>
      paste.throw_errors: True
      pylons.action_method: <bound method SummaryController.index of <rhodecode.controllers.summary.SummaryController object at 0x7fb820b7bc90>>
      pylons.controller: <rhodecode.controllers.summary.SummaryController object at 0x7fb820b7bc90>
      pylons.environ_config: {'session': 'beaker.session', 'cache': 'beaker.cache'}
      pylons.pylons: <pylons.util.PylonsContext object at 0x7fb820b7b190>
      pylons.routes_dict: {'action': u'index', 'controller': u'summary', 'repo_name': u'unit/project'}
      routes.cached_hostinfo: {'host': 'server', 'protocol': 'https'}
      routes.route: <routes.route.Route object at 0x7fb818fa7fd0>
      routes.url: <routes.util.URLGenerator object at 0x7fb820b7b210>
      webob._parsed_query_vars: (GET([]), '')
      webob.adhoc_attrs: {'user': <AuthUser('id:3:user|True')>, 'language': 'en-us'}
      wsgi process: 'Multi process AND threads (?)'
      wsgi.file_wrapper: <built-in method file_wrapper of mod_wsgi.Adapter object at 0x7fb81ffed8a0>
      wsgi.version: (1, 1)
      wsgiorg.routing_args: (<routes.util.URLGenerator object at 0x7fb820b7b210>, {'action': u'index', 'controller': u'summary', 'repo_name': u'unit/project'})
    ------------------------------------------------------------
    
  2. Marcelo Bissaro

    Just adding some more info, in case someone in the future, faces the same problem as I did.

    After upgrade from 1.4.1 to 1.5.3, I got this problem. I solved it by editing the production.ini and changing this attribute:

    celery.always.eager = true

    It was false. So, just set to true, restarted rhodecode, and it worked.

  3. Dave Wongillies

    Just adding some info, in case someone in the future faces the same problem as Marcelo and I did.

    So setting celery.always.eager = true isn't the ideal way as it means that tasks are executed locally and synchronously, which defeats the purpose of using celery.

    I'm not sure about Marcelo's setup but with mine, I'm using gunicorn and had set it to use the asynchronous gevent worker.

    ## GUNICORN ##
    use = egg:gunicorn#main
    ## number of process workers. You must set `instance_id = *` when this option
    ## is set to more than one worker
    workers = 5
    ## process name
    proc_name = rhodecode
    ## type of worker class, one of sync, eventlet, gevent, tornado
    ## recommended for bigger setup is using of of other than sync one
    worker_class = gevent
    max_requests = 5
    ## amount of time a worker can handle request before it get's killed and
    ## restarted
    timeout = 3600
    

    After changing worker_class to sync I've found I've no longer had any of these errors.

  4. Log in to comment