HTTP/1.1 503 Service Unavailable when I add pdb.set_trace to Swift source code

asked 2017-06-21 22:53:18 -0500

Yifei Liu gravatar image

I want to debug swift and figure out how the object creates. I know that create object is the HTTP PUT request, so I add import pdb; pdb.set_trace() in the def PUT(self, request): function in the swift/swift/obj/server.py file. However, when I use Swift RESTful API and other methods to create object, it shows "Service Unavailable" as follows:

HTTP/1.1 503 Service Unavailable
Last-Modified: Thu, 22 Jun 2017 02:40:38 GMT
Content-Length: 118
Content-Type: text/html; charset=UTF-8
X-Trans-Id: tx6da701fe62b34e2aaf7da-00594b2e25
X-Openstack-Request-Id: tx6da701fe62b34e2aaf7da-00594b2e25
Date: Thu, 22 Jun 2017 02:40:37 GMT
<html>
<h1>Service Unavailable</h1>
<p>The server is currently unavailable. Please try again at a later time.</p>
</html>

This PUT function I change is responsible for handling the HTTP PUT requests. When I add other codes like add metadata attributes, it works and without any errors. But why it has "503 Service Unavailable" error if I add pdb.set_trace() in it?

Thanks so much for your kind help! Really appreciate your answers!

edit retag flag offensive close merge delete