Ocassionally Apache has to be restarted to keep the website running with webpy

52 views
Skip to first unread message

Suhas Patil

unread,
Apr 27, 2015, 2:24:51 AM4/27/15
to we...@googlegroups.com

I am testing a web application that I built using web.py. Many times I have seen that things fail and I see following error in the logs:

AttributeError: 'ThreadedDict' object has no attribute 'session_id'

In such a case, invariably it is found, that the same URL with the same parameters has worked many times (implying there is nothing wrong with the URL and POST request) before and as soon as I restart the web server the failed URL when resubmitted works! The failure is due to session_id attribute not being found in the session object.

Does anybody know what's going on?

The error log shows this:

Traceback (most recent call last)

File "/usr/local/lib/python2.7/dist-packages/web/application.py", line 239, in process return self.handle()
File "/usr/local/lib/python2.7/dist-packages/web/application.py", line 230, in handle return self._delegate(fn, self.fvars, args)
File "/usr/local/lib/python2.7/dist-packages/web/application.py", line 420, in _delegate return handle_class(cls)
File "/usr/local/lib/python2.7/dist-packages/web/application.py", line 396, in handle_class return tocall(*args)
File "/var/www/khojpal/tmain.py", line 748, in GET return '{"uid": "' + str(session.uid) + '", "webpy_session_id":"' + session.session_id + '"}'
File "/usr/local/lib/python2.7/dist-packages/web/session.py", line 71, in __getattr__ return getattr(self._data, name)
AttributeError: 'ThreadedDict' object has no attribute 'session_id'

The webpy_session_id does exist in the sessions table when it fails. I can not debug this code under Apache and this failure is never seen on desktop running under Eclipse.

Thanks
Suhas.
Reply all
Reply to author
Forward
0 new messages