There doesn't seem to be anything special about the response: all DELETE methods currently return 204: No Content. But returning OK with a body, or even an error with a body, produces the same problem.
This could be a result of a limitation of urllib2: its Request class assumes that all requests are either GET or POST. Our client code splices in support for other methods, but that may not be enough.
To help further debugging, here's a traceback from a blocked client:
File "/usr/lib/python2.7/dist-packages/apiclient/maas_client.py", line 244, in delete
url, method="DELETE", headers=headers)
File "/usr/lib/python2.7/dist-packages/apiclient/maas_client.py", line 113, in dispatch_query
res = urllib2.urlopen(req)
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 404, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 422, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1214, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1187, in do_open
r = h.getresponse(buffering=True)
File "/usr/lib/python2.7/httplib.py", line 1045, in getresponse
response.begin()
File "/usr/lib/python2.7/httplib.py", line 409, in begin
version, status, reason = self._read_status()
File "/usr/lib/python2.7/httplib.py", line 365, in _read_status
line = self.fp.readline(_MAXLINE + 1)
File "/usr/lib/python2.7/socket.py", line 476, in readline
data = self._sock.recv(self._rbufsize)
There doesn't seem to be anything special about the response: all DELETE methods currently return 204: No Content. But returning OK with a body, or even an error with a body, produces the same problem.
This could be a result of a limitation of urllib2: its Request class assumes that all requests are either GET or POST. Our client code splices in support for other methods, but that may not be enough.
To help further debugging, here's a traceback from a blocked client:
File "/usr/lib/ python2. 7/dist- packages/ apiclient/ maas_client. py", line 244, in delete python2. 7/dist- packages/ apiclient/ maas_client. py", line 113, in dispatch_query urlopen( req) python2. 7/urllib2. py", line 127, in urlopen python2. 7/urllib2. py", line 404, in open python2. 7/urllib2. py", line 422, in _open python2. 7/urllib2. py", line 382, in _call_chain python2. 7/urllib2. py", line 1214, in http_open open(httplib. HTTPConnection, req) python2. 7/urllib2. py", line 1187, in do_open buffering= True) python2. 7/httplib. py", line 1045, in getresponse begin() python2. 7/httplib. py", line 409, in begin python2. 7/httplib. py", line 365, in _read_status readline( _MAXLINE + 1) python2. 7/socket. py", line 476, in readline recv(self. _rbufsize)
url, method="DELETE", headers=headers)
File "/usr/lib/
res = urllib2.
File "/usr/lib/
return _opener.open(url, data, timeout)
File "/usr/lib/
response = self._open(req, data)
File "/usr/lib/
'_open', req)
File "/usr/lib/
result = func(*args)
File "/usr/lib/
return self.do_
File "/usr/lib/
r = h.getresponse(
File "/usr/lib/
response.
File "/usr/lib/
version, status, reason = self._read_status()
File "/usr/lib/
line = self.fp.
File "/usr/lib/
data = self._sock.