Can't access rhodecode web application - TypeError: 'NoneType' object is not iterable

Issue #177 resolved
Marc Sanfaçon created an issue

The server still works through hg.

{{{ Module weberror.errormiddleware:162 in call

app_iter = self.application(environ, sr_checker) Module rhodecode.lib.middleware.simplegit:103 in call return self.application(environ, start_response) Module rhodecode.lib.middleware.simplehg:70 in call return self.application(environ, start_response) Module beaker.middleware:152 in call return self.wrap_app(environ, session_start_response) Module routes.middleware:131 in call response = self.app(environ, 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:39 in call self.rhodecode_user = c.rhodecode_user = AuthUser(user_id, api_key) Module rhodecode.lib.auth:252 in init self.propagate_data() Module rhodecode.lib.auth:276 in propagate_data user_model.fill_perms(self) Module rhodecode.model.user:318 in fill_perms User.get(user.user_id)).all() Module rhodecode.model.meta:63 in get return Session.query(cls).get(id_) Module sqlalchemy.orm.query:629 in get ).identity_key_from_primary_key(ident) Module sqlalchemy.orm.mapper:1277 in identity_key_from_primary_key return self._identity_class, tuple(util.to_list(primary_key)) TypeError: 'NoneType' object is not iterable }}}

Comments (4)

  1. Marc Sanfaçon reporter

    It look likes a bug in SQLAlchemy. It should return a empty list, not throw...

    I added a try/except, like this:

                user_perms = []
                try:
                    user_perms = self.sa.query(UserToPerm)\
                                .filter(UserToPerm.user ==
                                        User.get(user.user_id)).all()
                except:
                    pass
    

    Now everything works

  2. Marcin Kuzminski repo owner

    I tried to fix it in another way by fallbacking to using other method for fetchin by user_id directly it looks like this never had any problems.

  3. Log in to comment