Funny -- I tried uploading a file named ☃ (snowman) and my browser seems to have turned that into ... and HTML entity?? "☃"
But putting it in the upload prefix got me a traceback! A little different from yours, though:
Jan 7 23:45:34 saio proxy-server: get_keys(): from callback: 'latin-1' codec can't encode character '\u2603' in position 24: ordinal not in range(256):
Traceback (most recent call last):
File "/vagrant/swift/swift/common/middleware/crypto/crypto_utils.py", line 170, in get_keys
keys = fetch_crypto_keys(key_id=key_id)
File "/vagrant/swift/swift/common/middleware/crypto/keymaster.py", line 130, in fetch_crypto_keys
path, secret_id=secret_id)
File "/vagrant/swift/swift/common/middleware/crypto/keymaster.py", line 299, in create_key
return hmac.new(key, wsgi_to_bytes(path),
File "/vagrant/swift/swift/common/swob.py", line 279, in wsgi_to_bytes
return wsgi_str.encode('latin1')
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2603' in position 24: ordinal not in range(256)
I can get a similar error using curl to get a snowman in the filename:
So I tried disabling encryption -- which caused a pretty fun blow-up, this time coming out on STDERR:
Exception ignored in:
<generator object ProxyLoggingMiddleware.__call__.<locals>.iter_response at 0x7f8910b5dc50>
Traceback (most recent call last):
File "/vagrant/swift/swift/common/middleware/proxy_logging.py", line 409, in iter_response
start_time, time.time(), resp_headers=resp_headers)
File "/vagrant/swift/swift/common/middleware/proxy_logging.py", line 224, in log_request
if req.path.startswith('/v1/'):
File "/vagrant/swift/swift/common/swob.py", line 1070, in path
self.environ['PATH_INFO'])
File "/vagrant/swift/swift/common/swob.py", line 309, in wsgi_quote
raise TypeError('Expected a WSGI string; got %r' % wsgi_str)
TypeError
:
Expected a WSGI string; got '/v1/AUTH_test/c/upload_☃'
Which is looking more familiar. Differences might be explained by changes on master since train to quote more paths when logging? At any rate, that's certainly close enough for me to call this confirmed!
Probably off-topic: My first try with curl led to... something strange:
Probably something to do with that warning from curl? Logs say
Jan 7 23:54:51 saio proxy-server: Error: An error occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/eventlet/wsgi.py", line 209, in _chunked_read
self.chunk_length = int(rfile.readline().split(b";", 1)[0], 16)
ValueError: invalid literal for int() with base 16: b''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/vagrant/swift/swift/common/utils.py", line 4380, in readline
chunk = self.wsgi_input.read(self.read_chunk_size)
File "/vagrant/swift/swift/common/utils.py", line 3945, in read
chunk = self.wsgi_input.read(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/eventlet/wsgi.py", line 221, in read
return self._chunked_read(self.rfile, length)
File "/usr/local/lib/python3.6/dist-packages/eventlet/wsgi.py", line 211, in _chunked_read
raise ChunkReadError(err)
eventlet.wsgi.ChunkReadError: invalid literal for int() with base 16: b''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/vagrant/swift/swift/common/middleware/catch_errors.py", line 75, in handle_request
resp = self._app_call(env)
File "/vagrant/swift/swift/common/wsgi.py", line 1398, in _app_call
resp = self.app(env, self._start_response)
File "/vagrant/swift/swift/common/middleware/gatekeeper.py", line 129, in __call__
return self.app(env, gatekeeper_response)
File "/vagrant/swift/swift/common/middleware/healthcheck.py", line 52, in __call__
return self.app(env, start_response)
File "/vagrant/swift/swift/common/middleware/proxy_logging.py", line 415, in __call__
iterable = self.app(env, my_start_response)
File "/vagrant/swift/swift/common/middleware/domain_remap.py", line 198, in __call__
return self.app(env, start_response)
File "/vagrant/swift/swift/common/middleware/memcache.py", line 109, in __call__
return self.app(env, start_response)
File "/vagrant/swift/swift/common/middleware/listing_formats.py", line 157, in __call__
return self.app(env, start_response)
File "/vagrant/swift/swift/common/swob.py", line 1571, in _wsgify_self
return func(self, Request(env))(env, start_response)
File "/vagrant/swift/swift/common/swob.py", line 1571, in _wsgify_self
return func(self, Request(env))(env, start_response)
File "/vagrant/swift/swift/common/middleware/tempurl.py", line 504, in __call__
return self.app(env, start_response)
File "/vagrant/swift/swift/common/middleware/formpost.py", line 230, in __call__
env, attrs['boundary'])
File "/vagrant/swift/swift/common/middleware/formpost.py", line 273, in _translate_form
hdrs = parse_mime_headers(fp)
File "/vagrant/swift/swift/common/utils.py", line 4457, in parse_mime_headers
line = doc_file.readline()
File "/vagrant/swift/swift/common/utils.py", line 4382, in readline
raise swift.common.exceptions.ChunkReadError(str(e))
swift.common.exceptions.ChunkReadError: invalid literal for int() with base 16: b''
Funny -- I tried uploading a file named ☃ (snowman) and my browser seems to have turned that into ... and HTML entity?? "☃"
But putting it in the upload prefix got me a traceback! A little different from yours, though:
Jan 7 23:45:34 saio proxy-server: get_keys(): from callback: 'latin-1' codec can't encode character '\u2603' in position 24: ordinal not in range(256): swift/swift/ common/ middleware/ crypto/ crypto_ utils.py" , line 170, in get_keys keys(key_ id=key_ id) swift/swift/ common/ middleware/ crypto/ keymaster. py", line 130, in fetch_crypto_keys id=secret_ id) swift/swift/ common/ middleware/ crypto/ keymaster. py", line 299, in create_key bytes(path) , swift/swift/ common/ swob.py" , line 279, in wsgi_to_bytes encode( 'latin1' )
Traceback (most recent call last):
File "/vagrant/
keys = fetch_crypto_
File "/vagrant/
path, secret_
File "/vagrant/
return hmac.new(key, wsgi_to_
File "/vagrant/
return wsgi_str.
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2603' in position 24: ordinal not in range(256)
I can get a similar error using curl to get a snowman in the filename:
$ curl -F redirect= /v1/AUTH_ test/c/ thanks. html -F maxmax_file_count=3 -F expires=1578445456 -F signature= b60d8d455deb53f 8a2a50a794ab155 c8a9925b5c -F file0=" @/home/ vagrant/ .s3cfg; filename= ☃" https:/ /saio/v1/ AUTH_test/ c/upload_ -v
So I tried disabling encryption -- which caused a pretty fun blow-up, this time coming out on STDERR:
Exception ignored in: dleware. __call_ _.<locals> .iter_response at 0x7f8910b5dc50> swift/swift/ common/ middleware/ proxy_logging. py", line 409, in iter_response resp_headers) swift/swift/ common/ middleware/ proxy_logging. py", line 224, in log_request startswith( '/v1/') : swift/swift/ common/ swob.py" , line 1070, in path 'PATH_INFO' ]) swift/swift/ common/ swob.py" , line 309, in wsgi_quote test/c/ upload_ ☃'
<generator object ProxyLoggingMid
Traceback (most recent call last):
File "/vagrant/
start_time, time.time(), resp_headers=
File "/vagrant/
if req.path.
File "/vagrant/
self.environ[
File "/vagrant/
raise TypeError('Expected a WSGI string; got %r' % wsgi_str)
TypeError
:
Expected a WSGI string; got '/v1/AUTH_
Which is looking more familiar. Differences might be explained by changes on master since train to quote more paths when logging? At any rate, that's certainly close enough for me to call this confirmed!
Probably off-topic: My first try with curl led to... something strange:
$ curl -F max_file_ size=102400 -F max_file_count=3 -F expires=1578444242 -F signature= df2b9b797125c7f f2dbe320206538f 6190f17a78 -F file0=" @~/.s3cfg; filename= ☃" https:/ /saio/v1/ AUTH_test/ c/let_it_☃_ -v test/c/ let_it_ ☃_ HTTP/1.1 form-data; boundary= ------- ------- ------- ---fe289f46b0bc 0e60
Warning: setting file ~/.s3cfg failed!
* Trying 127.0.1.1...
... <snip> ...
> POST /v1/AUTH_
> Host: saio
> User-Agent: curl/7.58.0
> Accept: */*
> Transfer-Encoding: chunked
> Content-Type: multipart/
> Expect: 100-continue
>
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS Unknown, Unknown (23):
< HTTP/1.1 100 Continue
* TLSv1.3 (OUT), TLS Unknown, Unknown (23):
* read function returned funny value
* stopped the pause stream!
* Closing connection 0
* TLSv1.3 (OUT), TLS Unknown, Unknown (21):
* TLSv1.3 (OUT), TLS alert, Client hello (1):
curl: (26) read function returned funny value
Probably something to do with that warning from curl? Logs say
Jan 7 23:54:51 saio proxy-server: Error: An error occurred: lib/python3. 6/dist- packages/ eventlet/ wsgi.py" , line 209, in _chunked_read chunk_length = int(rfile. readline( ).split( b";", 1)[0], 16)
Traceback (most recent call last):
File "/usr/local/
self.
ValueError: invalid literal for int() with base 16: b''
During handling of the above exception, another exception occurred:
Traceback (most recent call last): swift/swift/ common/ utils.py" , line 4380, in readline input.read( self.read_ chunk_size) swift/swift/ common/ utils.py" , line 3945, in read input.read( *args, **kwargs) lib/python3. 6/dist- packages/ eventlet/ wsgi.py" , line 221, in read read(self. rfile, length) lib/python3. 6/dist- packages/ eventlet/ wsgi.py" , line 211, in _chunked_read wsgi.ChunkReadE rror: invalid literal for int() with base 16: b''
File "/vagrant/
chunk = self.wsgi_
File "/vagrant/
chunk = self.wsgi_
File "/usr/local/
return self._chunked_
File "/usr/local/
raise ChunkReadError(err)
eventlet.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): swift/swift/ common/ middleware/ catch_errors. py", line 75, in handle_request swift/swift/ common/ wsgi.py" , line 1398, in _app_call response) swift/swift/ common/ middleware/ gatekeeper. py", line 129, in __call__ response) swift/swift/ common/ middleware/ healthcheck. py", line 52, in __call__ swift/swift/ common/ middleware/ proxy_logging. py", line 415, in __call__ swift/swift/ common/ middleware/ domain_ remap.py" , line 198, in __call__ swift/swift/ common/ middleware/ memcache. py", line 109, in __call__ swift/swift/ common/ middleware/ listing_ formats. py", line 157, in __call__ swift/swift/ common/ swob.py" , line 1571, in _wsgify_self swift/swift/ common/ swob.py" , line 1571, in _wsgify_self swift/swift/ common/ middleware/ tempurl. py", line 504, in __call__ swift/swift/ common/ middleware/ formpost. py", line 230, in __call__ swift/swift/ common/ middleware/ formpost. py", line 273, in _translate_form headers( fp) swift/swift/ common/ utils.py" , line 4457, in parse_mime_headers swift/swift/ common/ utils.py" , line 4382, in readline exceptions. ChunkReadError( str(e)) exceptions. ChunkReadError: invalid literal for int() with base 16: b''
File "/vagrant/
resp = self._app_call(env)
File "/vagrant/
resp = self.app(env, self._start_
File "/vagrant/
return self.app(env, gatekeeper_
File "/vagrant/
return self.app(env, start_response)
File "/vagrant/
iterable = self.app(env, my_start_response)
File "/vagrant/
return self.app(env, start_response)
File "/vagrant/
return self.app(env, start_response)
File "/vagrant/
return self.app(env, start_response)
File "/vagrant/
return func(self, Request(env))(env, start_response)
File "/vagrant/
return func(self, Request(env))(env, start_response)
File "/vagrant/
return self.app(env, start_response)
File "/vagrant/
env, attrs['boundary'])
File "/vagrant/
hdrs = parse_mime_
File "/vagrant/
line = doc_file.readline()
File "/vagrant/
raise swift.common.
swift.common.