git: ChangesetDoesNotExistError only fixed by restarting apache

Issue #802 resolved
abelard-a created an issue

I created a new branch made some modifications, pushed the whole thing, the changeset is showing in the summary and in the changelog but trying to access the changeset from the changelog tab raised a ChangesetDoesNotExistError. I restarted apache2 (i'm using mod_wsgi) and the changeset is now properly displayed.

here is the error I got:

Module weberror.errormiddleware:162 in __call__
>>  app_iter = self.application(environ, sr_checker)
Module beaker.middleware:155 in __call__
>>  return self.wrap_app(environ, session_start_response)
Module routes.middleware:131 in __call__
>>  response =, start_response)
Module pylons.wsgiapp:107 in __call__
>>  response = self.dispatch(controller, environ, start_response)
Module pylons.wsgiapp:312 in dispatch
>>  return controller(environ, start_response)
Module rhodecode.lib.base:302 in __call__
>>  return WSGIController.__call__(self, environ, start_response)
Module pylons.controllers.core:211 in __call__
>>  response = self._dispatch_call()
Module pylons.controllers.core:162 in _dispatch_call
>>  response = self._inspect_call(func)
Module pylons.controllers.core:105 in _inspect_call
>>  result = self._perform_call(func, args)
Module pylons.controllers.core:57 in _perform_call
>>  return func(**args)
Module rhodecode.controllers.changeset:310 in index
>>  return render('changeset/changeset.html')
Module pylons.templating:243 in render_mako
>>  cache_type=cache_type, cache_expire=cache_expire)
Module pylons.templating:218 in cached_template
>>  return render_func()
Module pylons.templating:240 in render_template
>>  return literal(template.render_unicode(**globs))
Module mako.template:421 in render_unicode
>>  as_unicode=True)
Module mako.runtime:766 in _render
>>  **_kwargs_for_callable(callable_, data))
Module mako.runtime:798 in _render_context
>>  _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
Module mako.runtime:819 in _exec_template
>>  _render_error(template, context, e)
Module mako.runtime:828 in _render_error
>>  result = template.error_handler(context, error)
Module mako.runtime:817 in _exec_template
>>  callable_(context, *args, **kwargs)
Module _base_root_html:68 in render_body
>>  __M_writer(escape(next.body()))
Module _base_base_html:73 in render_body
>>  __M_writer(escape(next.main()))
Module changeset_changeset_html:106 in render_main
>>  if c.changeset.children:
Module rhodecode.lib.vcs.utils.lazy:27 in __get__
>>  result = obj.__dict__[self.__name__] = self._func(obj)
Module rhodecode.lib.vcs.backends.git.changeset:196 in children
>>  return [self.repository.get_changeset(cs) for cs in children]
Module rhodecode.lib.vcs.backends.git.repository:439 in get_changeset
>>  revision = self._get_revision(revision)
Module rhodecode.lib.vcs.backends.git.repository:268 in _get_revision
>>  "for this repository %s" % (revision, self))
ChangesetDoesNotExistError: Revision '803d6101b38c42493e9529b0b999d376d8c9b087' does not exist for this repository <GitRepository at /usr/local/rhodecode/repositories/DSI/webmail>
CGI Variables
CONTENT_TYPE    '; charset="utf-8"'
DOCUMENT_ROOT   '/var/www'
HTTP_ACCEPT     'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
HTTP_ACCEPT_ENCODING    'gzip, deflate'
HTTP_ACCEPT_LANGUAGE    'en-US,en;q=0.5'
HTTP_COOKIE     '__utma=98697562.2130638823.1330776308.1363123296.1363214313.109;|utmccn=(referral)|utmcmd=referral|utmcct=/4OXJIPuRVy; rhodecode=cac9b5233b1a439080a42eca94d6d42e'
HTTP_DNT    '1'
HTTP_USER_AGENT     'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:20.0) Gecko/20100101 Firefox/20.0'
PATH_INFO   '/DSI/webmail/changeset/6a9da14b70da139ba37cda26002d49aa7893f419'
PATH_TRANSLATED     '/usr/local/rhodecode/dispatch.wsgi/DSI/webmail/changeset/6a9da14b70da139ba37cda26002d49aa7893f419'
REMOTE_PORT     '36786'
REQUEST_URI     '/DSI/webmail/changeset/6a9da14b70da139ba37cda26002d49aa7893f419'
SCRIPT_FILENAME     '/usr/local/rhodecode/dispatch.wsgi'
SERVER_PORT     '80'
SERVER_SIGNATURE    '<address>Apache/2.2.16 (Debian) Server at Port 80</address>\n'
SERVER_SOFTWARE     'Apache/2.2.16 (Debian)'
WSGI Variables
application     <beaker.middleware.SessionMiddleware object at 0x7fba8d4de410>
beaker.get_session  <bound method SessionMiddleware._get_session of <beaker.middleware.SessionMiddleware object at 0x7fba8d4de410>>
beaker.session  {'_authentication_token': 'cea02c80b7bb17bc13eb8b1ba2e136afabdf906d', 'rhodecode_user': {'username': u'abelard-a', 'is_authenticated': True, 'user_id': 10L}, '_accessed_time': 1363803589.571516, '_creation_time': 1363803530.2514911}
mod_wsgi.application_group  '|'
mod_wsgi.callable_object    'application'
mod_wsgi.handler_script     ''
mod_wsgi.input_chunked  '0'
mod_wsgi.listener_host  ''
mod_wsgi.listener_port  '80'
mod_wsgi.process_group  ''
mod_wsgi.request_handler    'wsgi-script'
mod_wsgi.script_reloading   '1'
mod_wsgi.version    (3, 3)
paste.registry  <paste.registry.Registry object at 0x7fba8dc6b150>
paste.throw_errors  True
pylons.action_method    <bound method ChangesetController.index of <rhodecode.controllers.changeset.ChangesetController object at 0x7fba8ef20290>>
pylons.controller   <rhodecode.controllers.changeset.ChangesetController object at 0x7fba8ef20290>
pylons.environ_config   {'session': 'beaker.session', 'cache': 'beaker.cache'}
pylons.pylons   <pylons.util.PylonsContext object at 0x7fba8ef20790>
pylons.routes_dict  {'action': u'index', 'controller': u'changeset', 'revision': u'6a9da14b70da139ba37cda26002d49aa7893f419', 'repo_name': u'DSI/webmail'}
routes.cached_hostinfo  {'host': '', 'protocol': 'https'}
routes.route    <routes.route.Route object at 0x7fba8d0da250>
routes.url  <routes.util.URLGenerator object at 0x7fba8dc6bf50>
webob._parsed_query_vars    (GET([]), '')
webob.adhoc_attrs   {'user': <AuthUser('id:10:abelard-a|True')>, 'language': 'en-us'}
wsgi process    'Multi process AND threads (?)'
wsgi._org_proto     'https'
wsgi.file_wrapper   <built-in method file_wrapper of mod_wsgi.Adapter object at 0x7fba8dc3a918>
wsgi.version    (1, 1)
wsgiorg.routing_args    (<routes.util.URLGenerator object at 0x7fba8dc6bf50>, {'action': u'index', 'controller': u'changeset', 'revision': u'6a9da14b70da139ba37cda26002d49aa7893f419', 'repo_name': u'DSI/webmail'})

Comments (10)

  1. Marcin Kuzminski repo owner

    It looks like you use multiprocessing setup with apache ? please check if you don't specify processes directive in apache wsgi config

  2. abelard-a reporter

    Yes, indeed:

    WSGIDaemonProcess pylons threads=4 python-path=/usr/local/lib/python2.6/site-packages user=www-data group=www-data

    I'll disable the threads part and check how it goes. Thanks

  3. Stephen Price

    Sorry if this is a separate issue, but I'm experiencing a similar problem using two RhodeCode 1.5.4 instances (with waitress) behind an Nginx proxy. Recent git commits show these errors, but seem to go away after maybe 5-10 minutes.

  4. Stephen Price

    That's a good point. Other than using separate ini files with unique instance id's, I didn't do anything to the cache settings. I assumed it'd shared the session data folder without any extra configuration. I'll review the docs again.

  5. Marcin Kuzminski repo owner

    Basically the only important thing is the unique IDs in .ini files. 5-10 minutes is to low for cache to expire, it looks like na issue with invalidating cache for both instances... You can check how many unique cache keys are present in repo settings when beein an super admin. Also try to delete all entries in cache_invalidation table and restart both instances. Maybe the cache table got polluted somehow

  6. Stephen Price

    Would clicking "invalidate repository cache" on that repo's settings page be enough?

    Would switching to a database-based cache be any better? I'm running PostgreSQL as RhodeCode's database.

  7. Marcin Kuzminski repo owner

    Clicking invalidate cache should immediately fix issues that you have with missing changesets. Switching to database-based cache shouldn't have any affect since the caches for the repos are kept in memory for each instance. Other caches are used for different things.

    Please clean the cache_invalidation table and restart instances

  8. Log in to comment