Project

General

Profile

Actions

Bug #6462

closed

Cannot update object HTTP headers using swift API

Added by Aaron Schulz over 10 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
High
Assignee:
Target version:
-
% Done:

0%

Source:
Community (dev)
Tags:
Backport:
Regression:
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

I swear this used to work in argonaut and works in Swift but in ceph .69. I can set headers using PUT but using POST gives a nice HTTP 202 response but nothing is changed.

I first noticed this using MediaWiki, though eventually ended up using curl directly via terminal to eliminate possible factors. Example below:

aaron@aaron-HP-HDX18-Notebook-PC:/var/www/DevWiki/core (review/aaron_schulz/2013/filebackend-get-metadata)$ curl -i -X 'PUT' -a 'http://aaron-hp-hdx18-notebook-pc/swift/v1/aaron-devwiki-wmf-testing/myfacefile.txt' -d "meow" -H "Content-Disposition: yyy" -H "X-Auth-User: mediawiki:swift" -H "X-Auth-Token: AUTH_rgwtk0f0000006d6564696177696b693a73776966749b4c9aef8a57276b3ce74d52f07ac52ecae346542cc3a160de4f97f000b85d925539a096"
HTTP/1.1 201 Created
Date: Wed, 02 Oct 2013 22:19:15 GMT
Server: Apache/2.2.22 (Ubuntu)
etag: 4a4be40c96ac6314e91d93f38043a634
Vary: Accept-Encoding
Transfer-Encoding: chunked
Content-Type: text/plain; charset=utf-8

aaron@aaron-HP-HDX18-Notebook-PC:/var/www/DevWiki/core (review/aaron_schulz/2013/filebackend-get-metadata)$ curl --head -a 'http://aaron-hp-hdx18-notebook-pc/swift/v1/aaron-devwiki-wmf-testing/myfacefile.txt'
HTTP/1.1 200 OK
Date: Wed, 02 Oct 2013 22:20:17 GMT
Server: Apache/2.2.22 (Ubuntu)
Accept-Ranges: bytes
Last-Modified: Wed, 02 Oct 2013 22:19:15 GMT
etag: 4a4be40c96ac6314e91d93f38043a634
Content-Disposition: yyy
Content-Length: 4
Content-Type: application/x-www-form-urlencoded

aaron@aaron-HP-HDX18-Notebook-PC:/var/www/DevWiki/core (review/aaron_schulz/2013/filebackend-get-metadata)$ curl -i -X 'POST' -a 'http://aaron-hp-hdx18-notebook-pc/swift/v1/aaron-devwiki-wmf-testing/myfacefile.txt' -H "Content-Disposition: xxx" -H "X-Auth-User: mediawiki:swift" -H "X-Auth-Token: AUTH_rgwtk0f0000006d6564696177696b693a73776966749b4c9aef8a57276b3ce74d52f07ac52ecae346542cc3a160de4f97f000b85d925539a096"
HTTP/1.1 202 Accepted
Date: Wed, 02 Oct 2013 22:20:33 GMT
Server: Apache/2.2.22 (Ubuntu)
Vary: Accept-Encoding
Transfer-Encoding: chunked
Content-Type: text/plain; charset=utf-8

aaron@aaron-HP-HDX18-Notebook-PC:/var/www/DevWiki/core (review/aaron_schulz/2013/filebackend-get-metadata)$ curl --head -a 'http://aaron-hp-hdx18-notebook-pc/swift/v1/aaron-devwiki-wmf-testing/myfacefile.txt'
HTTP/1.1 200 OK
Date: Wed, 02 Oct 2013 22:20:57 GMT
Server: Apache/2.2.22 (Ubuntu)
Accept-Ranges: bytes
Last-Modified: Wed, 02 Oct 2013 22:20:33 GMT
etag: 4a4be40c96ac6314e91d93f38043a634
Content-Disposition: yyy
Content-Length: 4
Content-Type: application/x-www-form-urlencoded

Actions #1

Updated by Aaron Schulz over 10 years ago

I should not that adding new headers doesn't work other, not just replacing old ones.

aaron@aaron-HP-HDX18-Notebook-PC:/var/www/DevWiki/core (review/aaron_schulz/2013/filebackend-get-metadata)$ curl --head -a 'http://aaron-hp-hdx18-notebook-pc/swift/v1/aaron-devwiki-wmf-testing/myfacefile.txt'HTTP/1.1 200 OK
Date: Wed, 02 Oct 2013 22:57:06 GMT
Server: Apache/2.2.22 (Ubuntu)
Accept-Ranges: bytes
Last-Modified: Wed, 02 Oct 2013 22:57:03 GMT
etag: 4a4be40c96ac6314e91d93f38043a634
Content-Length: 4
Content-Type: application/x-www-form-urlencoded

aaron@aaron-HP-HDX18-Notebook-PC:/var/www/DevWiki/core (review/aaron_schulz/2013/filebackend-get-metadata)$ curl -i -X 'POST' -a 'http://aaron-hp-hdx18-notebook-pc/swift/v1/aaron-devwiki-wmf-testing/myfacefile.txt' -H "Content-Disposition: xxx" -H "X-Auth-User: mediawiki:swift" -H "X-Auth-Token: AUTH_rgwtk0f0000006d6564696177696b693a73776966749b4c9aef8a57276b3ce74d52f07ac52ecae346542cc3a160de4f97f000b85d925539a096" -H "x-object-meta-extratag:value"
HTTP/1.1 202 Accepted
Date: Wed, 02 Oct 2013 22:57:15 GMT
Server: Apache/2.2.22 (Ubuntu)
Vary: Accept-Encoding
Transfer-Encoding: chunked
Content-Type: text/plain; charset=utf-8

aaron@aaron-HP-HDX18-Notebook-PC:/var/www/DevWiki/core (review/aaron_schulz/2013/filebackend-get-metadata)$ curl --head -a 'http://aaron-hp-hdx18-notebook-pc/swift/v1/aaron-devwiki-wmf-testing/myfacefile.txt'HTTP/1.1 200 OK
Date: Wed, 02 Oct 2013 22:57:17 GMT
Server: Apache/2.2.22 (Ubuntu)
Accept-Ranges: bytes
Last-Modified: Wed, 02 Oct 2013 22:57:15 GMT
etag: 4a4be40c96ac6314e91d93f38043a634
X-Object-Meta-extratag: value
Content-Length: 4
Content-Type: application/x-www-form-urlencoded

Also, in previous testing with Swift, setting a header to an empty string removed it, which I can't do here either.

Actions #2

Updated by Ian Colle over 10 years ago

  • Assignee set to Yehuda Sadeh
  • Priority changed from Normal to High
Actions #3

Updated by Aaron Schulz over 10 years ago

Of course I meant "I swear this used to work in argonaut and works in Swift but not in ceph .69."

Actions #4

Updated by Yehuda Sadeh over 10 years ago

This seems to mostly work. The only thing that is not working is the (special case) content-disposition header, which probably never worked (with POST).

Actions #5

Updated by Yehuda Sadeh over 10 years ago

  • Status changed from New to Fix Under Review
  • Assignee changed from Yehuda Sadeh to Josh Durgin
Actions #6

Updated by Josh Durgin over 10 years ago

  • Status changed from Fix Under Review to 15
  • Assignee changed from Josh Durgin to Yehuda Sadeh
  • Source changed from other to Community (dev)

Fix looks good. I'm not sure if it should be backported or not.

Actions #7

Updated by Yehuda Sadeh over 10 years ago

  • Status changed from 15 to Resolved

Done, commit:f2645e1c6d7383a0ace3b239f4304e353249c4bb. Cherry-picked into dumpling.

Actions #8

Updated by Aaron Schulz over 10 years ago

Using Emperor, I'm still having a hard time getting POST (as well as copy via PUT) to update or remove Content-Disposition headers.

Actions #9

Updated by Aaron Schulz over 10 years ago

I noticed that Content-Encoding has the same problem.

Actions

Also available in: Atom PDF