built-in user accessing /_admin/my_account raises an exception

Issue #244 resolved
Augusto Herrmann created an issue

How to reproduce:

Install RhodeCode 1.2.0 beta

Login as an Administrator (built-in account created during the install process)

Select the username link leading to /_admin/my_account/

An excption is raised

Note that this does not happen to administrator user accounts created by the user interface in the application. Apparently only the built-in account is affected. Also, the built-in user can in fact edit his own user through the user edit interface (/_admin/users), just as he can edit any other user.

I'll include a full stack trace of this exception here as soon as I can.

Comments (3)

  1. Augusto Herrmann reporter

    Here's the promised full stack trace of the exception:

    2011-09-13 12:09:53.159 INFO  [rhodecode.lib.auth] user herrmann authenticated correctly
    2011-09-13 12:09:53.164 INFO  [rhodecode.controllers.login] user herrmann is now authenticated and stored in session
    Error - <type 'exceptions.KeyError'>: 'repo'
    URL: http://localhost:5000/_admin/my_account
    File '/home/herrmann/dev/rhodecode/pyenv/lib/python2.6/site-packages/weberror/errormiddleware.py', line 162 in __call__
      app_iter = self.application(environ, sr_checker)
    File '/home/herrmann/dev/rhodecode/pyenv/lib/python2.6/site-packages/RhodeCode-1.2.0beta-py2.6.egg/rhodecode/lib/middleware/simplegit.py', line 108 in __call__
      return self.application(environ, start_response)
    File '/home/herrmann/dev/rhodecode/pyenv/lib/python2.6/site-packages/RhodeCode-1.2.0beta-py2.6.egg/rhodecode/lib/middleware/simplehg.py', line 73 in __call__
      return self.application(environ, start_response)
    File '/home/herrmann/dev/rhodecode/pyenv/lib/python2.6/site-packages/beaker/middleware.py', line 152 in __call__
      return self.wrap_app(environ, session_start_response)
    File '/home/herrmann/dev/rhodecode/pyenv/lib/python2.6/site-packages/routes/middleware.py', line 131 in __call__
      response = self.app(environ, start_response)
    File '/home/herrmann/dev/rhodecode/pyenv/lib/python2.6/site-packages/pylons/wsgiapp.py', line 107 in __call__
      response = self.dispatch(controller, environ, start_response)
    File '/home/herrmann/dev/rhodecode/pyenv/lib/python2.6/site-packages/pylons/wsgiapp.py', line 312 in dispatch
      return controller(environ, start_response)
    File '/home/herrmann/dev/rhodecode/pyenv/lib/python2.6/site-packages/RhodeCode-1.2.0beta-py2.6.egg/rhodecode/lib/base.py', line 52 in __call__
      return WSGIController.__call__(self, environ, start_response)
    File '/home/herrmann/dev/rhodecode/pyenv/lib/python2.6/site-packages/pylons/controllers/core.py', line 211 in __call__
      response = self._dispatch_call()
    File '/home/herrmann/dev/rhodecode/pyenv/lib/python2.6/site-packages/pylons/controllers/core.py', line 162 in _dispatch_call
      response = self._inspect_call(func)
    File '/home/herrmann/dev/rhodecode/pyenv/lib/python2.6/site-packages/pylons/controllers/core.py', line 105 in _inspect_call
      result = self._perform_call(func, args)
    File '/home/herrmann/dev/rhodecode/pyenv/lib/python2.6/site-packages/pylons/controllers/core.py', line 57 in _perform_call
      return func(**args)
    File '<string>', line 2 in my_account
    File '/home/herrmann/dev/rhodecode/pyenv/lib/python2.6/site-packages/RhodeCode-1.2.0beta-py2.6.egg/rhodecode/lib/auth.py', line 382 in __wrapper
      return func(*fargs, **fkwargs)
    File '/home/herrmann/dev/rhodecode/pyenv/lib/python2.6/site-packages/RhodeCode-1.2.0beta-py2.6.egg/rhodecode/controllers/admin/settings.py', line 316 in my_account
      render('admin/users/user_edit_my_account.html'),
    File '/home/herrmann/dev/rhodecode/pyenv/lib/python2.6/site-packages/pylons/templating.py', line 243 in render_mako
      cache_type=cache_type, cache_expire=cache_expire)
    File '/home/herrmann/dev/rhodecode/pyenv/lib/python2.6/site-packages/pylons/templating.py', line 218 in cached_template
      return render_func()
    File '/home/herrmann/dev/rhodecode/pyenv/lib/python2.6/site-packages/pylons/templating.py', line 240 in render_template
      return literal(template.render_unicode(**globs))
    File '/home/herrmann/dev/rhodecode/pyenv/lib/python2.6/site-packages/mako/template.py', line 305 in render_unicode
      as_unicode=True)
    File '/home/herrmann/dev/rhodecode/pyenv/lib/python2.6/site-packages/mako/runtime.py', line 660 in _render
      **_kwargs_for_callable(callable_, data))
    File '/home/herrmann/dev/rhodecode/pyenv/lib/python2.6/site-packages/mako/runtime.py', line 692 in _render_context
      _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
    File '/home/herrmann/dev/rhodecode/pyenv/lib/python2.6/site-packages/mako/runtime.py', line 713 in _exec_template
      _render_error(template, context, e)
    File '/home/herrmann/dev/rhodecode/pyenv/lib/python2.6/site-packages/mako/runtime.py', line 722 in _render_error
      result = template.error_handler(context, error)
    File '/home/herrmann/dev/rhodecode/pyenv/lib/python2.6/site-packages/mako/runtime.py', line 711 in _exec_template
      callable_(context, *args, **kwargs)
    File '/home/herrmann/dev/rhodecode/deploy/data/templates/base/root.html.py', line 62 in render_body
      __M_writer(escape(next.body()))
    File '/home/herrmann/dev/rhodecode/deploy/data/templates/base/base.html.py', line 150 in render_body
      __M_writer(escape(next.main()))
    File '/home/herrmann/dev/rhodecode/deploy/data/templates/admin/users/user_edit_my_account.html.py', line 218 in render_main
      __M_writer(escape(repo['repo'].last_change))
    KeyError: 'repo'
    
    CGI Variables
    -------------
      CONTENT_LENGTH: '0'
      CONTENT_TYPE: '; charset="utf-8"'
      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.7'
      HTTP_ACCEPT_ENCODING: 'gzip,deflate'
      HTTP_ACCEPT_LANGUAGE: 'pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3'
      HTTP_CONNECTION: 'keep-alive'
      HTTP_COOKIE: 'rhodecode=a788aaf1720d36643b82b3a8ca835558c412153acf6577be8fa2b617567e75c48f2c7bf6'
      HTTP_HOST: 'localhost:5000'
      HTTP_KEEP_ALIVE: '115'
      HTTP_REFERER: 'http://localhost:5000/'
      HTTP_USER_AGENT: 'Mozilla/5.0 (X11; U; Linux i686; pt-BR; rv:1.9.2.22) Gecko/20110905 Ubuntu/10.04 (lucid) Firefox/3.6.22'
      PATH_INFO: '/_admin/my_account'
      REMOTE_ADDR: '127.0.0.1'
      REQUEST_METHOD: 'GET'
      SERVER_NAME: '127.0.0.1'
      SERVER_PORT: '5000'
      SERVER_PROTOCOL: 'HTTP/1.1'
    
    WSGI Variables
    --------------
      application: <rhodecode.lib.middleware.simplegit.SimpleGit object at 0x9e54d0c>
      beaker.get_session: <bound method SessionMiddleware._get_session of <beaker.middleware.SessionMiddleware object at 0x9e5ee8c>>
      beaker.session: {'rhodecode_user': <AuthUser('id:2:herrmann|True')>, '_accessed_time': 1315926597.092056, '_creation_time': 1315926583.8944881}
      paste.httpserver.thread_pool: <paste.httpserver.ThreadPool object at 0x989216c>
      paste.registry: <paste.registry.Registry object at 0x9fedecc>
      paste.throw_errors: True
      pylons.action_method: <bound method SettingsController.my_account of <rhodecode.controllers.admin.settings.SettingsController object at 0x9e5ee0c>>
      pylons.controller: <rhodecode.controllers.admin.settings.SettingsController object at 0x9e5ee0c>
      pylons.environ_config: {'session': 'beaker.session', 'cache': 'beaker.cache'}
      pylons.pylons: <pylons.util.PylonsContext object at 0x9fe186c>
      pylons.routes_dict: {'action': u'my_account', 'controller': u'admin/settings'}
      routes.route: <routes.route.Route object at 0x9cec96c>
      routes.url: <routes.util.URLGenerator object at 0x9fe1d8c>
      webob._parsed_query_vars: (GET([]), '')
      webob.adhoc_attrs: {'language': 'en-us'}
      wsgi process: 'Multithreaded'
      wsgiorg.routing_args: (<routes.util.URLGenerator object at 0x9fe1d8c>, {'action': u'my_account', 'controller': u'admin/settings'})
    ------------------------------------------------------------
    
    
  2. Log in to comment