2017-08-08 40 views
0

Appstats拋出TypeError異常並導致appstats/formatting.py中的服務器崩潰。它似乎把一個字典與None作爲關鍵字排序。關閉appstats,然後工作正常。AppStats中的類型錯誤

這裏是調用堆棧,

File "/base/data/home/runtimes/python27_experiment/python27_lib/versions/1/google/appengine/ext/ndb/context.py", line 1107, in _memcache_get_tasklet 
    rpc=rpc) 
    File "/base/data/home/runtimes/python27_experiment/python27_lib/versions/1/google/appengine/api/memcache/__init__.py", line 616, in get_multi_async 
    user_key) 
    File "/base/data/home/runtimes/python27_experiment/python27_lib/versions/1/google/appengine/api/memcache/__init__.py", line 384, in _make_async_call 
    rpc.make_call(method, request, response, get_result_hook, user_data) 
    File "/base/data/home/runtimes/python27_experiment/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 528, in make_call 
    self.__service, method, request, response, self.__rpc) 
    File "/base/data/home/runtimes/python27_experiment/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 206, in Call 
    function(service, call, request, response, rpc) 
    File "/base/data/home/runtimes/python27_experiment/python27_lib/versions/1/google/appengine/ext/appstats/recording.py", line 1441, in pre_call_hook 
    recorder_proxy.record_rpc_request(service, call, request, response, rpc) 
    File "/base/data/home/runtimes/python27_experiment/python27_lib/versions/1/google/appengine/ext/appstats/recording.py", line 566, in record_rpc_request 
    self.get_call_stack(trace) 
    File "/base/data/home/runtimes/python27_experiment/python27_lib/versions/1/google/appengine/ext/appstats/recording.py", line 879, in get_call_stack 
    if not self.get_frame_summary(frame, trace): 
    File "/base/data/home/runtimes/python27_experiment/python27_lib/versions/1/google/appengine/ext/appstats/recording.py", line 937, in get_frame_summary 
    x.set_value(format_value(value)) 
    File "/base/data/home/runtimes/python27_experiment/python27_lib/versions/1/google/appengine/ext/appstats/recording.py", line 995, in format_value 
    return formatting._format_value(val, config.MAX_REPR, config.MAX_DEPTH) 
    File "/base/data/home/runtimes/python27_experiment/python27_lib/versions/1/google/appengine/ext/appstats/formatting.py", line 265, in _format_value 
    series = sorted(val) 
TypeError: can't compare datetime.date to NoneType 

這裏是上下文,

  1. GAE標準環境和Django。
  2. 它在多個異步調用仍在運行時崩潰。

這是一個錯誤嗎?

回答

0

當None是字典中的鍵時會發生此問題。使用字符串'None'替換None可以解決問題。