On my local instance of the app engine application I am developing I am experiencing an infinite recursion of the logging system. Unfortunately, since the problem lies in the logging system, I cannot see the error message. The python 'print' command is also not working on a google app engine application, therefore I cannot display any useful information.
The problem is visible even just accessing the website root.
It seems to be an import problem, but beside that, the logging system should work, and it doesn't.
The deployed version of the site is working, which leads me to think about a possible local configuration/system problem.
I am using python 2.7.2 and CURRENT_VERSION_ID=1.1
Here is the very long stacktrace of the bug:
--> --> -->
Traceback (most recent call last):
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2781, in _HandleRequest
self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2669, in _Dispatch
base_env_dict=env_dict)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 692, in Dispatch
base_env_dict=base_env_dict)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1731, in Dispatch
self._module_dict)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1631, in ExecuteCGI
reset_modules = exec_script(config, handler_path, cgi_path, hook)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1319, in ExecuteOrImportScript
exec module_code in script_module.__dict__
File "C:\Program Files\Google\google_appengine\google\appengine\ext\admin\__init__.py", line 79, in <module>
from google.appengine.ext.webapp import _template
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, in Decorate
return func(self, *args, **kwargs)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1858, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, in Decorate
return func(self, *args, **kwargs)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1722, in FindAndLoadModule
description)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, in Decorate
return func(self, *args, **kwargs)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1665, in LoadModuleRestricted
description)
File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\_template.py", line 37, in <module>
from google.appengine.ext.webapp import template
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, in Decorate
return func(self, *args, **kwargs)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1858, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, in Decorate
return func(self, *args, **kwargs)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1722, in FindAndLoadModule
description)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, in Decorate
return func(self, *args, **kwargs)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1665, in LoadModuleRestricted
description)
File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\template.py", line 61, in <module>
webapp._config_handle.django_setup()
File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\__init__.py", line 153, in _django_setup
__django_version_setup()
File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\__init__.py", line 99, in __django_version_setup
'http://code.google.com/appengine/docs/python/tools/'
File "C:\Python27\lib\logging\__init__.py", line 1582, in warning
root.warning(msg, *args, **kwargs)
File "C:\Python27\lib\logging\__init__.py", line 1144, in warning
self._log(WARNING, msg, args, **kwargs)
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1249, in _log
record = self.makeRecord(self.name, level, fn, lno, msg, args, exc_info, func, extra)
File "C:\Python27\lib\logging\__init__.py", line 1223, in makeRecord
rv = LogRecord(name, level, fn, lno, msg, args, exc_info, func)
File "C:\Python27\lib\logging\__init__.py", line 266, in __init__
self.levelname = getLevelName(level)
File "C:\Python27\lib\logging\__init__.py", line 167, in getLevelName
return _levelNames.get(level, ("Level %s" % level))
RuntimeError: maximum recursion depth exceeded while getting the str of an object
Here is the list of imports of main.py:
from google.appengine.ext import webapp
import fix_path
import sys
import os
import urllib
import urllib2
import pprint
import logging
import cgi
import random
import Cookie
import datetime
import time
import urlparse
import urllib2
import urllib, cStringIO
import hashlib
import copy
from urllib import urlretrieve
from google.appengine.ext import blobstore
from google.appengine.ext.webapp import blobstore_handlers
from google.appengine.ext.webapp import template
from google.appengine.api import users
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext import db
from google.appengine.dist import use_library
from google.appengine.api import memcache
from django.utils import simplejson
from gaesessions import get_current_session
from myapp.models import *
from myapp.models import sequence_selection as models_sequence_selection
from myapp.sequence_selection import utils as sequence_selection_utils
from myapp.models import video
from myapp.models.video import *
from myapp.models.song import *
from myapp.models.flashified import *
from myapp.music_recommendation import get_song_recommendations,get_song_recommendations_learning_data,learn_song,learn_song_from_video
from myapp.core import is_number
from myapp import mailing
from myapp import search
from myapp import motif
from myapp import retrieve_instagram
from myapp import coords_distance
from myapp import performancetest
from google.appengine.api import mail
from google.appengine.api import images
Actually, renaming the directory of the application and re-importing trough google app engine launcher with a different port solved my problem, but probably not the bug.
You need to upload the relevant source to get a real answer as @skreft stated.
Although as far as logging, use import logging and then logging.info() to help locate the problem.
I suggest commenting the logging code for now and see what your stack trace reveals. Then if you are not getting an error start adding the logging code back in piece by piece until you find your error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With