Issue #301 resolved

Admin Journal not accesible

Ton Plomp
created an issue

We are using Rhodecode 1.2.3 (upgraded from 1.2 beta via 1.2.3, 1.2.1 and 1.2.0) based on a MySQL DB. When I want to acces the Admin journal I get an error 500, the debug emails boils down to: AttributeError: 'NoneType' object has no attribute 'repo_id'

The anonymous Journal works.

Here's the full debug-mail.

Module rhodecode.controllers.journal:2 in index

Module rhodecode.lib.auth:348 in __wrapper

<< if user.is_authenticated or api_access_ok: log.debug('user %s is authenticated', user.username) return func(fargs, *fkwargs) else: log.warn('user %s NOT authenticated', user.username)

return func(fargs, *fkwargs) Module rhodecode.controllers.journal:2 in index

Module rhodecode.lib.auth:381 in __wrapper

<< return redirect(url('login_home', came_from=p)) else: return func(fargs, *fkwargs)

return func(fargs, *fkwargs) Module rhodecode.controllers.journal:75 in index

<< if request.environ.get('HTTP_X_PARTIAL_XHR'): return c.journal_data return render('journal/journal.html')

       def _get_daily_aggregate(self, journal):

return render('journal/journal.html') Module pylons.templating:243 in render_mako

return cached_template(template_name, render_template, cache_key=cache_key, cache_type=cache_type, cache_expire=cache_expire)

cache_type=cache_type, cache_expire=cache_expire) Module pylons.templating:218 in cached_template

<< return content else: return render_func()

return render_func() Module pylons.templating:240 in render_template

<< template = globs['app_globals'].mako_lookup.get_template(template_name)

           return literal(template.render_unicode(**globs))

       return cached_template(template_name, render_template, cache_key=cache_key,

return literal(template.render_unicode(**globs)) Module mako.template:311 in render_unicode

<< args, data, as_unicode=True)

       def render_context(self, context, *args, **kwargs):

as_unicode=True) Module mako.runtime:660 in _render

render_context(template, callable, context, args, *kwargs_for_callable(callable, data)) return context._pop_buffer().getvalue()

**kwargs_for_callable(callable, data)) Module mako.runtime:692 in _render_context

<< # if main render method, call from the base of the inheritance stack (inherit, lclcontext) = _populate_self_namespace(context, tmpl) _exec_template(inherit, lclcontext, args=args, kwargs=kwargs) else: # otherwise, call the actual rendering method specified

_exec_template(inherit, lclcontext, args=args, kwargs=kwargs) Module mako.runtime:713 in _exec_template

<< callable_(context, args, *kwargs) except Exception, e: _render_error(template, context, e) except: e = sys.exc_info()[0]

_render_error(template, context, e) Module mako.runtime:722 in _render_error

<< def _render_error(template, context, error): if template.error_handler: result = template.error_handler(context, error) if not result: raise error

result = template.error_handler(context, error) Module mako.runtime:711 in _exec_template

<< error = None try: callable_(context, args, *kwargs) except Exception, e: _render_error(template, context, e)

callable_(context, args, *kwargs) Module _base_root_html:62 in render_body

<< M_writer(u'\n </head>\n <body id="body">\n ') # SOURCE LINE 142 M_writer(escape(next.body())) __M_writer(u'\n </body>\n</html>') return ''

__M_writer(escape(next.body())) Module _base_base_html:160 in render_body

<< M_writer(u' </div>\t \n <div id="main"> \n ') # SOURCE LINE 97 M_writer(escape(next.main())) __M_writer(u'\n </div>\n</div> \n<!-- END CONTENT -->\n\n<!-- FOOTER -->\n<div id="footer">\n <div id="footer-inner" class="title">\n <div>\n <p class="footer-link">\n <a href="') # SOURCE LINE 107

__M_writer(escape(next.main())) Module journal_journal_html:93 in render_main

<< M_writer(u'\t\t \n\t\t <div style="float:left;padding-right:5px">\n <span id="follow_toggle_') # SOURCE LINE 48 M_writer(escape(entry.follows_repository.repo_id)) M_writer(u'" class="following" title="') M_writer(escape(_('Stop following this repository')))

__M_writer(escape(entry.follows_repository.repo_id)) AttributeError: 'NoneType' object has no attribute 'repo_id' CGI Variables CONTENT_LENGTH '0' CONTENT_TYPE '; charset="utf-8"' HTTP_ACCEPT 'text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, /;q=0.1' HTTP_ACCEPT_ENCODING 'gzip, deflate' HTTP_ACCEPT_LANGUAGE 'nl-NL,nl;q=0.9,en;q=0.8' HTTP_CONNECTION 'Keep-Alive' HTTP_COOKIE 'rhodecode=4366ef189f67a62549b3a7f33f23bf87a2cf36993d724811c1a6b57ac9c9d571fa09935b' HTTP_HOST 'code.dekiwiki' HTTP_REFERER 'http://code.dekiwiki/' HTTP_USER_AGENT 'Opera/9.80 (Windows NT 5.1; U; en) Presto/2.9.168 Version/11.52' HTTP_X_FORWARDED_FOR '' HTTP_X_FORWARDED_HOST 'code.dekiwiki' HTTP_X_FORWARDED_SERVER 'code.dekiwiki' PATH_INFO '/_admin/journal' REMOTE_ADDR '' REQUEST_METHOD 'GET' SERVER_NAME '' SERVER_PORT '5000' SERVER_PROTOCOL 'HTTP/1.1' WSGI Variables application <rhodecode.lib.middleware.simplegit.SimpleGit object at 0xa43150c> beaker.get_session <bound method SessionMiddleware._get_session of <beaker.middleware.SessionMiddleware object at 0xa431ccc>> beaker.session {'_authentication_token': 'b89a8c7646389e64a79a363b75d27568cfbfc3ea', 'rhodecode_user': <AuthUser('id:2:ton|True')>, '_accessed_time': 1321341965.4551251, '_creation_time': 1321340271.696918} paste.httpserver.thread_pool <paste.httpserver.ThreadPool object at 0x97e408c> paste.registry <paste.registry.Registry object at 0xae4efcc> paste.throw_errors True pylons.action_method <bound method JournalController.index of <rhodecode.controllers.journal.JournalController object at 0xaec6dec>> pylons.controller <rhodecode.controllers.journal.JournalController object at 0xaec6dec> pylons.environ_config {'session': 'beaker.session', 'cache': 'beaker.cache'} pylons.pylons <pylons.util.PylonsContext object at 0xaec61cc> pylons.routes_dict {'action': u'index', 'controller': u'journal'} routes.route <routes.route.Route object at 0xa25254c> routes.url <routes.util.URLGenerator object at 0xaec63ac> webob._parsed_query_vars (GET([]), '') webob.adhoc_attrs {'language': 'en-us'} wsgi process 'Multithreaded' wsgiorg.routing_args (<routes.util.URLGenerator object at 0xaec63ac>, {'action': u'index', 'controller': u'journal'})

Comments (4)

  1. Marcin Kuzminski repo owner

    Looks like some FK got busted, if you runned from beta maybe there was some old code there.

    pls do the following:

    Do this pls.

    select follows_repository_id from user_followings; and see which one of given id's is not present in repositories table.

  2. Ton Plomp reporter

    Should I remove the records that have a non-existent 'follows_repository_id' in the 'user_followings' table (there are 4 of those)? I think I removed those by hand due to the 'repo not movable to repo-group bug' in 1.2 beta.

  3. Log in to comment