Ask Your Question
0

Debugging OpenStack Swift with Eclipse and Pydev

asked 2013-07-11 03:21:12 -0600

spoilt gravatar image

I have gone through the following links for trying to setup my debugging environment for OpenStack Swift but haven't been able to do so far.

  1. http://debugopenstack.blogspot.com/
  2. https://ask.openstack.org/question/815/how-do-i-debug-nova-service-with-eclipse-and-pydev/

Following is my development environment configuration:

  • Ubuntu 12.04 as the host OS (No VM).
  • Ubuntu 12.04 as the guest OS running on VMWare Player.
  • OpenStack has been successfully deployed on the guest OS using DevStack.

Following the aforementioned links, I have tried setting up my remote debugging environment as follows:

  • Eclipse is installed on my host OS along with pydev.
  • I have copied the pysrc folder from host OS to guest OS.
  • Path of pysrc in guest OS is: /usr/lib/python2.7/site-packages/pysrc.
  • Added line sys.path.append('/usr/lib/python2.7/site-packages/pysrc/') after import sys in the file swift-init located at /opt/stack/swift/bin.
  • Added line import pydevd and pydevd.settrace("10.99.13.16", port=5678, stdoutToServer=True, stderrToServer=True,suspend=True) under the function def put(self, metadata, extension='.data') in file server.py located at '/opt/stack/swift/swift/obj to set a breakpoint.
  • Started the debug server on my host OS. Now I am unable to execute stack.s script successfully and it gives the following errors at the end:

Errors:

Request returned failure status.
500 Internal Server Error
Failed to upload image
    (HTTP 500)
++ failed
++ local r=1
+++ jobs -p
++ kill
++ set +o xtrace

This error is obviously due to my addition of import line in the file server.py as commenting it out makes it work just fine.

Contents of my localrc file are:

http_proxy=http://10.1.11.11:8080/
https_proxy=http://10.1.11.11:8080/
export no_proxy="localhost,127.0.0.1"

HOST_IP=localhost
SERVICE_HOST=$HOST_IP
IMAGE_HOST=$HOST_IP
IDENTITY_HOST=$HOST_IP

ADMIN_PASSWORD=password
MYSQL_PASSWORD=password
RABBIT_PASSWORD=password
SERVICE_PASSWORD=password
SERVICE_TOKEN=tokentoken
enable_service key mysql s-proxy s-object s-container s-account
SWIFT_HASH=d40a025f0ebcd7de1650

Please guide me in light of the provided information.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-07-19 04:59:21 -0600

clayg gravatar image

swift-init uses subprocess, which is exec style sys calls - not fork

So when you mangle sys.path in swift-init it doesn't get transferred or preserved in the proxy process.

I would say you should just pip install pysrc, but apparently it's not distributed on PyPi (too bad [1])

You you should use PYTHONPATH [2]

  1. http://pydev.org/manual_adv_remote_debugger.html
  2. http://docs.python.org/2/using/cmdline.html#envvar-PYTHONPATH
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

Stats

Asked: 2013-07-11 03:21:12 -0600

Seen: 950 times

Last updated: Jul 19 '13