wrong messages returned when using curl in version 1.5.1
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Referring to os-objectstorag
First paste my environment:
swift -V 2 -A http://
=======
StorageURL: https:/
Auth Token: 9e579fe05f1b4c1
Account: AUTH_9e7357d5ab
Containers: 2
Objects: 0
Bytes: 0
Accept-Ranges: bytes
X-Timestamp: 1342127815.07385
X-Trans-Id: txcf3d0dd4b6374
=======
OK, let's start.
1. Authentication
curl -i -H "X-Auth-
return: 501 Not Implemented
2. Determining Storage Usage
Firstly, here shows my account usage.
curl -k -H "X-Auth-
return:
China_Telecom.png
photos
('photos' is a container, which has an object in it, and 'China_Telecom.png' is an object, too.)
However, when use the following curl, it come wrong!
curl -k -X HEAD -i -H "X-Auth-
return:
=======
HTTP/1.1 204 No Content
X-Account-
X-Timestamp: 1342127815.07647
X-Account-
X-Account-
Accept-Ranges: bytes
Content-Length: 0
X-Trans-Id: tx55a0b4fb5f3f4
=======
It should be:
X-Account-
X-Account-
X-Account-
Changed in swift: | |
status: | New → Incomplete |
Changed in swift: | |
status: | Incomplete → Invalid |
I'm having a little trouble following but...
1) How did you get past this? Is this a Keystone issue, doesn't seem like a Swift-specific thing (v2.0)?
2) That listing is of containers, so it shows you having two containers: China_Telecom.png and photos. Perhaps you had previously accidentally created a China_Telecom.png container?
Lastly, the stats (X-Account- Container- Count, X-Account- Object- Count, and X-Account- Bytes-Used) are all "delayed" stats, in that they will eventually reflect what is in the account, but it may take some time.
In a very controlled situation:
First, just start up proxy, account, container, and object servers:
$ sudo swift-init main start
Check the account is empty: 127.0.0. 1:8080/ v1/AUTH_ test -Hx-auth- token:AUTH_ tk8c663f1dd7364 e48a5f64ccdc695 4cb3 Container- Count: 0 Object- Count: 0 Bytes-Used: 0
$ curl -i http://
HTTP/1.1 204 No Content
X-Account-
X-Account-
X-Account-
Now, create a new container: 127.0.0. 1:8080/ v1/AUTH_ test/test_ container -Hx-auth- token:AUTH_ tk8c663f1dd7364 e48a5f64ccdc695 4cb3
$ curl -XPUT http://
201 Created
Check what the account's listing of containers shows (this update is *almost* always immediate, but might be delayed): 127.0.0. 1:8080/ v1/AUTH_ test -Hx-auth- token:AUTH_ tk8c663f1dd7364 e48a5f64ccdc695 4cb3 Container- Count: 1 Object- Count: 0 Bytes-Used: 0
$ curl -i http://
HTTP/1.1 200 OK
X-Account-
X-Account-
X-Account-
test_container
Next, create an object in that container: 127.0.0. 1:8080/ v1/AUTH_ test/test_ container/ test_object --data-binary test_value -Hx-auth- token:AUTH_ tk8c663f1dd7364 e48a5f64ccdc695 4cb3
$ curl -XPUT http://
201 Created
Check what the account's listing of containers shows again (object stats to the account level are *always* delayed): 127.0.0. 1:8080/ v1/AUTH_ test -Hx-auth- token:AUTH_ tk8c663f1dd7364 e48a5f64ccdc695 4cb3 Container- Count: 1 Object- Count: 0 Bytes-Used: 0
$ curl -i http://
HTTP/1.1 200 OK
X-Account-
X-Account-
X-Account-
test_container
Check what the container's listing of objects shows (this is *almost* always immediate, but may be delayed): 127.0.0. 1:8080/ v1/AUTH_ test/test_ container -Hx-auth- token:AUTH_ tk8c663f1dd7364 e48a5f64ccdc695 4cb3 Object- Count: 1 Bytes-Used: 10
$ curl -i http://
HTTP/1.1 200 OK
X-Container-
X-Container-
test_object
Run the background updaters manually (these run on set intervals in a production system):
$ sudo swift-init object-updater once
$ sudo swift-init container-updater once
Check what the account's listing of containers shows now (the updaters sent the updated stats): 127.0.0. 1:8080/ v1/AUTH_ test -Hx-auth- token:AUTH_ tk8c663f1dd7364 e48a5f64ccdc695 4cb3 Container- Count: 1 Object- Count: 1 Bytes-Used: 10
$ curl -i http://
HTTP/1.1 200 OK
X-Account-
X-Account-
X-Account-
test_container
Hopefully this helps explains things a bit.