google-code-export / s3ql

Automatically exported from code.google.com/p/s3ql
0 stars 0 forks source link

Handle SSLV3_ALERT_UNEXPECTED_MESSAGE #440

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi Niko,

An SSL error (on the latest development version):

2013-11-26 21:22:30.044 [pid=3989, thread='Dummy-29', 
module='s3ql.backends.common', fn='wrapped', line=77]: Encountered 
BadStatusLine exception (''), retrying call to Backend.open_read...
2013-11-26 21:22:31.770 [pid=3989, thread='Thread-8', module='root', 
fn='excepthook', line=157]: Uncaught top-level exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.3/dist-packages/s3ql-2.5-py3.3-linux-x86_64.egg/s3ql/mount.py", line 54, in run_with_except_hook
    run_old(*args, **kw)
  File "/usr/lib/python3.3/threading.py", line 596, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.3/dist-packages/s3ql-2.5-py3.3-linux-x86_64.egg/s3ql/block_cache.py", line 313, in _upload_loop
    self._do_upload(*tmp)
  File "/usr/local/lib/python3.3/dist-packages/s3ql-2.5-py3.3-linux-x86_64.egg/s3ql/block_cache.py", line 337, in _do_upload
    obj_size = backend.perform_write(do_write, 's3ql_data_%d' % obj_id).get_obj_size()
  File "/usr/local/lib/python3.3/dist-packages/s3ql-2.5-py3.3-linux-x86_64.egg/s3ql/backends/common.py", line 65, in wrapped
    return method(*a, **kw)
  File "/usr/local/lib/python3.3/dist-packages/s3ql-2.5-py3.3-linux-x86_64.egg/s3ql/backends/common.py", line 418, in perform_write
    return fn(fh)
  File "/usr/local/lib/python3.3/dist-packages/s3ql-2.5-py3.3-linux-x86_64.egg/s3ql/backends/common.py", line 878, in __exit__
    self.close()
  File "/usr/local/lib/python3.3/dist-packages/s3ql-2.5-py3.3-linux-x86_64.egg/s3ql/backends/common.py", line 871, in close
    self.fh.close()
  File "/usr/local/lib/python3.3/dist-packages/s3ql-2.5-py3.3-linux-x86_64.egg/s3ql/backends/common.py", line 988, in close
    self.fh.close()
  File "/usr/local/lib/python3.3/dist-packages/s3ql-2.5-py3.3-linux-x86_64.egg/s3ql/backends/common.py", line 65, in wrapped
    return method(*a, **kw)
  File "/usr/local/lib/python3.3/dist-packages/s3ql-2.5-py3.3-linux-x86_64.egg/s3ql/backends/s3c.py", line 705, in close
    headers=self.headers, body=self.fh)
  File "/usr/local/lib/python3.3/dist-packages/s3ql-2.5-py3.3-linux-x86_64.egg/s3ql/backends/s3c.py", line 297, in _do_request
    resp = self._send_request(method, path, headers, subres, query_string, body)
  File "/usr/local/lib/python3.3/dist-packages/s3ql-2.5-py3.3-linux-x86_64.egg/s3ql/backends/s3c.py", line 486, in _send_request
    self.conn.endheaders(None)
  File "/usr/lib/python3.3/http/client.py", line 1057, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python3.3/http/client.py", line 902, in _send_output
    self.send(msg)
  File "/usr/lib/python3.3/http/client.py", line 840, in send
    self.connect()
  File "/usr/lib/python3.3/http/client.py", line 1202, in connect
    server_hostname=server_hostname)
  File "/usr/lib/python3.3/ssl.py", line 217, in wrap_socket
    _context=self)
  File "/usr/lib/python3.3/ssl.py", line 317, in __init__
    raise x
  File "/usr/lib/python3.3/ssl.py", line 313, in __init__
    self.do_handshake()
  File "/usr/lib/python3.3/ssl.py", line 520, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: SSLV3_ALERT_UNEXPECTED_MESSAGE] sslv3 alert unexpected 
message (_ssl.c:547)
2013-11-26 21:22:35.048 [pid=3989, thread='Thread-5', 
module='s3ql.backends.common', fn='wrapped', line=77]: Encountered 
BadStatusLine exception (''), retrying call to ObjectW.close...
2013-11-26 21:22:36.973 [pid=3989, thread='MainThread', module='s3ql.mount', 
fn='unmount', line=129]: Unmounting file system...

Original issue reported on code.google.com by czv...@gmail.com on 26 Nov 2013 at 2:49

GoogleCodeExporter commented 9 years ago
Thanks for the report. Not sure how to best handle this. S3QL could just 
reconnect, but I'm hesitant to silently ignore SSL errors (especially those 
containing the word ALERT). Does this happen often? 

Original comment by Nikolaus@rath.org on 26 Nov 2013 at 4:51

GoogleCodeExporter commented 9 years ago
After some Googling, it seems that this error is often associated with either 
the client or server SSL stack being buggy:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=514694
https://bugs.launchpad.net/ubuntu/+source/curl/+bug/595415
http://openssl.6102.n7.nabble.com/quot-sslv3-alert-unexpected-message-quot-durin
g-renegotiation-td42446.html

In other words, this error isn't something that can always be fixed by 
retrying. It may work in some cases, but in other cases S3QL would continously 
retry even though the only fix is to update the SSL stack.

I assume for you the problem happens only very sporadically? 

Original comment by Nikolaus@rath.org on 27 Nov 2013 at 4:25

GoogleCodeExporter commented 9 years ago
This is the first time I've seen this. Ok, I will keep an eye on it to see if 
it ever happens again. Will also try to update the OS to the latest, but 
hopefully this never shows up again.

Original comment by czv...@gmail.com on 27 Nov 2013 at 12:31

GoogleCodeExporter commented 9 years ago
I'll close this issue for now, as the problem seems to be infrequent and 
indicative of a real issue with either the client or server's ssl stack.

Thanks for the report!

Original comment by Nikolaus@rath.org on 11 Dec 2013 at 2:17