formpost return 503 when HTTP_USER_AGENT is not set

Bug #1190220 reported by Mehdi Abaakouk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Undecided
Chmouel Boudjnah

Bug Description

Hi,

The swift middleware formpost return 503 is the HTTP_USER_AGENT header is not set.

swift version is 1.8.0, master branch seems have the problem too.

Here the associated backtrace in the swift log:

# tail -2 /var/log/swift/proxy.error.log
Jun 12 14:44:25 localhost proxy-server 'HTTP_USER_AGENT': #012Traceback (most recent call last):#012 File "/usr/lib/python2.7/dist-packages/swift3/middleware.py", line 737, in __call__#012 return self.handle_request(env, start_response)#012 File "/usr/lib/python2.7/dist-packages/swift3/middleware.py", line 756, in handle_request#012 return self.app(env, start_response)#012 File "/usr/lib/python2.7/dist-packages/keystone/middleware/s3_token.py", line 134, in __call__#012 return self.app(environ, start_response)#012 File "/usr/lib/python2.7/dist-packages/swift/common/middleware/tempurl.py", line 239, in __call__#012 return self.app(env, start_response)#012 File "/usr/lib/python2.7/dist-packages/swift/common/middleware/formpost.py", line 316, in __call__#012 env['HTTP_USER_AGENT'] += ' FormPost'#012KeyError: 'HTTP_USER_AGENT' (txn: tx4f9b597cf56344da9995a6eccea5d90d)
Jun 12 14:45:17 localhost proxy-server 'HTTP_USER_AGENT': #012Traceback (most recent call last):#012 File "/usr/lib/python2.7/dist-packages/swift3/middleware.py", line 737, in __call__#012 return self.handle_request(env, start_response)#012 File "/usr/lib/python2.7/dist-packages/swift3/middleware.py", line 756, in handle_request#012 return self.app(env, start_response)#012 File "/usr/lib/python2.7/dist-packages/keystone/middleware/s3_token.py", line 134, in __call__#012 return self.app(environ, start_response)#012 File "/usr/lib/python2.7/dist-packages/swift/common/middleware/tempurl.py", line 239, in __call__#012 return self.app(env, start_response)#012 File "/usr/lib/python2.7/dist-packages/swift/common/middleware/formpost.py", line 316, in __call__#012 env['HTTP_USER_AGENT'] += ' FormPost'#012KeyError: 'HTTP_USER_AGENT' (txn: txc2f612b9a4d740578e2a6a1277958a0c)

Thanks in advance

Revision history for this message
Chmouel Boudjnah (chmouel) wrote :

This affect swift3 which is not shipped with swift probably need to be reported there.

Changed in swift:
status: New → Invalid
Revision history for this message
Chmouel Boudjnah (chmouel) wrote :

This should make it more robust in formpost as well.

Changed in swift:
status: Invalid → Confirmed
assignee: nobody → Chmouel Boudjnah (chmouel)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (master)

Fix proposed to branch: master
Review: https://review.openstack.org/32733

Changed in swift:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.openstack.org/32733
Committed: http://github.com/openstack/swift/commit/d4623939446292be6ec9f7b6992b2ac6c865ce76
Submitter: Jenkins
Branch: master

commit d4623939446292be6ec9f7b6992b2ac6c865ce76
Author: Chmouel Boudjnah <email address hidden>
Date: Wed Jun 12 16:26:23 2013 +0200

    Fix formpost with queries without user_agent.

    - Fixes bug 1190220.

    Change-Id: I3d46cc8f26ce9970dacb82bc5243b3528788c785

Changed in swift:
status: In Progress → Fix Committed
Changed in swift:
milestone: none → 1.9.0
Thierry Carrez (ttx)
Changed in swift:
status: Fix Committed → 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.