Comment 1 for bug 1858259

Revision history for this message
Tim Burke (1-tim-z) wrote :

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:

$ curl -F redirect=/v1/AUTH_test/c/thanks.html -F maxmax_file_count=3 -F expires=1578445456 -F signature=b60d8d455deb53f8a2a50a794ab155c8a9925b5c -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:
<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:

$ curl -F max_file_size=102400 -F max_file_count=3 -F expires=1578444242 -F signature=df2b9b797125c7ff2dbe320206538f6190f17a78 -F file0="@~/.s3cfg;filename=☃" https://saio/v1/AUTH_test/c/let_it_☃_ -v
Warning: setting file ~/.s3cfg failed!
* Trying 127.0.1.1...
... <snip> ...
> POST /v1/AUTH_test/c/let_it_☃_ HTTP/1.1
> Host: saio
> User-Agent: curl/7.58.0
> Accept: */*
> Transfer-Encoding: chunked
> Content-Type: multipart/form-data; boundary=------------------------fe289f46b0bc0e60
> 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:
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''