2012-02-29 out of range for month (unable to logout)

Issue #375 resolved
Former user created an issue

I'm unable to logout from rhodecode today. It seems (see the log bellow) that it has something to do with the date.

{{{ 2012-02-29 08:21:54.446 INFO [rhodecode.lib.base] Request to /_admin time: 0.109s 2012-02-29 08:22:02.687 INFO [rhodecode.lib.base] User: <AuthUser('id:2:joel|True')> accessed /_admin/logout 2012-02-29 08:22:02.694 INFO [rhodecode.lib.base] Request to /_admin/logout time: 0.023s Error - <type 'exceptions.ValueError'>: day is out of range for month }}}

the version I am running is 1.3.1

Comments (6)

  1. Former user Account Deleted

    The problem comes from Beaker:

        def _delete_cookie(self):
            self.request['set_cookie'] = True
            expires = datetime.utcnow().replace(year=2003)
            self._set_cookie_values(expires)
            self._update_cookie_out()
    

    There are only 28 days for february in 2003. So this is the leap year bug.

    Here is a trace:

    URL: http://.../_admin/logout
    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 = 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:150 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.login:167 in logout
    >>  session.delete()
    Module beaker.session:690 in delete
    >>  self._session().delete()
    Module beaker.session:303 in delete
    >>  self._delete_cookie()
    Module beaker.session:295 in _delete_cookie
    >>  expires = datetime.utcnow().replace(year=2003)
    
  2. Marcin Kuzminski repo owner

    Yeah i already seen that bug posted at beaker issue tracker. I guess it needs a fix in there.

  3. Former user Account Deleted

    This issue also shows up in 1.3.2: ... File '/usr/lib/python2.7/site-packages/Beaker-1.6.2-py2.7.egg/beaker/session.py', line 295 in _delete_cookie expires = datetime.utcnow().replace(year=2003) ValueError: day is out of range for month ... ------------------------------------------------------------ 2012-02-29 09:15:49.973 INFO [rhodecode.lib.base] User: <AuthUser('id:2:myuser|True')> accessed /error/document 2012-02-29 09:15:49.974 INFO [rhodecode.lib.base] Request to /error/document time: 0.008s 2012-02-29 09:15:50.369 INFO [rhodecode.lib.base] User: <AuthUser('id:2:myuser|True')> accessed /error/document 2012-02-29 09:15:50.370 INFO [rhodecode.lib.base] Request to /error/document time: 0.009s

  4. Log in to comment