Swift on py3 doesn't like message/rfc822 data
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Fix Released
|
High
|
Tim Burke |
Bug Description
While trying to upload:
$ curl http://
* Trying 127.0.1.1...
* TCP_NODELAY set
* Connected to saio (127.0.1.1) port 8090 (#0)
> PUT /v1/AUTH_test/c/o HTTP/1.1
> Host: saio:8090
> User-Agent: curl/7.58.0
> Accept: */*
> content-
> Content-Length: 0
>
* Empty reply from server
* Connection #0 to host saio left intact
curl: (52) Empty reply from server
Proxy logs spew errors like:
Feb 13 05:50:38 saio proxy-server: STDERR: Traceback (most recent call last):
Feb 13 05:50:38 saio proxy-server: STDERR: File ".../eventlet/
timer()
Feb 13 05:50:38 saio proxy-server: STDERR: File ".../eventlet/
cb(*args, **kw)
Feb 13 05:50:38 saio proxy-server: STDERR: File ".../eventlet/
result = function(*args, **kwargs)
Feb 13 05:50:38 saio proxy-server: STDERR: File ".../eventlet/
proto.
Feb 13 05:50:38 saio proxy-server: STDERR: File "/vagrant/
wsgi.
Feb 13 05:50:38 saio proxy-server: STDERR: File ".../eventlet/
self.handle()
Feb 13 05:50:38 saio proxy-server: STDERR: File ".../eventlet/
self.
Feb 13 05:50:38 saio proxy-server: STDERR: File ".../swift/
got = wsgi.HttpProtoc
Feb 13 05:50:38 saio proxy-server: STDERR: File ".../eventlet/
self.environ = self.get_environ()
Feb 13 05:50:38 saio proxy-server: STDERR: File ".../swift/
for line in header_
Feb 13 05:50:38 saio proxy-server: STDERR: AttributeError: 'list' object has no attribute 'rstrip'
If you've got a py2 proxy and py3 backends, proxy gets the hangups and client gets a 503; if you've already got data in the cluster (because it was uploaded when everything was still py2), the GET fails with a 503 as every backend request dies like
Feb 13 06:00:40 saio proxy-server: ERROR with Object server 127.0.0.1:6040/sdb4 re: Trying to GET /v1/AUTH_test/c/o:
Traceback (most recent call last):
File ".../swift/
possible_source = conn.getresponse()
File ".../swift/
response = HTTPConnection.
File ".../eventlet/
response.
File ".../swift/
for line in header_
AttributeError: 'list' object has no attribute 'rstrip'
The core of it comes down to our attempt [1] to fix up a bug in eventlet [2] that's inherited from cpython [3]; turns out using the email module to parse HTTP is just a terrible idea all around. Experimentally, it looks like any message/* content-type will trigger the bad?
[1] https:/
[2] https:/
[3] https:/
Changed in swift: | |
status: | Confirmed → In Progress |
Reviewed: https:/ /review. opendev. org/707312 /git.openstack. org/cgit/ openstack/ swift/commit/ ?id=04cc11b938a ac3e9225870d4dd 2b7f3fc89f20a3
Committed: https:/
Submitter: Zuul
Branch: master
commit 04cc11b938aac3e 9225870d4dd2b7f 3fc89f20a3
Author: Tim Burke <email address hidden>
Date: Tue Feb 11 21:34:05 2020 -0800
py3: stop barfing on message/rfc822 Content-Types
Closes-Bug: #1863053 f9f200e16bc081d 8a0f30308b9
Change-Id: I7493d3e201e26d