1. Thomas Waldmann
  2. moin-2.0
Issue #184 resolved

Keyerror itemid

Reimar Bauer
created an issue

e1f9d9b5da57 shows on a fresh clone a Keyerror itemid after starting the server

http://paste.pocoo.org/show/9iMCbtDKm0R1FE9gZvx8/

Comments (7)

  1. Thomas Waldmann repo owner

    abhishek: please always add a .txt to attachment text files, so one can easily open them in the browser.

    also, how is that "KeyError: 'user.session_token'" related to the topic of this issue which is "KeyError: itemid"? For me this looks like a different issue.

    reimar: pastebins are not for permanent content, they can go away, as we have just seen with paste.pocoo.org.

    so, please clean up. for now, this issue is pretty much invalid.

  2. Reimar Bauer reporter
    • changed status to new

    Just seen it again

    Traceback (most recent call last):
      File "/wiki/workspace/moin-2.0/env/lib/python2.6/site-packages/flask/app.py", line 1518, in __call__
        return self.wsgi_app(environ, start_response)
      File "/wiki/workspace/moin-2.0/env/lib/python2.6/site-packages/flask/app.py", line 1506, in wsgi_app
        response = self.make_response(self.handle_exception(e))
      File "/wiki/workspace/moin-2.0/env/lib/python2.6/site-packages/flask/app.py", line 1504, in wsgi_app
        response = self.full_dispatch_request()
      File "/wiki/workspace/moin-2.0/env/lib/python2.6/site-packages/flask/app.py", line 1264, in full_dispatch_request
        rv = self.handle_user_exception(e)
      File "/wiki/workspace/moin-2.0/env/lib/python2.6/site-packages/flask/app.py", line 1260, in full_dispatch_request
        rv = self.preprocess_request()
      File "/wiki/workspace/moin-2.0/env/lib/python2.6/site-packages/flask/app.py", line 1387, in preprocess_request
        rv = func()
      File "/wiki/workspace/moin-2.0/MoinMoin/app.py", line 236, in before_wiki
        flaskg.user = setup_user()
      File "/wiki/workspace/moin-2.0/MoinMoin/app.py", line 199, in setup_user
        userobj = auth.setup_from_session()
      File "/wiki/workspace/moin-2.0/MoinMoin/auth/__init__.py", line 448, in setup_from_session
        logging.debug("session started for user {0!r}".format(userobj))
      File "/wiki/workspace/moin-2.0/MoinMoin/user.py", line 304, in __repr__
        self.name, self.itemid, self.valid, self.trusted)
      File "/wiki/workspace/moin-2.0/MoinMoin/user.py", line 314, in __getattr__
        return self.profile[name]
      File "/wiki/workspace/moin-2.0/MoinMoin/user.py", line 205, in __getitem__
        v = self._defaults[name]
    KeyError: 'itemid'
    
  3. Thomas Waldmann repo owner
    • changed status to open

    from #187:

    If a browser has an invalid moin cookie from another repo, a cookie obtained prior to a save/load sequence, (or maybe prior to a moin index-build -i ?), then a traceback results when an attempt is made to access any page.

    A workaround is to delete the cookie or restart the browser.

  4. Reimar Bauer reporter

    A bit strange is that if you comment off the logging line # logging.debug("session started for user {0!r}".format(userobj))

    /wiki/workspace/moin-2.0/MoinMoin/auth/__init__.py", line 448
    

    it works,

    So it looks like it crashes in the logging.debug string code because there is no itemid at this time. If it is a real cookie issue it should crash on an other place.

  5. Log in to comment