Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Problems with gae-mini-profiler #36

irvingpop opened this Issue Dec 22, 2012 · 4 comments


None yet
3 participants

irvingpop commented Dec 22, 2012

Runs fine in dev_appserver, but push to appspot and the X-MiniProfiler-Id is getting lost. Sometimes traceback, rest of the time you can't "share" the stats.


Traceback (most recent call last):
  File "/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 224, in Handle
    for chunk in result:
  File "/base/data/home/apps/s~apexbeermenu/1.364030925006454072/flaskext/gae_mini_profiler/profiler.py", line 286, in __call__
    yield self.prof.runcall(result.next)
  File "/python27_runtime/python27_dist/lib/python2.7/cProfile.py", line 149, in runcall
    return func(*args, **kw)
  File "/python27_runtime/python27_lib/versions/1/google/appengine/ext/appstats/recording.py", line 1284, in appstats_wsgi_wrapper
    result = app(environ, appstats_start_response)
  File "/base/data/home/apps/s~apexbeermenu/1.364030925006454072/flaskext/gae_mini_profiler/profiler.py", line 269, in wrapped_appstats_app
    return old_app(environ, start_response)
  File "/base/data/home/apps/s~apexbeermenu/1.364030925006454072/flask/app.py", line 1690, in wsgi_app
    return response(environ, start_response)
  File "/base/data/home/apps/s~apexbeermenu/1.364030925006454072/werkzeug/wrappers.py", line 1083, in __call__
    start_response(status, headers)
  File "/python27_runtime/python27_lib/versions/1/google/appengine/ext/appstats/recording.py", line 1281, in appstats_start_response
    return start_response(status, headers, exc_info)
  File "/base/data/home/apps/s~apexbeermenu/1.364030925006454072/flaskext/gae_mini_profiler/profiler.py", line 257, in profiled_start_response
    return start_response(status, headers, exc_info)
  File "/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 156, in _StartResponse
    (_GetTypeName(value), value, name))
InvalidResponseError: header values must be str, got 'NoneType' (None) for 'X-MiniProfiler-Id'

irvingpop commented Dec 22, 2012

Added thought: Could it be related to the fact that GAE mini profiler is not safe to use with Python 2.7 and threadsafe: true?

Per this pull request:


irvingpop commented Dec 22, 2012

Confirmed: Setting "threadsafe: false" resolves mini profiler issues.


kamalgill commented Dec 22, 2012

@irvingpop: Thanks for confirming! Will update when the upstream profiler becomes thread-safe.

baztian commented Jan 25, 2013

upstream profiler seems to be thread-safe now. It also has some new cool features. Please sync with upstream.

@kamalgill kamalgill closed this in f27e931 Jan 27, 2013

@garethreakes garethreakes referenced this issue in Khan/gae_mini_profiler Jun 16, 2013


thread safe issue with dev_appserver and 1.8.1 #57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment