Proxy server returning response code 404 instead of 503

Bug #1567246 reported by rohita joshi
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Low
rohita joshi

Bug Description

On execution of create object metadata use case using following curl command, on an environment where container server is down,

curl -i <public_url>/<container-name>/<object-name> -X POST -H "X-Auth-Token: <token>" -H "X-Object-Meta-<property name>: <value>"

Http response code 404 is returned i.e., resource not found. In proxy-sever log, the container-server failures reported as response code 503 i.e., service unavailable. The proxy should return HTTP response 503 , as container services are stopped, hence unavailable. Response code 404 mislead the user as it signifies that container server is working but the container, for which metadata is being created, is not found.

Cause: Swift confirm the container existence before making POST (and also PUT) request to object-servers[1]. However, the check with container_info is currently assuming that non-successful code is NotFound [2].

Solution: If we could pass the status code in the container_info, we may handle the response code at [1].

1: https://github.com/openstack/swift/blob/master/swift/proxy/controllers/obj.py#L243-L244
2: https://github.com/openstack/swift/blob/master/swift/proxy/controllers/base.py#L1547

rohita joshi (rjoshi16)
Changed in keystone:
assignee: nobody → rohita joshi (rjoshi16)
rohita joshi (rjoshi16)
affects: keystone → swift
Revision history for this message
Hisashi Osanai (osanai-hisashi) wrote :

I would like to confirm whether the object for being meta update exists or not.

https://github.com/openstack/swift/blob/master/swift/obj/server.py#L482

Revision history for this message
rohita joshi (rjoshi16) wrote :

Yes, the object whose metadata is being created exists.

Revision history for this message
Kota Tsuyuzaki (tsuyuzaki-kota) wrote :

I changed the bug description to be correct for the behavior. Exactly, it sounds a bug and desirably it should be fixed if no one affected by the status code change from 404 to 503.

description: updated
Changed in swift:
status: New → Confirmed
Changed in swift:
importance: Undecided → Low
Revision history for this message
Tim Burke (1-tim-z) wrote :
Changed in swift:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.