14

I just upgraded to the App Engine 1.7.6 SDK for my python app and realised that breakpoints no longer work in PyDev (Eclipse plugin) when using the new dev_appserver.py.

Does anyone know of a way of enabling them again? I assume the new server is spawning a new process for the web server, and the debugger isn't attaching to that one. I'm not sure how to configure it to do that though.

In the meantime I am using the old_dev_appserver.py server.

Lipis
  • 21,388
  • 20
  • 94
  • 121
Dylan
  • 2,614
  • 2
  • 18
  • 21
  • 1
    By "no longer work" I mean the breakpoints aren't being triggered in the Eclipse IDE. – Dylan Mar 20 '13 at 06:20
  • 1
    I was just about to ask the same question – matcheek Mar 20 '13 at 18:18
  • I have submitted an issue on AppEngine project: https://code.google.com/p/googleappengine/issues/detail?id=9012 – matcheek Mar 20 '13 at 18:43
  • Is this somehow related to the new pyobjc warning? http://stackoverflow.com/questions/15513642/do-i-seriously-need-to-install-xcode-and-compile-pyobjc-as-a-result-of-1-7-6-upd – Shaun Budhram Mar 21 '13 at 19:08
  • I'm not sure but I am on osx and have xcode installed. The server works fine, it is just breakpoints in pydev that do not. – Dylan Mar 22 '13 at 06:04
  • I can confirm what you're seeing: with SDK version 1.7.6 breakpoints are not being hit in Eclipse with PyDev and that using old_dev_appserver.py does seem to resolve the issue. – SNyamathi Mar 29 '13 at 03:43
  • Ditto here, Windows 7, Eclipse 4.2, PyDev 2.7.3, GAE 1.7.6. Breakpoints are not being hit. I tried the suggestion to call MonkeyPatchPdb, that did not help either. Not sure how it was supposed to help. I do not put pdb.set_trace() calls in my code. I rely on PyDev interactive debugging. – Michael Kariv Apr 04 '13 at 06:33

3 Answers3

8

UPDATE 2012-07-27:

Following the comment, I verified, the issue is solved after updating to PyDev. 2.8 and App Engine 1.8.2

OBSOLETE:

I found the following analysis of the problem at googleappengine issues tracker

The reason why PDB doesn't work is because dev_appserver is using stdin/stdout for interprocess communication. Python has built-in libraries for IPC: http://docs.python.org/2/library/ipc.html. dev_appserver should use these, and then stdin/stdout can be left alone so that PDB still works.

So it seems that there is no workaround, rather than reverting to use old_dev_appserver.py

UPDATE 2013-04-23: Inability to debug is annoying. Many developers complain about it

  1. PyDev Breakpoints in App Engine 1.7.6 broken?
  2. https://groups.google.com/forum/?fromgroups=#!topic/google-appengine/ep5BWYKpQpU
  3. https://groups.google.com/forum/?fromgroups=#!topic/google-appengine/TCQuJpF44cY
  4. https://code.google.com/p/appengine-devappserver2-experiment/issues/detail?id=28
  5. https://code.google.com/p/googleappengine/issues/detail?id=9012

I am keeping track of the development of this issue here: http://goo.gl/XRU01

Community
  • 1
  • 1
Michael Kariv
  • 1,421
  • 13
  • 20
  • 1
    Just to note, PyDev 2.8.0 is now supporting the new hooks on Google App Engine, so, debugging should be working again. See release details at: http://pydev.org/ – Fabio Zadrozny Jul 25 '13 at 20:20
  • I had the same problem as Dylan, and I confirm it is solved with PyDev 2.8. – Vladimir Obrizan Jul 27 '13 at 11:37
  • Thanks for update, seems we have enough evidence to conclude that the issue is **finally** resolved. Personally I think it is a shame it took so long. – Michael Kariv Jul 28 '13 at 12:41
  • This is still broken for me, after updating both GAE and PyDev to the latest versions. I even tried reinstalling Eclipse, PyDev, and GAE. Simply changing the target back to 'old_dev_appserver.py' fixes the problem. – Shaun Budhram Aug 12 '13 at 08:24
3

Yep, ran into the same problem.

Open your Run/Debug Configuration and set the Main Module to:

${GOOGLE_APP_ENGINE}/old_dev_appserver.py
Kevin
  • 31
  • 1
1

Do you mean pdb.set_trace() isn't working?

Look for the function MonkeyPatchPdb() in google/appengine/tools/dev_appserver.py

Run that somewehere in your own project before you use pdb and it should fix it.

dragonx
  • 14,963
  • 27
  • 44
  • MonkeyPatchPdb doesn't seem to exist in the new dev_appserver.py. I am not sure if PyDev uses Pdb, I am just setting breakpoints in the Eclipse IDE. I did try using pdb.set_trace though, and it caused the script to quit. – Dylan Mar 20 '13 at 03:58
  • Is it how it supposed to work: putting the code below in your /main.py ? from google.appengine.tools.dev_appserver import MonkeyPatchPdb import pdb MonkeyPatchPdb(pdb) – Michael Kariv Apr 04 '13 at 06:16