Comment 7 for bug 1625624

Revision history for this message
Liam Young (gnuoy) wrote :

I think I've got to the bottom of this, its a bug in goose so I assume it affects Juju 1.X and 2.X at the moment.

When Juju requests the deletion of a security group it hits the API with these parameters:

sendRateLimitedRequest method: DELETE
sendRateLimitedRequest URL: http://10.245.161.158:8774/v2/a65e1673ca784ec3b3a4b76c95a254b0/os-security-groups/3e4ff483-4b12-4a07-b466-ed93a146a56a
sendRateLimitedRequest headers: map[User-Agent:[goose (0.1.0)] X-Auth-Token:[54baab4248574e5c862de354100021fc] Content-Type:[application/octet-stream] Accept:[application/octet-stream]]
sendRateLimitedRequest reqData: []

(Output above doesn't match the uuids below because there from different test runs but you get the picture)

If I take those parameters and use curl I get:

$ curl -g -i -X DELETE http://10.245.161.158:8774/v2/a65e1673ca784ec3b3a4b76c95a254b0/os-security-groups/592c0b2e-ce86-4c6a-9778-faf8c89cdf61 -H "User-Agent: goose (0.1.0)" -H "Content-Type:[application/octet-stream]
" -H "Accept: application/octet-stream" -H "X-Auth-Token: b11ada0df6a342e1a667e579f6e6f153"
HTTP/1.1 415 Unsupported Media Type
Content-Type: application/json; charset=UTF-8
Content-Length: 70
X-Compute-Request-Id: req-d19a46a2-736f-479d-a0b4-156ffa4da8de
Date: Wed, 23 Nov 2016 12:15:02 GMT

{"badMediaType": {"message": "Unsupported Content-Type", "code": 415}

So the delete, fails and Juju keeps on trying. The problem is the sending of the "Content-Type:[application/octet-stream]" header, which isn't needed at all since I don't think DELETEs ever have a payload?

I have patched juju 1.X locally ( https://pastebin.canonical.com/171596/ ) to remove the Content-Type header from Delete requests for JsonRequest and BinaryRequest. This fixes the issue for me.