settingsLogin | Registersettings

[openstack-dev] swiftclient report that header value 120 must be of type str or bytes, not <type 'int'>, the detail info is like the following

0 votes

2016-08-11 08:01:25.371 [00;32mDEBUG keystoneclient.auth.identity.v2 [[00;36m-[00;32m] [01;35m[00;32mMaking authentication request to http://127.0.0.1:5000/v2.0/tokens[00m [00;33mfrom (pid=30110) getauthref /usr/local/lib/python2.7/dist-packages/keystoneclient/auth/identity/v2.py:87[00m 2016-08-11 08:01:28.786 [00;32mDEBUG swiftclient [[00;36m-[00;32m] [01;35m[00;32mREQ: curl -i http://127.0.0.1:8080/v1/AUTH_819fc87a6b1648f1b8dff8a0d09a9c62/smaug -X PUT -H "Content-Length: 0" -H "X-Auth-Token: c11af1086dd14279..."[00m [00;33mfrom (pid=30110) httplog /usr/local/lib/python2.7/dist-packages/swiftclient/client.py:164[00m 2016-08-11 08:01:28.786 [00;32mDEBUG swiftclient [[00;36m-[00;32m] [01;35m[00;32mRESP STATUS: 201 Created[00m [00;33mfrom (pid=30110) httplog /usr/local/lib/python2.7/dist-packages/swiftclient/client.py:165[00m 2016-08-11 08:01:28.787 [00;32mDEBUG swiftclient [[00;36m-[00;32m] [01;35m[00;32mRESP HEADERS: {u'Date': u'Thu, 11 Aug 2016 08:01:28 GMT', u'Content-Length': u'0', u'Content-Type': u'text/html; charset=UTF-8', u'X-Trans-Id': u'tx931f23ce6e584cbe9894e-0057ac30d8'}[00m [00;33mfrom (pid=30110) httplog /usr/local/lib/python2.7/dist-packages/swiftclient/client.py:166[00m 2016-08-11 08:01:28.803 [00;32mDEBUG swiftclient [[00;36m-[00;32m] [01;35m[00;32mREQ: curl -i http://127.0.0.1:8080/v1/AUTH_819fc87a6b1648f1b8dff8a0d09a9c62/leases -X PUT -H "Content-Length: 0" -H "X-Auth-Token: c11af1086dd14279..."[00m [00;33mfrom (pid=30110) httplog /usr/local/lib/python2.7/dist-packages/swiftclient/client.py:164[00m 2016-08-11 08:01:28.803 [00;32mDEBUG swiftclient [[00;36m-[00;32m] [01;35m[00;32mRESP STATUS: 201 Created[00m [00;33mfrom (pid=30110) httplog /usr/local/lib/python2.7/dist-packages/swiftclient/client.py:165[00m 2016-08-11 08:01:28.804 [00;32mDEBUG swiftclient [[00;36m-[00;32m] [01;35m[00;32mRESP HEADERS: {u'Date': u'Thu, 11 Aug 2016 08:01:28 GMT', u'Content-Length': u'0', u'Content-Type': u'text/html; charset=UTF-8', u'X-Trans-Id': u'tx8069168a9d5641728cab8-0057ac30d8'}[00m [00;33mfrom (pid=30110) httplog /usr/local/lib/python2.7/dist-packages/swiftclient/client.py:166[00m 2016-08-11 08:01:42.819 [01;31mERROR swiftclient [[00;36m-[01;31m] [01;35m[01;31mHeader value 120 must be of type str or bytes, not [00m [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00mTraceback (most recent call last): [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 1565, in retry [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m servicetoken=self.service_token, **kwargs) [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 1268, in put_object [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m conn.request('PUT', path, contents, headers) [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 401, in request [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m files=files, **self.requests_args) [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 384, in _request [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m return self.request_session.request(*arg, **kwarg) [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 457, in request [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m prep = self.prepare_request(req) [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 390, in prepare_request [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m hooks=merge_hooks(request.hooks, self.hooks), [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 295, in prepare [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m self.prepare_headers(headers) [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 409, in prepare_headers [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m check_header_validity(header) [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/requests/utils.py", line 756, in check_header_validity [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m "not %s" % (value, type(value))) [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00mInvalidHeader: Header value 120 must be of type str or bytes, not [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m 2016-08-11 08:01:42.821 [01;31mERROR smaug.services.protection.provider [[00;36m-[01;31m] [01;35m[01;31mLoad bank plugin: 'smaug-swift-bank-plugin' failed.[00m__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

asked Aug 11, 2016 in openstack-dev by 张帅 (260 points)   1 2
retagged Jan 26, 2017 by admin

2 Responses

0 votes

2016-08-11 08:01:25.371 [00;32mDEBUG keystoneclient.auth.identity.v2 [[00;36m-[00;32m] [01;35m[00;32mMaking authentication request to http://127.0.0.1:5000/v2.0/tokens[00m [00;33mfrom (pid=30110) getauthref /usr/local/lib/python2.7/dist-packages/keystoneclient/auth/identity/v2.py:87[00m 2016-08-11 08:01:28.786 [00;32mDEBUG swiftclient [[00;36m-[00;32m] [01;35m[00;32mREQ: curl -i http://127.0.0.1:8080/v1/AUTH_819fc87a6b1648f1b8dff8a0d09a9c62/smaug -X PUT -H "Content-Length: 0" -H "X-Auth-Token: c11af1086dd14279..."[00m [00;33mfrom (pid=30110) httplog /usr/local/lib/python2.7/dist-packages/swiftclient/client.py:164[00m 2016-08-11 08:01:28.786 [00;32mDEBUG swiftclient [[00;36m-[00;32m] [01;35m[00;32mRESP STATUS: 201 Created[00m [00;33mfrom (pid=30110) httplog /usr/local/lib/python2.7/dist-packages/swiftclient/client.py:165[00m 2016-08-11 08:01:28.787 [00;32mDEBUG swiftclient [[00;36m-[00;32m] [01;35m[00;32mRESP HEADERS: {u'Date': u'Thu, 11 Aug 2016 08:01:28 GMT', u'Content-Length': u'0', u'Content-Type': u'text/html; charset=UTF-8', u'X-Trans-Id': u'tx931f23ce6e584cbe9894e-0057ac30d8'}[00m [00;33mfrom (pid=30110) httplog /usr/local/lib/python2.7/dist-packages/swiftclient/client.py:166[00m 2016-08-11 08:01:28.803 [00;32mDEBUG swiftclient [[00;36m-[00;32m] [01;35m[00;32mREQ: curl -i http://127.0.0.1:8080/v1/AUTH_819fc87a6b1648f1b8dff8a0d09a9c62/leases -X PUT -H "Content-Length: 0" -H "X-Auth-Token: c11af1086dd14279..."[00m [00;33mfrom (pid=30110) httplog /usr/local/lib/python2.7/dist-packages/swiftclient/client.py:164[00m 2016-08-11 08:01:28.803 [00;32mDEBUG swiftclient [[00;36m-[00;32m] [01;35m[00;32mRESP STATUS: 201 Created[00m [00;33mfrom (pid=30110) httplog /usr/local/lib/python2.7/dist-packages/swiftclient/client.py:165[00m 2016-08-11 08:01:28.804 [00;32mDEBUG swiftclient [[00;36m-[00;32m] [01;35m[00;32mRESP HEADERS: {u'Date': u'Thu, 11 Aug 2016 08:01:28 GMT', u'Content-Length': u'0', u'Content-Type': u'text/html; charset=UTF-8', u'X-Trans-Id': u'tx8069168a9d5641728cab8-0057ac30d8'}[00m [00;33mfrom (pid=30110) httplog /usr/local/lib/python2.7/dist-packages/swiftclient/client.py:166[00m 2016-08-11 08:01:42.819 [01;31mERROR swiftclient [[00;36m-[01;31m] [01;35m[01;31mHeader value 120 must be of type str or bytes, not [00m [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00mTraceback (most recent call last): [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 1565, in retry [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m servicetoken=self.service_token, **kwargs) [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 1268, in put_object [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m conn.request('PUT', path, contents, headers) [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 401, in request [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m files=files, **self.requests_args) [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 384, in _request [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m return self.request_session.request(*arg, **kwarg) [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 457, in request [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m prep = self.prepare_request(req) [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 390, in prepare_request [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m hooks=merge_hooks(request.hooks, self.hooks), [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 295, in prepare [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m self.prepare_headers(headers) [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 409, in prepare_headers [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m check_header_validity(header) [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/requests/utils.py", line 756, in check_header_validity [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m "not %s" % (value, type(value))) [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00mInvalidHeader: Header value 120 must be of type str or bytes, not [01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m 2016-08-11 08:01:42.821 [01;31mERROR smaug.services.protection.provider [[00;36m-[01;31m] [01;35m[01;31mLoad bank plugin: 'smaug-swift-bank-plugin' failed.[00m__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

responded Aug 11, 2016 by 张帅 (260 points)   1 2
0 votes

This is the result of a fairly recent change in requests [1], released 8 Aug. While the enforcement of header-value types is fairly recent, they've documented since 2.0.1 that headers must be byte- or unicode-strings [2], and more recently clarified it in their quick start guide [3]. It looks like this has been addressed in smaug already [4], but I'd expect that you could downgrade requests to 2.10.0 while waiting for a new release of smaug.

[1] https://github.com/kennethreitz/requests/pull/3366
[2] https://github.com/kennethreitz/requests/blob/v2.0.1/docs/api.rst#behavioral-changes
[3] http://docs.python-requests.org/en/latest/user/quickstart/#custom-headers
[4] https://review.openstack.org/#/c/355427/

Tim

On Aug 11, 2016, at 1:17 AM, zhangshuai 446077695@qq.com wrote:

2016-08-11 08:01:25.371
[00;32mDEBUG keystoneclient.auth.identity.v2 [[00;36m-[00;32m] [01;35m[00;32mMaking authentication request to http://127.0.0.1:5000/v2.0/tokens[00m [00;33mfrom (pid=30110) getauthref /usr/local/lib/python2.7/dist-packages/keystoneclient/auth/identity/v2.py:87[00m

2016-08-11 08:01:28.786
[00;32mDEBUG swiftclient [[00;36m-[00;32m] [01;35m[00;32mREQ: curl -i http://127.0.0.1:8080/v1/AUTH_819fc87a6b1648f1b8dff8a0d09a9c62/smaug -X PUT -H "Content-Length: 0" -H "X-Auth-Token: c11af1086dd14279..."[00m [00;33mfrom (pid=30110) http_log /usr/local/lib/python2.7/dist-packages/swiftclient/client.py:164[00m

2016-08-11 08:01:28.786
[00;32mDEBUG swiftclient [[00;36m-[00;32m] [01;35m[00;32mRESP STATUS: 201 Created[00m [00;33mfrom (pid=30110) http_log /usr/local/lib/python2.7/dist-packages/swiftclient/client.py:165[00m

2016-08-11 08:01:28.787
[00;32mDEBUG swiftclient [[00;36m-[00;32m] [01;35m[00;32mRESP HEADERS: {u'Date': u'Thu, 11 Aug 2016 08:01:28 GMT', u'Content-Length': u'0', u'Content-Type': u'text/html; charset=UTF-8', u'X-Trans-Id': u'tx931f23ce6e584cbe9894e-0057ac30d8'}[00m [00;33mfrom (pid=30110) http_log /usr/local/lib/python2.7/dist-packages/swiftclient/client.py:166[00m

2016-08-11 08:01:28.803
[00;32mDEBUG swiftclient [[00;36m-[00;32m] [01;35m[00;32mREQ: curl -i http://127.0.0.1:8080/v1/AUTH_819fc87a6b1648f1b8dff8a0d09a9c62/leases -X PUT -H "Content-Length: 0" -H "X-Auth-Token: c11af1086dd14279..."[00m [00;33mfrom (pid=30110) http_log /usr/local/lib/python2.7/dist-packages/swiftclient/client.py:164[00m

2016-08-11 08:01:28.803
[00;32mDEBUG swiftclient [[00;36m-[00;32m] [01;35m[00;32mRESP STATUS: 201 Created[00m [00;33mfrom (pid=30110) http_log /usr/local/lib/python2.7/dist-packages/swiftclient/client.py:165[00m

2016-08-11 08:01:28.804
[00;32mDEBUG swiftclient [[00;36m-[00;32m] [01;35m[00;32mRESP HEADERS: {u'Date': u'Thu, 11 Aug 2016 08:01:28 GMT', u'Content-Length': u'0', u'Content-Type': u'text/html; charset=UTF-8', u'X-Trans-Id': u'tx8069168a9d5641728cab8-0057ac30d8'}[00m [00;33mfrom (pid=30110) http_log /usr/local/lib/python2.7/dist-packages/swiftclient/client.py:166[00m

2016-08-11 08:01:42.819
[01;31mERROR swiftclient [[00;36m-[01;31m] [01;35m[01;31mHeader value 120 must be of type str or bytes, not [00m

[01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00mTraceback (most recent call last):

[01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 1565, in _retry

[01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m servicetoken=self.servicetoken, **kwargs)

[01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 1268, in put_object

[01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m conn.request('PUT', path, contents, headers)

[01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 401, in request

[01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m files=files, **self.requests_args)

[01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 384, in _request

[01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m return self.request_session.request(*arg, **kwarg)

[01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 457, in request

[01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m prep = self.prepare_request(req)

[01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 390, in prepare_request

[01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m hooks=merge_hooks(request.hooks, self.hooks),

[01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 295, in prepare

[01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m self.prepare_headers(headers)

[01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 409, in prepare_headers

[01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m checkheadervalidity(header)

[01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m File "/usr/local/lib/python2.7/dist-packages/requests/utils.py", line 756, in checkheadervalidity

[01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m "not %s" % (value, type(value)))

[01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00mInvalidHeader: Header value 120 must be of type str or bytes, not

[01;31m2016-08-11 08:01:42.819 TRACE swiftclient [01;35m[00m

2016-08-11 08:01:42.821 [01;31mERROR smaug.services.protection.provider [[00;36m-[01;31m] [01;35m[01;31mLoad bank plugin: 'smaug-swift-bank-plugin' failed.[00m


OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
responded Aug 16, 2016 by Tim_Burke (380 points)  
...