webob 1.2b3 breaking the proxy server

Bug #959881 reported by Kesav Kumar Kolla
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Medium
Iryoung Jeong

Bug Description

I've installed latest code from git repository and proxy server is throwing the following error:

Mar 19 18:26:00 sitwiki proxy-server ERROR Unhandled exception in request: #012Traceback (most recent call last):#012 File "/home/kesav/.virtualenvs/senv/local/lib/python2.7/site-packages/swift/proxy/server.py", line 1889, in handle_request#012 return handler(req)#012 File "/home/kesav/.virtualenvs/senv/local/lib/python2.7/site-packages/swift/proxy/server.py", line 93, in wrapped#012 return func(*a, **kw)#012 File "/home/kesav/.virtualenvs/senv/local/lib/python2.7/site-packages/swift/proxy/server.py", line 650, in HEAD#012 return self.GETorHEAD(req)#012 File "/home/kesav/.virtualenvs/senv/local/lib/python2.7/site-packages/swift/proxy/server.py", line 1614, in GETorHEAD#012 req.path_info.rstrip('/'), self.app.account_ring.replica_count)#012 File "/home/kesav/.virtualenvs/senv/local/lib/python2.7/site-packages/swift/proxy/server.py", line 841, in GETorHEAD_base#012 source.getheader('x-timestamp')#012TypeError: 'NoneType' object does not support item assignment (txn: txe84a6a03213048d791e48caa61136b00) (client_ip: 127.0.0.1)

Basically the response object doesn't have any environ property. Latest webob on the python repository is bumped to 1.2b3 so the proxy server is not working with this.

In proxy/server.py

After line 836

I've added res.environ = req.renviron

This resolved the issue.

Also the common/utils.py doesn't have the fix for req.params. It still has req.str_params which is throwing warning.

Revision history for this message
Pete Zaitcev (zaitcev) wrote :

I'm wondering if we want something like the attached patch that modifies headers. With this patch in place, the Swift_X_Timestamp starts popping up in ever "st stat -v", while before it was not the case. What are really trying to accomplish here and how does the "container sync feature" actually work?

Revision history for this message
Pete Zaitcev (zaitcev) wrote :

I take it back, I was working on a version that differs from the git tip. Here's a better patch - rely on 1.2b3 providing an empty Response.environ.

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/7569

Changed in swift:
assignee: nobody → Pete Zaitcev (zaitcev)
status: New → In Progress
Revision history for this message
Pete Zaitcev (zaitcev) wrote :

This turned out more involved than I imagined. Kesav, if you care, please have a look too. There's way more to it than just resp.environ.

Revision history for this message
Pete Zaitcev (zaitcev) wrote :

See also bug 888371 (was closed for webob-1.1.1, then re-opened and has reviews linked).

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Changed in swift:
assignee: Pete Zaitcev (zaitcev) → iryoung jeong (iryoung)
Changed in swift:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

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

commit de4d23c2a517050ab0afd0c8d0dbab817139b055
Author: Iryoung Jeong <email address hidden>
Date: Wed Jun 6 03:39:53 2012 +0900

    Adapt Swift for WebOb 1.2

    Based on PatchSet 3 of https://review.openstack.org/#/c/7569/ , make them to pass all funcional tests with both webob 1.x and 1.2.

    The additional following compatibility issues were addressed:
     - Until patch for range header issue is merged into official webob release, testRangedGetsWithLWSinHeader() should skip test against webob 1.2
    (https://github.com/Pylons/webob/commit/49c175aec2b5c134511dfea6564bfb1d37ab23a9)

     - common.constraints.check_utf8() can accept both utf8 str and unicode.

     - To convert unicode to utf-8 str if necessary.

     - Making proxy_logging can handle invalid utf-8 str

    bug 888371
    bug 959881

    blueprint webob-support

    Change-Id: I00e5fd04cd1653259606a4ffdd4926db3c84c496

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

Related blueprints

Remote bug watches

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