google-compute-enginegoogle-app-engine-pythonmanaged-vmgoogle-cloud-debugger

Google Cloud Debugger not working for Python AppEngine Managed VMs


As announced today in Production Troubleshooting with Cloud Debugger now available for Python, supposedly I can use Python Debugger now.

I am running AppEngine Managed VMs on GCE images, so am following the guide for Setting up Python on Compute Engine. I have modified my Dockerfile to add pip install google-python-cloud-debugger (I've also tried installing the library directly into my app/lib, which is included in my sys.path):

FROM gcr.io/google_appengine/python-compat
RUN pip install google-python-cloud-debugger
ADD . /app

And then I have modified my main.py to enable the debugger:

try:
  import googleclouddebugger
  googleclouddebugger.AttachDebugger()
except ImportError:
  pass

Unfortunately, when I commit the code, run gcloud preview app gen-repo-info-file, and push it, I cannot use the debugger. When I go to https://console.developers.google.com/debug, it loads my github repository on the right, but I see an error message in the left-hand nav area:

Debugging is not available. You can debug Java applications running on App Engine or Compute Engine

Any ideas what might be going wrong, or how to debug the debugger?


Solution

  • Although the other thread did provide a lot of opportunity to follow common best-practices in debugging, the solution is a lot simpler than either of us had imagined. It's likely that the errors you're seeing are a result of the fact that Managed VMs with python is not yet a supported platform for Cloud Debugger, according to the documentation.

    However, with the growth of the Cloud Debugger service, and the fact that Cloud Debugger with python at all was just announced on the 7th, it's certainly possible that this will change.

    Feel free to file Feature Requests in the Cloud Platform Public Issue Tracker if you notice something missing and would like to let us know that it's an interest to you and others who might star the issue.