I'm having regular issues with the loading of sessions. Sometimes this 
happens after restarting the webserver, sometimes in the middle of a 
session.

I would see errors like;

Traceback (most recent call last):
  File "/var/web/xxx/web2py-2.10/gluon/main.py", line 484, in wsgibase
    session._try_store_in_cookie_or_file(request, response)
  File "/var/web/xxx/web2py-2.10/gluon/globals.py", line 1167, in 
_try_store_in_cookie_or_file
    return self._try_store_in_file(request, response)
  File "/var/web/xxx/web2py-2.10/gluon/globals.py", line 1174, in 
_try_store_in_file
    or self._unchanged(response)):
  File "/var/web/xxx/web2py-2.10/gluon/globals.py", line 1119, in _unchanged
    session_pickled = pickle.dumps(self, pickle.HIGHEST_PROTOCOL)
PicklingError: Can't pickle <type 'thread.lock'>: attribute lookup thread.lock 
failed

I'm using web2py 2.10.4-stable+timestamp.2015.04.26.15.11.54 with apache 
2.2.22-13+deb7u4, libapache2-mod-wsgi 3.3-4+deb7u1 on debian 7.8

I also often got errors for session.connect (gluon/main.py:437) coming from the 
__getnewargs__ in storage.py because the requested attribute was not a string. 
I have replaced:

__getnewargs__ = lambda self: getattr(dict,self).__getnewargs__(self)

with

    def __getnewargs__(self):
        if self:
            try:
                return getattr(dict,self).__getnewargs__(self)
            except Exception as e:

                logging.getLogger().error('Storage: getnewargs: got exception: 
{}'.format(e))
                return ()
        else:
            return ()

And this seems to counter that issue. I haven't found anything for the 
first error though.
Any thougths?

Wim

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to