返回列表

webpy 总是提示exceptions.EOFError错误,session偶尔也会乱掉

默认分类 2014/03/16 23:21

webpy 总是提示exceptions.EOFError错误,session偶尔也会乱掉。

<type 'exceptions.EOFError'> at /scrum_api/user_list

Python /usr/local/lib/python2.7/dist-packages/web.py-0.37-py2.7.egg/web/session.py in decode, line 209 
Web GET http://42.96.169.157:8080/scrum_api/user_list 

Traceback (innermost first)
/usr/local/lib/python2.7/dist-packages/web.py-0.37-py2.7.egg/web/session.py in decode 
"""encodes session dict as a string""" 
pickled = pickle.dumps(session_dict) 
return base64.encodestring(pickled) 

def decode(self, session_data): 
"""decodes the data to get back the session dict """ 
pickled = base64.decodestring(session_data) 
return pickle.loads(pickled) ... 

class DiskStore(Store): 
""" 
Store for saving a session on disk. 

>>> import tempfile 
▶ Local vars 
Variable Value 
pickled '' 
self <web.session.DiskStore instance at 0x1c2f200> 
session_data '' 

/usr/local/lib/python2.7/dist-packages/web.py-0.37-py2.7.egg/web/session.py in __getitem__ 
path = self._get_path(key) 
return os.path.exists(path) 

def __getitem__(self, key): 
path = self._get_path(key) 
if os.path.exists(path): 
pickled = open(path).read() 
return self.decode(pickled) ... 
else: 
raise KeyError, key 

def __setitem__(self, key, value): 
path = self._get_path(key) 
pickled = self.encode(value) 
▶ Local vars 
Variable Value 
key 'b93bd05ffc9ba94a07bdb1335c4ecd97f278cf66' 
path 'sessions/b93bd05ffc9ba94a07bdb1335c4ecd97f278cf66' 
pickled '' 
self <web.session.DiskStore instance at 0x1c2f200> 

/usr/local/lib/python2.7/dist-packages/web.py-0.37-py2.7.egg/web/session.py in _load 

# protection against session_id tampering 
if self.session_id and not self._valid_session_id(self.session_id): 
self.session_id = None 

self._check_expiry() 
if self.session_id: 
d = self.store[self.session_id] ... 
self.update(d) 
self._validate_ip() 

if not self.session_id: 
self.session_id = self._generate_session_id() 

▶ Local vars 
Variable Value 
cookie_domain None 
cookie_name 'webpy_session_id' 
cookie_path None 
httponly True 
self <web.session.Session object at 0x1bccc20> 

/usr/local/lib/python2.7/dist-packages/web.py-0.37-py2.7.egg/web/session.py in _processor 

def __delattr__(self, name): 
delattr(self._data, name) 

def _processor(self, handler): 
"""Application processor to setup session for every request""" 
self._cleanup() 
self._load() ... 

try: 
return handler() 
finally: 
self._save() 

▶ Local vars 
Variable Value 
handler <function <lambda> at 0x7fd26c32b1b8> 
self <web.session.Session object at 0x1bccc20> 

/usr/local/lib/python2.7/dist-packages/web.py-0.37-py2.7.egg/web/application.py in process 
return self._delegate(fn, self.fvars, args) 

def handle_with_processors(self): 
def process(processors): 
try: 
if processors: 
p, processors = processors[0], processors[1:] 
return p(lambda: process(processors)) ... 
else: 
return self.handle() 
except web.HTTPError: 
raise 
except (KeyboardInterrupt, SystemExit): 
raise 
▶ Local vars 
Variable Value 
p <bound method Session._processor of <web.session.Session object at 0x1bccc20>> 
process <function process at 0x7fd28408bf50> 
processors [] 
self <web.application.application instance at 0x1c24050> 

Request information
INPUT
No data.

COOKIES
Variable Value 
_gitlab_session 'BAh7CEkiD3Nlc3Npb25faWQGOgZFRkkiJWIzMGI3YTY1NWRjNGQ0NGY1ZDZhNGEzZTkzOTViODJkBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMVdLckZhTkV5MTJoSjVSWVhjSmNXTFR2NDdxcWRKZEZnY2drdDlzN1gzaGs9BjsARkkiGXdhcmRlbi51c2VyLnVzZXIua2V5BjsAVFsISSIJVXNlcgY7AEZbBmkPSSIiJDJhJDEwJGV5V2hpZjhTZERDMzcxUHZNc2RuL3UGOwBU--1f4105c7b922ffe1a66f164d2a64fc0f77bdcc8f' 
webpy_session_id 'b93bd05ffc9ba94a07bdb1335c4ecd97f278cf66' 

META
Variable Value 
app_stack [<web.application.application instance at 0x1c24050>] 
fullpath u'/scrum_api/user_list' 
headers [] 
home u'http://42.96.169.157:8080' 
homedomain u'http://42.96.169.157:8080' 
homepath u'' 
host u'42.96.169.157:8080' 
ip u'180.173.33.150' 
method u'GET' 
output u'' 
path u'/scrum_api/user_list' 
protocol u'http' 
query u'' 
realhome u'http://42.96.169.157:8080' 
status '200 OK' 

ENVIRONMENT
Variable Value 
ACTUAL_SERVER_PROTOCOL 'HTTP/1.1' 
HTTP_ACCEPT 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' 
HTTP_ACCEPT_ENCODING 'gzip, deflate' 
HTTP_ACCEPT_LANGUAGE 'en-US,en;q=0.5' 
HTTP_CONNECTION 'keep-alive' 
HTTP_COOKIE '_gitlab_session=BAh7CEkiD3Nlc3Npb25faWQGOgZFRkkiJWIzMGI3YTY1NWRjNGQ0NGY1ZDZhNGEzZTkzOTViODJkBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMVdLckZhTkV5MTJoSjVSWVhjSmNXTFR2NDdxcWRKZEZnY2drdDlzN1gzaGs9BjsARkkiGXdhcmRlbi51c2VyLnVzZXIua2V5BjsAVFsISSIJVXNlcgY7AEZbBmkPSSIiJDJhJDEwJGV5V2hpZjhTZERDMzcxUHZNc2RuL3UGOwBU--1f4105c7b922ffe1a66f164d2a64fc0f77bdcc8f; webpy_session_id=b93bd05ffc9ba94a07bdb1335c4ecd97f278cf66' 
HTTP_HOST '42.96.169.157:8080' 
HTTP_REFERER 'http://42.96.169.157:8080/static/' 
HTTP_USER_AGENT 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0' 
HTTP_X_REQUESTED_WITH 'XMLHttpRequest' 
PATH_INFO '/scrum_api/user_list' 
QUERY_STRING '' 
REMOTE_ADDR '180.173.33.150' 
REMOTE_PORT '63573' 
REQUEST_METHOD 'GET' 
REQUEST_URI '/scrum_api/user_list' 
SCRIPT_NAME '' 
SERVER_NAME 'localhost' 
SERVER_PORT '8080' 
SERVER_PROTOCOL 'HTTP/1.1' 
SERVER_SOFTWARE 'CherryPy/3.2.0 Server' 
wsgi.errors <open file '<stderr>', mode 'w' at 0x7fd29148d270> 
wsgi.input <web.wsgiserver.KnownLengthRFile object at 0x7fd26c3a3e50> 
wsgi.multiprocess False 
wsgi.multithread True 
wsgi.run_once False 
wsgi.url_scheme 'http' 
wsgi.version (1, 0) 

You're seeing this error because you have web.config.debug set to True. Set that to False if you don't want to see this.