Google App Engine Debugging Hangs/Doesn't Start

On my old setup I could debug Google App Engine (GAE) Python programs using Komodo IDE:

  1. From within Komodo, select “Debug | Go”
  2. For [Script] enter C:\Progra~2\Google\google_appengine\dev_appserver.py
  3. For [Directory] enter C:\Users\Me\MyProject
  4. For [Script Arguments] enter App (name of MyProject subdir holding project)
  5. Check “Debug in separate console”
  6. Click OK

This was with KomodoIDE v5, Windows Vista, GAE 1.3). The new setup is KomodoIDE v8.5.3, Windows 8.1, GAE 1.9).

In the new setup, the debug console window comes up, but just hangs with no output. When I open a command prompt manually, go to the Directory named above, and type the Script command with the App argument, things run. If I do this via the Run Command in Komodo, it also works.

But I can’t get it to work in Debug mode.

In fact, here’s an old link to an ActiveState blog that appears to say what I said above. But I can’t get it to work. Is anyone using Komodo with GAE? Can you you help?

  1. What is the command you enter in Terminal?
  2. What is the Run Command you run in Komodo?
  3. What blog post are you referring to in your last paragraph?
  4. What version of Python are you running?
  5. Is there anything in Help > Troubleshooting > View log file?
  • Carey

Carey,

  1. From a command prompt, I navigate to C:\Users\Me\MyProject, then type C:\Progra~2\Google\google_appengine\dev_appserver.py App
  2. Within Komodo, the Run Command is "C:\Progra~2\Google\google_appengine\dev_appserver.py" App
  3. I thought I had linked the blog post, but I guess not: http://www.activestate.com/blog/2009/01/debugging-google-app-engine-sdk
  4. Python version 2.7.6 (GAE requires 2.7)
  5. There’s quite a bit in the log file. This seems to be what’s relevant:

ERROR:xpcom:Unhandled exception calling ‘int8 * getPref(in unicode &, out retval nsISomething);’
Traceback (most recent call last):
File “C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\xpcom\server\policy.py”, line 300, in CallMethod
return 0, func(*params)
File “C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\components\koPrefs.py”, line 364, in getPref
return self._getPref(prefName, ‘getPref’, “object”)
File “C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\components\koPrefs.py”, line 349, in _getPref
return self.parent._getPref(prefName, parentMethodName, expectedPrefType, defaultPref=defaultPref)
File “C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\components\koPrefs.py”, line 349, in _getPref
return self.parent._getPref(prefName, parentMethodName, expectedPrefType, defaultPref=defaultPref)
File “C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\components\koPrefs.py”, line 358, in _getPref
raise COMException(nsError.NS_ERROR_UNEXPECTED, “The preference ‘%s’ does not exist in ‘%r’.” % (prefName, self))
Exception: 2147549183 (The preference ‘Invocations’ does not exist in ‘<PrefSet: id=default type= idref=>’.)
[2014-04-11 15:58:45,372] [ERROR] dbgp.server: session cmdloop exception - sending session stop command
Traceback (most recent call last):
File “C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\komodo\dbgp\serverBase.py”, line 70, in _cmdloop
self._handleIncoming()
File “C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\komodo\dbgp\serverBase.py”, line 144, in _handleIncoming
newdata = self._socket.recv(1024)
error: [Errno 10054] An existing connection was forcibly closed by the remote host
[2014-04-11 15:58:45,374] [ERROR] dbgp.server: session sendCommand socket error error(10054, ‘An existing connection was forcibly closed by the remote host’)
[2014-04-11 15:58:50,378] [ERROR] dbgp.server: -1 (session timed out while waiting for response)
Traceback (most recent call last):
File “C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\komodo\dbgp\server.py”, line 1854, in _stdinHandlerThread
self.currentSession.setStdinHandler(None)
File “C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\komodo\dbgp\server.py”, line 1769, in setStdinHandler
node = self.sendCommandWait(cmd)
File “C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\komodo\dbgp\server.py”, line 1108, in sendCommandWait
node = self._waitResponse(tid)
File “C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\komodo\dbgp\server.py”, line 1139, in _waitResponse
raise DBGPError(‘session timed out while waiting for response’)
koDBGPError: -1 (session timed out while waiting for response)

Seems to be missing a relevant part of the log file, could you post the whole log file? Dont worry about the size.

OK, here’s the whole log:

[2014-04-11 11:04:52,927] [WARNING] root: ko.findresults was already loaded, re-creating it.

[2014-04-11 11:04:53,016] [DEBUG] places_js: waiting for document complete
ERROR:xpcom:Unhandled exception calling 'int8 * getPref(in unicode &, out retval nsISomething);'
Traceback (most recent call last):
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\xpcom\server\policy.py", line 300, in _CallMethod_
    return 0, func(*params)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\components\koPrefs.py", line 364, in getPref
    return self._getPref(prefName, 'getPref', "object")
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\components\koPrefs.py", line 349, in _getPref
    return self.parent._getPref(prefName, parentMethodName, expectedPrefType, defaultPref=defaultPref)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\components\koPrefs.py", line 349, in _getPref
    return self.parent._getPref(prefName, parentMethodName, expectedPrefType, defaultPref=defaultPref)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\components\koPrefs.py", line 358, in _getPref
    raise COMException(nsError.NS_ERROR_UNEXPECTED, "The preference '%s' does not exist in '%r'." % (prefName, self))
Exception: 2147549183 (The preference 'Invocations' does not exist in '<PrefSet: id=default type= idref=>'.)
[2014-04-11 11:06:59,887] [ERROR] dbgp.server: session cmdloop exception - sending session stop command
Traceback (most recent call last):
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\komodo\dbgp\serverBase.py", line 70, in _cmdloop
    self._handleIncoming()
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\komodo\dbgp\serverBase.py", line 144, in _handleIncoming
    newdata = self._socket.recv(1024)
error: [Errno 10054] An existing connection was forcibly closed by the remote host
[2014-04-11 11:06:59,904] [ERROR] dbgp.server: session sendCommand socket error error(10054, 'An existing connection was forcibly closed by the remote host')
[2014-04-11 11:24:22,362] [WARNING] codeintel.db: the following catalog selections didn't match any loaded API catalog: 'pywin32 (Python3)'
[2014-04-11 11:24:38,246] [ERROR] koCodeIntel: error evaluating calltip:
  trigger: <Trigger 'python-calltip-call-signature' at 936>
  log:
    INFO: eval 'if' at helloworld.py#32  <Trigger 'python-calltip-call-signature' at 936>
    INFO: start scope is (<blob 'helloworld'>, ['LoginHandler', 'post'])
    INFO: find 'if ...' starting at (<blob 'helloworld'>, ['LoginHandler', 'post']):
    INFO: is 'if' accessible on (<blob 'helloworld'>, ['LoginHandler', 'post'])? no
    DEBUG: 'if ...' from <import webapp2>?
    DEBUG: 'if ...' from <from google.appengine.api import memcache>?
    DEBUG: 'if ...' from <from google.appengine.ext import ndb>?
    DEBUG: 'if ...' from <import logging>?
    INFO: is 'if' accessible on (<blob 'helloworld'>, [])? no
    INFO: is 'if' accessible on (<blob '*'>, [])? no
    ERROR: evaluating 'if' at helloworld.py#32: could not resolve first part of 'if'
[2014-04-11 11:24:46,661] [ERROR] koCodeIntel: error evaluating completions:
  trigger: <Trigger 'python-complete-object-members' at 951>
  log:
    INFO: eval 'self.response' at helloworld.py#32  <Trigger 'python-complete-object-members' at 951>
    INFO: start scope is (<blob 'helloworld'>, ['LoginHandler', 'post'])
    INFO: find 'self ...' starting at (<blob 'helloworld'>, ['LoginHandler', 'post']):
    INFO: is 'self' accessible on (<blob 'helloworld'>, ['LoginHandler', 'post'])? yes: <argument 'self'>
    DEBUG: _hit_from_citdl: first part: [u'self'] -> (<argument 'self'>, (<blob 'helloworld'>, ['LoginHandler', 'post']))
    DEBUG: _hit_from_citdl: resolve [u'response'] on <argument 'self'> in (<blob 'helloworld'>, ['LoginHandler', 'post'])
    INFO: resolve getattr 'response' on <argument 'self'> in (<blob 'helloworld'>, ['LoginHandler', 'post']):
    INFO: resolve 'LoginHandler' type inference for <argument 'self'>:
    INFO: find 'LoginHandler ...' starting at (<blob 'helloworld'>, ['LoginHandler', 'post']):
    INFO: is 'LoginHandler' accessible on (<blob 'helloworld'>, ['LoginHandler', 'post'])? no
    INFO: is 'LoginHandler' accessible on (<blob 'helloworld'>, [])? yes: <class 'LoginHandler'>
    DEBUG: _hit_from_citdl: first part: ['LoginHandler'] -> (<class 'LoginHandler'>, (<blob 'helloworld'>, []))
    INFO: 'LoginHandler' is <class 'LoginHandler'> on (<blob 'helloworld'>, [])
    DEBUG: look for [u'response'] from imports in <class 'LoginHandler'>
    INFO: is 'response' from base class: 'webapp2.RequestHandler'?
    INFO: resolve 'webapp2.RequestHandler' type inference:
    INFO: find 'webapp2 ...' starting at (<blob 'helloworld'>, []):
    DEBUG: 'webapp2 ...' from <import webapp2>?
    INFO: is blob 'webapp2' from <Python curdirlib>? no
    INFO: is blob 'webapp2' from <Python extradirslib>? no
    INFO: is blob 'webapp2' from <Python envlib>? no
    INFO: is blob 'webapp2' from <Python sitelib>? no
    INFO: is blob 'webapp2' from <Python cataloglib: pywin32, pywin32 (Python3)>? no
    INFO: is blob 'webapp2' from <python-2.7 stdlib>? no
    INFO: could not resolve classref 'webapp2.RequestHandler' on scoperef (<blob 'helloworld'>, [])
    ERROR: evaluating 'self.response' at helloworld.py#32: could not resolve 'response' getattr on <class 'LoginHandler'> in (<blob 'helloworld'>, [])
[2014-04-11 11:24:52,500] [ERROR] koCodeIntel: error evaluating completions:
  trigger: <Trigger 'python-complete-object-members' at 951>
  log:
    INFO: eval 'self.response' at helloworld.py#32  <Trigger 'python-complete-object-members' at 951>
    INFO: start scope is (<blob 'helloworld'>, ['LoginHandler', 'post'])
    INFO: find 'self ...' starting at (<blob 'helloworld'>, ['LoginHandler', 'post']):
    INFO: is 'self' accessible on (<blob 'helloworld'>, ['LoginHandler', 'post'])? yes: <argument 'self'>
    DEBUG: _hit_from_citdl: first part: [u'self'] -> (<argument 'self'>, (<blob 'helloworld'>, ['LoginHandler', 'post']))
    DEBUG: _hit_from_citdl: resolve [u'response'] on <argument 'self'> in (<blob 'helloworld'>, ['LoginHandler', 'post'])
    INFO: resolve getattr 'response' on <argument 'self'> in (<blob 'helloworld'>, ['LoginHandler', 'post']):
    INFO: resolve 'LoginHandler' type inference for <argument 'self'>:
    INFO: find 'LoginHandler ...' starting at (<blob 'helloworld'>, ['LoginHandler', 'post']):
    INFO: is 'LoginHandler' accessible on (<blob 'helloworld'>, ['LoginHandler', 'post'])? no
    INFO: is 'LoginHandler' accessible on (<blob 'helloworld'>, [])? yes: <class 'LoginHandler'>
    DEBUG: _hit_from_citdl: first part: ['LoginHandler'] -> (<class 'LoginHandler'>, (<blob 'helloworld'>, []))
    INFO: 'LoginHandler' is <class 'LoginHandler'> on (<blob 'helloworld'>, [])
    DEBUG: look for [u'response'] from imports in <class 'LoginHandler'>
    INFO: is 'response' from base class: 'webapp2.RequestHandler'?
    INFO: resolve 'webapp2.RequestHandler' type inference:
    INFO: find 'webapp2 ...' starting at (<blob 'helloworld'>, []):
    DEBUG: 'webapp2 ...' from <import webapp2>?
    INFO: is blob 'webapp2' from <Python curdirlib>? no
    INFO: is blob 'webapp2' from <Python extradirslib>? no
    INFO: is blob 'webapp2' from <Python envlib>? no
    INFO: is blob 'webapp2' from <Python sitelib>? no
    INFO: is blob 'webapp2' from <Python cataloglib: pywin32, pywin32 (Python3)>? no
    INFO: is blob 'webapp2' from <python-2.7 stdlib>? no
    INFO: could not resolve classref 'webapp2.RequestHandler' on scoperef (<blob 'helloworld'>, [])
    ERROR: evaluating 'self.response' at helloworld.py#32: could not resolve 'response' getattr on <class 'LoginHandler'> in (<blob 'helloworld'>, [])
[2014-04-11 11:25:01,141] [ERROR] koCodeIntel: error evaluating calltip:
  trigger: <Trigger 'python-calltip-call-signature' at 955>
  log:
    INFO: eval 'self.response.get' at helloworld.py#32  <Trigger 'python-calltip-call-signature' at 955>
    INFO: start scope is (<blob 'helloworld'>, ['LoginHandler', 'post'])
    INFO: find 'self ...' starting at (<blob 'helloworld'>, ['LoginHandler', 'post']):
    INFO: is 'self' accessible on (<blob 'helloworld'>, ['LoginHandler', 'post'])? yes: <argument 'self'>
    DEBUG: _hit_from_citdl: first part: [u'self'] -> (<argument 'self'>, (<blob 'helloworld'>, ['LoginHandler', 'post']))
    DEBUG: _hit_from_citdl: resolve [u'response', u'get'] on <argument 'self'> in (<blob 'helloworld'>, ['LoginHandler', 'post'])
    INFO: resolve getattr 'response' on <argument 'self'> in (<blob 'helloworld'>, ['LoginHandler', 'post']):
    INFO: resolve 'LoginHandler' type inference for <argument 'self'>:
    INFO: find 'LoginHandler ...' starting at (<blob 'helloworld'>, ['LoginHandler', 'post']):
    INFO: is 'LoginHandler' accessible on (<blob 'helloworld'>, ['LoginHandler', 'post'])? no
    INFO: is 'LoginHandler' accessible on (<blob 'helloworld'>, [])? yes: <class 'LoginHandler'>
    DEBUG: _hit_from_citdl: first part: ['LoginHandler'] -> (<class 'LoginHandler'>, (<blob 'helloworld'>, []))
    INFO: 'LoginHandler' is <class 'LoginHandler'> on (<blob 'helloworld'>, [])
    DEBUG: look for [u'response', u'get'] from imports in <class 'LoginHandler'>
    INFO: is 'response' from base class: 'webapp2.RequestHandler'?
    INFO: resolve 'webapp2.RequestHandler' type inference:
    INFO: find 'webapp2 ...' starting at (<blob 'helloworld'>, []):
    DEBUG: 'webapp2 ...' from <import webapp2>?
    INFO: is blob 'webapp2' from <Python curdirlib>? no
    INFO: is blob 'webapp2' from <Python extradirslib>? no
    INFO: is blob 'webapp2' from <Python envlib>? no
    INFO: is blob 'webapp2' from <Python sitelib>? no
    INFO: is blob 'webapp2' from <Python cataloglib: pywin32, pywin32 (Python3)>? no
    INFO: is blob 'webapp2' from <python-2.7 stdlib>? no
    INFO: could not resolve classref 'webapp2.RequestHandler' on scoperef (<blob 'helloworld'>, [])
    ERROR: evaluating 'self.response.get' at helloworld.py#32: could not resolve 'response' getattr on <class 'LoginHandler'> in (<blob 'helloworld'>, [])
[2014-04-11 11:25:52,647] [ERROR] koCodeIntel: error evaluating completions:
  trigger: <Trigger 'python-complete-object-members' at 992>
  log:
    INFO: eval 'self.response' at helloworld.py#33  <Trigger 'python-complete-object-members' at 992>
    INFO: start scope is (<blob 'helloworld'>, ['LoginHandler', 'post'])
    INFO: find 'self ...' starting at (<blob 'helloworld'>, ['LoginHandler', 'post']):
    INFO: is 'self' accessible on (<blob 'helloworld'>, ['LoginHandler', 'post'])? yes: <argument 'self'>
    DEBUG: _hit_from_citdl: first part: [u'self'] -> (<argument 'self'>, (<blob 'helloworld'>, ['LoginHandler', 'post']))
    DEBUG: _hit_from_citdl: resolve [u'response'] on <argument 'self'> in (<blob 'helloworld'>, ['LoginHandler', 'post'])
    INFO: resolve getattr 'response' on <argument 'self'> in (<blob 'helloworld'>, ['LoginHandler', 'post']):
    INFO: resolve 'LoginHandler' type inference for <argument 'self'>:
    INFO: find 'LoginHandler ...' starting at (<blob 'helloworld'>, ['LoginHandler', 'post']):
    INFO: is 'LoginHandler' accessible on (<blob 'helloworld'>, ['LoginHandler', 'post'])? no
    INFO: is 'LoginHandler' accessible on (<blob 'helloworld'>, [])? yes: <class 'LoginHandler'>
    DEBUG: _hit_from_citdl: first part: ['LoginHandler'] -> (<class 'LoginHandler'>, (<blob 'helloworld'>, []))
    INFO: 'LoginHandler' is <class 'LoginHandler'> on (<blob 'helloworld'>, [])
    DEBUG: look for [u'response'] from imports in <class 'LoginHandler'>
    INFO: is 'response' from base class: 'webapp2.RequestHandler'?
    INFO: resolve 'webapp2.RequestHandler' type inference:
    INFO: find 'webapp2 ...' starting at (<blob 'helloworld'>, []):
    DEBUG: 'webapp2 ...' from <import webapp2>?
    INFO: is blob 'webapp2' from <Python curdirlib>? no
    INFO: is blob 'webapp2' from <Python extradirslib>? no
    INFO: is blob 'webapp2' from <Python envlib>? no
    INFO: is blob 'webapp2' from <Python sitelib>? no
    INFO: is blob 'webapp2' from <Python cataloglib: pywin32, pywin32 (Python3)>? no
    INFO: is blob 'webapp2' from <python-2.7 stdlib>? no
    INFO: could not resolve classref 'webapp2.RequestHandler' on scoperef (<blob 'helloworld'>, [])
    ERROR: evaluating 'self.response' at helloworld.py#33: could not resolve 'response' getattr on <class 'LoginHandler'> in (<blob 'helloworld'>, [])
[2014-04-11 11:25:55,286] [ERROR] koCodeIntel: error evaluating calltip:
  trigger: <Trigger 'python-calltip-call-signature' at 998>
  log:
    INFO: eval 'self.response.write' at helloworld.py#33  <Trigger 'python-calltip-call-signature' at 998>
    INFO: start scope is (<blob 'helloworld'>, ['LoginHandler', 'post'])
    INFO: find 'self ...' starting at (<blob 'helloworld'>, ['LoginHandler', 'post']):
    INFO: is 'self' accessible on (<blob 'helloworld'>, ['LoginHandler', 'post'])? yes: <argument 'self'>
    DEBUG: _hit_from_citdl: first part: [u'self'] -> (<argument 'self'>, (<blob 'helloworld'>, ['LoginHandler', 'post']))
    DEBUG: _hit_from_citdl: resolve [u'response', u'write'] on <argument 'self'> in (<blob 'helloworld'>, ['LoginHandler', 'post'])
    INFO: resolve getattr 'response' on <argument 'self'> in (<blob 'helloworld'>, ['LoginHandler', 'post']):
    INFO: resolve 'LoginHandler' type inference for <argument 'self'>:
    INFO: find 'LoginHandler ...' starting at (<blob 'helloworld'>, ['LoginHandler', 'post']):
    INFO: is 'LoginHandler' accessible on (<blob 'helloworld'>, ['LoginHandler', 'post'])? no
    INFO: is 'LoginHandler' accessible on (<blob 'helloworld'>, [])? yes: <class 'LoginHandler'>
    DEBUG: _hit_from_citdl: first part: ['LoginHandler'] -> (<class 'LoginHandler'>, (<blob 'helloworld'>, []))
    INFO: 'LoginHandler' is <class 'LoginHandler'> on (<blob 'helloworld'>, [])
    DEBUG: look for [u'response', u'write'] from imports in <class 'LoginHandler'>
    INFO: is 'response' from base class: 'webapp2.RequestHandler'?
    INFO: resolve 'webapp2.RequestHandler' type inference:
    INFO: find 'webapp2 ...' starting at (<blob 'helloworld'>, []):
    DEBUG: 'webapp2 ...' from <import webapp2>?
    INFO: is blob 'webapp2' from <Python curdirlib>? no
    INFO: is blob 'webapp2' from <Python extradirslib>? no
    INFO: is blob 'webapp2' from <Python envlib>? no
    INFO: is blob 'webapp2' from <Python sitelib>? no
    INFO: is blob 'webapp2' from <Python cataloglib: pywin32, pywin32 (Python3)>? no
    INFO: is blob 'webapp2' from <python-2.7 stdlib>? no
    INFO: could not resolve classref 'webapp2.RequestHandler' on scoperef (<blob 'helloworld'>, [])
    ERROR: evaluating 'self.response.write' at helloworld.py#33: could not resolve 'response' getattr on <class 'LoginHandler'> in (<blob 'helloworld'>, [])
[2014-04-11 11:27:49,888] [ERROR] koCodeIntel: error evaluating calltip:
  trigger: <Trigger 'python-calltip-call-signature' at 981>
  log:
    INFO: eval 'if' at helloworld.py#33  <Trigger 'python-calltip-call-signature' at 981>
    INFO: start scope is (<blob 'helloworld'>, ['LoginHandler', 'post'])
    INFO: find 'if ...' starting at (<blob 'helloworld'>, ['LoginHandler', 'post']):
    INFO: is 'if' accessible on (<blob 'helloworld'>, ['LoginHandler', 'post'])? no
    DEBUG: 'if ...' from <import webapp2>?
    DEBUG: 'if ...' from <from google.appengine.api import memcache>?
    DEBUG: 'if ...' from <from google.appengine.ext import ndb>?
    DEBUG: 'if ...' from <import logging>?
    INFO: is 'if' accessible on (<blob 'helloworld'>, [])? no
    INFO: is 'if' accessible on (<blob '*'>, [])? no
    ERROR: evaluating 'if' at helloworld.py#33: could not resolve first part of 'if'
ERROR:xpcom:Unhandled exception calling 'int8 * getPref(in unicode &, out retval nsISomething);'
Traceback (most recent call last):
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\xpcom\server\policy.py", line 300, in _CallMethod_
    return 0, func(*params)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\components\koPrefs.py", line 364, in getPref
    return self._getPref(prefName, 'getPref', "object")
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\components\koPrefs.py", line 349, in _getPref
    return self.parent._getPref(prefName, parentMethodName, expectedPrefType, defaultPref=defaultPref)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\components\koPrefs.py", line 349, in _getPref
    return self.parent._getPref(prefName, parentMethodName, expectedPrefType, defaultPref=defaultPref)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\components\koPrefs.py", line 358, in _getPref
    raise COMException(nsError.NS_ERROR_UNEXPECTED, "The preference '%s' does not exist in '%r'." % (prefName, self))
Exception: 2147549183 (The preference 'Invocations' does not exist in '<PrefSet: id=default type= idref=>'.)
[2014-04-11 15:57:09,509] [ERROR] dbgp.server: session cmdloop exception - sending session stop command
Traceback (most recent call last):
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\komodo\dbgp\serverBase.py", line 70, in _cmdloop
    self._handleIncoming()
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\komodo\dbgp\serverBase.py", line 144, in _handleIncoming
    newdata = self._socket.recv(1024)
error: [Errno 10054] An existing connection was forcibly closed by the remote host
[2014-04-11 15:57:09,510] [ERROR] dbgp.server: session sendCommand socket error error(10054, 'An existing connection was forcibly closed by the remote host')
[2014-04-11 15:57:14,513] [ERROR] dbgp.server: -1 (session timed out while waiting for response)
Traceback (most recent call last):
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\komodo\dbgp\server.py", line 1854, in _stdinHandlerThread
    self.currentSession.setStdinHandler(None)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\komodo\dbgp\server.py", line 1769, in setStdinHandler
    node = self.sendCommandWait(cmd)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\komodo\dbgp\server.py", line 1108, in sendCommandWait
    node = self._waitResponse(tid)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\komodo\dbgp\server.py", line 1139, in _waitResponse
    raise DBGPError('session timed out while waiting for response')
koDBGPError: -1 (session timed out while waiting for response)
ERROR:xpcom:Unhandled exception calling 'int8 * getPref(in unicode &, out retval nsISomething);'
Traceback (most recent call last):
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\xpcom\server\policy.py", line 300, in _CallMethod_
    return 0, func(*params)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\components\koPrefs.py", line 364, in getPref
    return self._getPref(prefName, 'getPref', "object")
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\components\koPrefs.py", line 349, in _getPref
    return self.parent._getPref(prefName, parentMethodName, expectedPrefType, defaultPref=defaultPref)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\components\koPrefs.py", line 349, in _getPref
    return self.parent._getPref(prefName, parentMethodName, expectedPrefType, defaultPref=defaultPref)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\components\koPrefs.py", line 358, in _getPref
    raise COMException(nsError.NS_ERROR_UNEXPECTED, "The preference '%s' does not exist in '%r'." % (prefName, self))
Exception: 2147549183 (The preference 'Invocations' does not exist in '<PrefSet: id=default type= idref=>'.)
[2014-04-11 15:58:45,372] [ERROR] dbgp.server: session cmdloop exception - sending session stop command
Traceback (most recent call last):
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\komodo\dbgp\serverBase.py", line 70, in _cmdloop
    self._handleIncoming()
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\komodo\dbgp\serverBase.py", line 144, in _handleIncoming
    newdata = self._socket.recv(1024)
error: [Errno 10054] An existing connection was forcibly closed by the remote host
[2014-04-11 15:58:45,374] [ERROR] dbgp.server: session sendCommand socket error error(10054, 'An existing connection was forcibly closed by the remote host')
[2014-04-11 15:58:50,378] [ERROR] dbgp.server: -1 (session timed out while waiting for response)
Traceback (most recent call last):
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\komodo\dbgp\server.py", line 1854, in _stdinHandlerThread
    self.currentSession.setStdinHandler(None)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\komodo\dbgp\server.py", line 1769, in setStdinHandler
    node = self.sendCommandWait(cmd)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\komodo\dbgp\server.py", line 1108, in sendCommandWait
    node = self._waitResponse(tid)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\komodo\dbgp\server.py", line 1139, in _waitResponse
    raise DBGPError('session timed out while waiting for response')
koDBGPError: -1 (session timed out while waiting for response)

@mook probably something for you to have a look at:

Exception: 2147549183 (The preference 'Invocations' does not exist in '&lt;PrefSet: id=default type= idref=&gt;'.)
[2014-04-11 11:06:59,887] [ERROR] dbgp.server: session cmdloop exception - sending session stop command
Traceback (most recent call last):
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\komodo\dbgp\serverBase.py", line 70, in _cmdloop
    self._handleIncoming()
  File "C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\mozilla\python\komodo\dbgp\serverBase.py", line 144, in _handleIncoming
    newdata = self._socket.recv(1024)

@ericp is probably better, actually. But anyway:

In the debug dialog thing (where you list the scripts to debug), is there a configuration listed at the top? What happens if you make a new one for the heck of it (and use it)?

I create a new debug configuration as requested, but it behaves the same.

Is anybody working on this? I really need to be able to debug! If it helps, you can easily install a Windows version of Google App Engine for Python. I installed it on Win8.1 into the default directory (C:\Program Files (x86)\Google…).

Hey Devel,

Yes, i’m taking a look at this. I can reproduce easily and I’m currently enabling debugging in the debug server it’s self to see if I can see anything. I’ll bump the issue up a technical notch if I’m labor isn’t fruitful. At that point I’ll be passing it off to @Mook or @ericp.

  • Carey

Hope everyone had a nice Easter. How is this coming? I would think it would be important for Komodo IDE to be able to debug Google App Engine Python apps…

Hey Devel,

We’re still looking at this. I’ve had to handed it off to Toddw who’s much more familiar with the Komodo debugger code than I am. It was not obvious to me why GAE is apparently bypassing Komodos thread debugging…or if that’s what’s happening for that matter but it certainly looks that way to me.

Hopefully Toddw can quickly get to the bottom of this.

  • Carey

Long story short - GAE uses special threading hooks (as well as other hacks) to control the Python environment, but this negatively affects the Komodo debugger, which relies on those Python threading modules in order to function correctly.

I am not able to get debugging working with the latest GAE Python code base.

That’s surprising … I love Komodo IDE, and you guys are top notch. PyCharms claims to have this GAE debugging working, as does PyDev 2.8+ on Eclipse. Is this something that I can help you get support for on the GAE forums?

I see that Wing IDE does not yet have this working, and recommends using old_dev_appserver.py for now. However, I tried that with Komodo and it didn’t seem to respect a breakpoint … but perhaps I’m doing it wrong. Can you verify whether old_dev_appserver.py still works for you? Komodo did work with GAE in the past, and it would be nice to have something working.

Here’s a link with some interesting GAE debugging info, and Google said that they “fixed” problems with Python debug support in September 2013.

I’ve never tried PyCharms, and I don’t want to now. Eclipse was bloated and slow compared to Komodo last time I checked. Do you need me to facilitate a topic thread on GAE support?

Good digging there!

Yes, Komodo does work with the old_dev_appserver.py - at least in my testing, including breakpoints. Just note that the breakpoints should be set before launching the server (or when you’ve at a breakpoint already) otherwise code that is running already will not see the new breakpoints.

From your post, I would imagine that the subprocess launching is the biggest thing that breaks debugging capabilities… but it wouldn’t surprise me if there were more issues.

I’ve logged a Komodo bug on this here:
https://bugs.activestate.com/show_bug.cgi?id=103722

Does the old dev app server work for you now?

Cheers,
Todd

Update: I had some success using the --python_startup_script argument - as recommended by GAE devs:
https://bugs.activestate.com/show_bug.cgi?id=103722#c1

Thanks, Todd. I was indeed able to set breakpoints with old_dev_appserver.py if I set them before starting the server.

However, I can’t seem to get the script to work. If I go to Debug > Go, what exactly should I put in each field? Here’s what I tried:

  • Language: Python
  • Script: C:\Program Files (x86)\Google\google_appengine\dev_appserver.py
  • Script Arguments: --python_startup_script C:\gae_tracer.py App
  • Directory: C:\Users\Dev (this is the parent directory of App)
  • Debug in Separate Console: Checked

Ah, I was actually testing from the console - so I didn’t run it from inside of Komodo. Try this:

python "C:\Program Files (x86)\Google\google_appengine\dev_appserver.py" --python_startup_script C:\gae_tracer.py App

as that will debug the launched App process (instead of the parent dev_appserver.py process).

Sorry, I still can’t get this work.

Before getting into the real problem, though, if we do get this to work, is there a way to do it from within Komodo? If not, I’m not sure exactly how this would work … I would launch Komodo, then run the command line, and if a breakpoint were encountered, Komodo IDE would catch it? Would the breakpoints have to be set before launching GAE?

Regardless, running from the command line didn’t work for me. Here’s the response when I tried to send a get request to the App:

Debugger startup failed: [Errno 10061] No connection could be made because the target machine actively refused it Configuration app_id: “dev~countdown”
version_id: “1.012377731252700942”
application_root: “C:\Users\Dan\Dev\CountDown\Server\App”
threadsafe: true
api_port: 57357
libraries {
name: “protorpc”
version: “1.0”
}
libraries {
name: “webapp2”
version: “2.3”
}
libraries {
name: “webob”
version: “1.1.1”
}
libraries {
name: “yaml”
version: “3.10”
}
skip_files: “^(./)?((#.#)|(.~)|(.\.py[co])|(./RCS/.)|(\…*)|)$”
static_files: “^$”
cloud_sql_config {
mysql_host: “localhost”
mysql_port: 3306
mysql_user: “”
mysql_password: “”
}
datacenter: “us1”
instance_id: “5d9f31dfbb6ea0ef492abbad7afa2b95d28c”
python_config {
startup_script: “C:\Users\Dan\Dev\Tools\Komodo_Debug.py”
}
stderr_log_level: 1
auth_domain: “gmail.com
api_host: “localhost”

Traceback Traceback (most recent call last):
File “C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\python\runtime.py”, line 141, in main
execfile(config.python_config.startup_script, global_vars)
File “C:\Users\Dan\Dev\Tools\Komodo_Debug.py”, line 6, in
client.brk()
File “C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\support\dbgp\pythonlib\dbgp\client.py”, line 3933, in brk
client.connect(host, port, name, scriptArgs)
File “C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\support\dbgp\pythonlib\dbgp\client.py”, line 2313, in connect
self.socket.connect()
File “C:\Program Files (x86)\ActiveState Komodo IDE 8\lib\support\dbgp\pythonlib\dbgp\client.py”, line 2161, in connect
self._socket.connect((self.hostname,self.port))
File “C:\Python27\lib\socket.py”, line 224, in meth
return getattr(self._sock,name)(*args)
error: [Errno 10061] No connection could be made because the target machine actively refused it

To start from inside of Komodo, use the Debug > Run Without Debugging menu - this will launch the debugging dialog, but will not start debugging the dev_appserver.

Looks like you may need to correct the port used by the Komodo (check in Debug > Listener Status for the correct port), by default the client.brk() call will use port 9000:

client.brk(host='localhost', port=9000)

There may be a way to pass the port automatically into the script - I think GAE have a command argument for that too…