Repository: localstack/localstack

Issue:
Downloading files from localstack S3 generates "Requested Range Not Satisfiable"
Seems related to #1185, but I am copying a tar file (~414MB) up to my localstack S3 instance and trying to download it. Early on in the download (Looks like it's roughly 32MB in) the following is generated

```
+ aws --endpoint-url http://localhost:4572 s3 cp s3://test-bucket/test.tar /tmp/test.copy.tar
download failed: s3://test-bucket/test.tar to ./test.copy.tar An error occurred (416) when calling the GetObject operation: Requested Range Not Satisfiable
```

I am running the following to replicate this:
```
#!/bin/bash
set -x
set -e

# Create Bucket
aws --endpoint-url=http://localhost:4572 s3 mb s3://test-bucket

# Bucket ACL
aws --endpoint-url=http://localhost:4572 s3api put-bucket-acl --bucket test-bucket --acl public-read

# Copy to Bucket
aws --endpoint-url=http://localhost:4572 s3 cp /tmp/test.tar  s3://test-bucket/test.tar

# ls bucket
aws --endpoint-url=http://localhost:4572 s3 ls s3://test-bucket/

# Download
aws --endpoint-url http://localhost:4572 s3 cp s3://test-bucket/test.tar /tmp/test.copy.tar
```

Perhaps I am doing something wrong. The command I'm using to copy from s3 works on a real s3 instance, but not with localstack's.

As far as I can tell I'm using the latest localstack image installed w/ `pip3 install localstack[all]`.
```
localstack/localstack                   latest              06af7745282d        18 hours ago        829MB
```

I also don't think I am running out of Memory, Disk, ect.

And the localstack instance generates the following error messages:

```
2019-10-06T12:42:12:WARNING:localstack.services.generic_proxy: Connection prematurely closed by client (broken pipe).
----------------------------------------
Exception happened during processing of request from ('172.17.0.1', 48000)
Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 313, in forward
    self.wfile.write(to_bytes(response.content))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/socketserver.py", line 654, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 103, in __init__
    BaseHTTPRequestHandler.__init__(self, request, client_address, server)
  File "/usr/lib/python3.6/socketserver.py", line 724, in __init__
    self.handle()
  File "/usr/lib/python3.6/http/server.py", line 418, in handle
    self.handle_one_request()
  File "/usr/lib/python3.6/http/server.py", line 406, in handle_one_request
    method()
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 128, in do_GET
    self.forward('GET')
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 330, in forward
    self.end_headers()
  File "/usr/lib/python3.6/http/server.py", line 520, in end_headers
    self.flush_headers()
  File "/usr/lib/python3.6/http/server.py", line 524, in flush_headers
    self.wfile.write(b"".join(self._headers_buffer))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe
----------------------------------------
2019-10-06T12:42:12:WARNING:localstack.services.generic_proxy: Connection prematurely closed by client (broken pipe).
----------------------------------------
Exception happened during processing of request from ('172.17.0.1', 47988)
Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 313, in forward
    self.wfile.write(to_bytes(response.content))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/socketserver.py", line 654, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 103, in __init__
    BaseHTTPRequestHandler.__init__(self, request, client_address, server)
  File "/usr/lib/python3.6/socketserver.py", line 724, in __init__
    self.handle()
  File "/usr/lib/python3.6/http/server.py", line 418, in handle
    self.handle_one_request()
  File "/usr/lib/python3.6/http/server.py", line 406, in handle_one_request
    method()
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 128, in do_GET
    self.forward('GET')
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 330, in forward
    self.end_headers()
  File "/usr/lib/python3.6/http/server.py", line 520, in end_headers
    self.flush_headers()
  File "/usr/lib/python3.6/http/server.py", line 524, in flush_headers
    self.wfile.write(b"".join(self._headers_buffer))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe
----------------------------------------
2019-10-06T12:42:12:WARNING:localstack.services.generic_proxy: Connection prematurely closed by client (broken pipe).
----------------------------------------
Exception happened during processing of request from ('172.17.0.1', 48006)
Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 313, in forward
    self.wfile.write(to_bytes(response.content))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/socketserver.py", line 654, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 103, in __init__
    BaseHTTPRequestHandler.__init__(self, request, client_address, server)
  File "/usr/lib/python3.6/socketserver.py", line 724, in __init__
    self.handle()
  File "/usr/lib/python3.6/http/server.py", line 418, in handle
    self.handle_one_request()
  File "/usr/lib/python3.6/http/server.py", line 406, in handle_one_request
    method()
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 128, in do_GET
    self.forward('GET')
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 330, in forward
    self.end_headers()
  File "/usr/lib/python3.6/http/server.py", line 520, in end_headers
    self.flush_headers()
  File "/usr/lib/python3.6/http/server.py", line 524, in flush_headers
    self.wfile.write(b"".join(self._headers_buffer))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe
----------------------------------------
2019-10-06T12:42:12:WARNING:localstack.services.generic_proxy: Connection prematurely closed by client (broken pipe).
----------------------------------------
Exception happened during processing of request from ('172.17.0.1', 47960)
Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 313, in forward
    self.wfile.write(to_bytes(response.content))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/socketserver.py", line 654, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 103, in __init__
    BaseHTTPRequestHandler.__init__(self, request, client_address, server)
  File "/usr/lib/python3.6/socketserver.py", line 724, in __init__
    self.handle()
  File "/usr/lib/python3.6/http/server.py", line 418, in handle
    self.handle_one_request()
  File "/usr/lib/python3.6/http/server.py", line 406, in handle_one_request
    method()
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 128, in do_GET
    self.forward('GET')
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 330, in forward
    self.end_headers()
  File "/usr/lib/python3.6/http/server.py", line 520, in end_headers
    self.flush_headers()
  File "/usr/lib/python3.6/http/server.py", line 524, in flush_headers
    self.wfile.write(b"".join(self._headers_buffer))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe
----------------------------------------
2019-10-06T12:42:12:WARNING:localstack.services.generic_proxy: Connection prematurely closed by client (broken pipe).
----------------------------------------
Exception happened during processing of request from ('172.17.0.1', 48012)
Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 313, in forward
    self.wfile.write(to_bytes(response.content))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/socketserver.py", line 654, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 103, in __init__
    BaseHTTPRequestHandler.__init__(self, request, client_address, server)
  File "/usr/lib/python3.6/socketserver.py", line 724, in __init__
    self.handle()
  File "/usr/lib/python3.6/http/server.py", line 418, in handle
    self.handle_one_request()
  File "/usr/lib/python3.6/http/server.py", line 406, in handle_one_request
    method()
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 128, in do_GET
    self.forward('GET')
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 330, in forward
    self.end_headers()
  File "/usr/lib/python3.6/http/server.py", line 520, in end_headers
    self.flush_headers()
  File "/usr/lib/python3.6/http/server.py", line 524, in flush_headers
    self.wfile.write(b"".join(self._headers_buffer))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe
----------------------------------------
2019-10-06T12:42:12:WARNING:localstack.services.generic_proxy: Connection prematurely closed by client (broken pipe).
----------------------------------------
Exception happened during processing of request from ('172.17.0.1', 47958)
Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 313, in forward
    self.wfile.write(to_bytes(response.content))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/socketserver.py", line 654, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 103, in __init__
    BaseHTTPRequestHandler.__init__(self, request, client_address, server)
  File "/usr/lib/python3.6/socketserver.py", line 724, in __init__
    self.handle()
  File "/usr/lib/python3.6/http/server.py", line 418, in handle
    self.handle_one_request()
  File "/usr/lib/python3.6/http/server.py", line 406, in handle_one_request
    method()
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 128, in do_GET
    self.forward('GET')
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 330, in forward
    self.end_headers()
  File "/usr/lib/python3.6/http/server.py", line 520, in end_headers
    self.flush_headers()
  File "/usr/lib/python3.6/http/server.py", line 524, in flush_headers
    self.wfile.write(b"".join(self._headers_buffer))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe
----------------------------------------
2019-10-06T12:42:12:WARNING:localstack.services.generic_proxy: Connection prematurely closed by client (broken pipe).
----------------------------------------
Exception happened during processing of request from ('172.17.0.1', 48018)
Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 313, in forward
    self.wfile.write(to_bytes(response.content))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/socketserver.py", line 654, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 103, in __init__
    BaseHTTPRequestHandler.__init__(self, request, client_address, server)
  File "/usr/lib/python3.6/socketserver.py", line 724, in __init__
    self.handle()
  File "/usr/lib/python3.6/http/server.py", line 418, in handle
    self.handle_one_request()
  File "/usr/lib/python3.6/http/server.py", line 406, in handle_one_request
    method()
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 128, in do_GET
    self.forward('GET')
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 330, in forward
    self.end_headers()
  File "/usr/lib/python3.6/http/server.py", line 520, in end_headers
    self.flush_headers()
  File "/usr/lib/python3.6/http/server.py", line 524, in flush_headers
    self.wfile.write(b"".join(self._headers_buffer))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe
----------------------------------------
```
Downloading files from localstack S3 generates "Requested Range Not Satisfiable"
Seems related to #1185, but I am copying a tar file (~414MB) up to my localstack S3 instance and trying to download it. Early on in the download (Looks like it's roughly 32MB in) the following is generated

```
+ aws --endpoint-url http://localhost:4572 s3 cp s3://test-bucket/test.tar /tmp/test.copy.tar
download failed: s3://test-bucket/test.tar to ./test.copy.tar An error occurred (416) when calling the GetObject operation: Requested Range Not Satisfiable
```

I am running the following to replicate this:
```
#!/bin/bash
set -x
set -e

# Create Bucket
aws --endpoint-url=http://localhost:4572 s3 mb s3://test-bucket

# Bucket ACL
aws --endpoint-url=http://localhost:4572 s3api put-bucket-acl --bucket test-bucket --acl public-read

# Copy to Bucket
aws --endpoint-url=http://localhost:4572 s3 cp /tmp/test.tar  s3://test-bucket/test.tar

# ls bucket
aws --endpoint-url=http://localhost:4572 s3 ls s3://test-bucket/

# Download
aws --endpoint-url http://localhost:4572 s3 cp s3://test-bucket/test.tar /tmp/test.copy.tar
```

Perhaps I am doing something wrong. The command I'm using to copy from s3 works on a real s3 instance, but not with localstack's.

As far as I can tell I'm using the latest localstack image installed w/ `pip3 install localstack[all]`.
```
localstack/localstack                   latest              06af7745282d        18 hours ago        829MB
```

I also don't think I am running out of Memory, Disk, ect.

And the localstack instance generates the following error messages:

```
2019-10-06T12:42:12:WARNING:localstack.services.generic_proxy: Connection prematurely closed by client (broken pipe).
----------------------------------------
Exception happened during processing of request from ('172.17.0.1', 48000)
Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 313, in forward
    self.wfile.write(to_bytes(response.content))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/socketserver.py", line 654, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 103, in __init__
    BaseHTTPRequestHandler.__init__(self, request, client_address, server)
  File "/usr/lib/python3.6/socketserver.py", line 724, in __init__
    self.handle()
  File "/usr/lib/python3.6/http/server.py", line 418, in handle
    self.handle_one_request()
  File "/usr/lib/python3.6/http/server.py", line 406, in handle_one_request
    method()
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 128, in do_GET
    self.forward('GET')
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 330, in forward
    self.end_headers()
  File "/usr/lib/python3.6/http/server.py", line 520, in end_headers
    self.flush_headers()
  File "/usr/lib/python3.6/http/server.py", line 524, in flush_headers
    self.wfile.write(b"".join(self._headers_buffer))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe
----------------------------------------
2019-10-06T12:42:12:WARNING:localstack.services.generic_proxy: Connection prematurely closed by client (broken pipe).
----------------------------------------
Exception happened during processing of request from ('172.17.0.1', 47988)
Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 313, in forward
    self.wfile.write(to_bytes(response.content))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/socketserver.py", line 654, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 103, in __init__
    BaseHTTPRequestHandler.__init__(self, request, client_address, server)
  File "/usr/lib/python3.6/socketserver.py", line 724, in __init__
    self.handle()
  File "/usr/lib/python3.6/http/server.py", line 418, in handle
    self.handle_one_request()
  File "/usr/lib/python3.6/http/server.py", line 406, in handle_one_request
    method()
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 128, in do_GET
    self.forward('GET')
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 330, in forward
    self.end_headers()
  File "/usr/lib/python3.6/http/server.py", line 520, in end_headers
    self.flush_headers()
  File "/usr/lib/python3.6/http/server.py", line 524, in flush_headers
    self.wfile.write(b"".join(self._headers_buffer))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe
----------------------------------------
2019-10-06T12:42:12:WARNING:localstack.services.generic_proxy: Connection prematurely closed by client (broken pipe).
----------------------------------------
Exception happened during processing of request from ('172.17.0.1', 48006)
Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 313, in forward
    self.wfile.write(to_bytes(response.content))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/socketserver.py", line 654, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 103, in __init__
    BaseHTTPRequestHandler.__init__(self, request, client_address, server)
  File "/usr/lib/python3.6/socketserver.py", line 724, in __init__
    self.handle()
  File "/usr/lib/python3.6/http/server.py", line 418, in handle
    self.handle_one_request()
  File "/usr/lib/python3.6/http/server.py", line 406, in handle_one_request
    method()
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 128, in do_GET
    self.forward('GET')
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 330, in forward
    self.end_headers()
  File "/usr/lib/python3.6/http/server.py", line 520, in end_headers
    self.flush_headers()
  File "/usr/lib/python3.6/http/server.py", line 524, in flush_headers
    self.wfile.write(b"".join(self._headers_buffer))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe
----------------------------------------
2019-10-06T12:42:12:WARNING:localstack.services.generic_proxy: Connection prematurely closed by client (broken pipe).
----------------------------------------
Exception happened during processing of request from ('172.17.0.1', 47960)
Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 313, in forward
    self.wfile.write(to_bytes(response.content))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/socketserver.py", line 654, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 103, in __init__
    BaseHTTPRequestHandler.__init__(self, request, client_address, server)
  File "/usr/lib/python3.6/socketserver.py", line 724, in __init__
    self.handle()
  File "/usr/lib/python3.6/http/server.py", line 418, in handle
    self.handle_one_request()
  File "/usr/lib/python3.6/http/server.py", line 406, in handle_one_request
    method()
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 128, in do_GET
    self.forward('GET')
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 330, in forward
    self.end_headers()
  File "/usr/lib/python3.6/http/server.py", line 520, in end_headers
    self.flush_headers()
  File "/usr/lib/python3.6/http/server.py", line 524, in flush_headers
    self.wfile.write(b"".join(self._headers_buffer))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe
----------------------------------------
2019-10-06T12:42:12:WARNING:localstack.services.generic_proxy: Connection prematurely closed by client (broken pipe).
----------------------------------------
Exception happened during processing of request from ('172.17.0.1', 48012)
Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 313, in forward
    self.wfile.write(to_bytes(response.content))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/socketserver.py", line 654, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 103, in __init__
    BaseHTTPRequestHandler.__init__(self, request, client_address, server)
  File "/usr/lib/python3.6/socketserver.py", line 724, in __init__
    self.handle()
  File "/usr/lib/python3.6/http/server.py", line 418, in handle
    self.handle_one_request()
  File "/usr/lib/python3.6/http/server.py", line 406, in handle_one_request
    method()
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 128, in do_GET
    self.forward('GET')
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 330, in forward
    self.end_headers()
  File "/usr/lib/python3.6/http/server.py", line 520, in end_headers
    self.flush_headers()
  File "/usr/lib/python3.6/http/server.py", line 524, in flush_headers
    self.wfile.write(b"".join(self._headers_buffer))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe
----------------------------------------
2019-10-06T12:42:12:WARNING:localstack.services.generic_proxy: Connection prematurely closed by client (broken pipe).
----------------------------------------
Exception happened during processing of request from ('172.17.0.1', 47958)
Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 313, in forward
    self.wfile.write(to_bytes(response.content))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/socketserver.py", line 654, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 103, in __init__
    BaseHTTPRequestHandler.__init__(self, request, client_address, server)
  File "/usr/lib/python3.6/socketserver.py", line 724, in __init__
    self.handle()
  File "/usr/lib/python3.6/http/server.py", line 418, in handle
    self.handle_one_request()
  File "/usr/lib/python3.6/http/server.py", line 406, in handle_one_request
    method()
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 128, in do_GET
    self.forward('GET')
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 330, in forward
    self.end_headers()
  File "/usr/lib/python3.6/http/server.py", line 520, in end_headers
    self.flush_headers()
  File "/usr/lib/python3.6/http/server.py", line 524, in flush_headers
    self.wfile.write(b"".join(self._headers_buffer))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe
----------------------------------------
2019-10-06T12:42:12:WARNING:localstack.services.generic_proxy: Connection prematurely closed by client (broken pipe).
----------------------------------------
Exception happened during processing of request from ('172.17.0.1', 48018)
Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 313, in forward
    self.wfile.write(to_bytes(response.content))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/socketserver.py", line 654, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 103, in __init__
    BaseHTTPRequestHandler.__init__(self, request, client_address, server)
  File "/usr/lib/python3.6/socketserver.py", line 724, in __init__
    self.handle()
  File "/usr/lib/python3.6/http/server.py", line 418, in handle
    self.handle_one_request()
  File "/usr/lib/python3.6/http/server.py", line 406, in handle_one_request
    method()
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 128, in do_GET
    self.forward('GET')
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 330, in forward
    self.end_headers()
  File "/usr/lib/python3.6/http/server.py", line 520, in end_headers
    self.flush_headers()
  File "/usr/lib/python3.6/http/server.py", line 524, in flush_headers
    self.wfile.write(b"".join(self._headers_buffer))
  File "/usr/lib/python3.6/socketserver.py", line 803, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe
----------------------------------------
```


Discussion:

Resolving patch:
diff --git a/localstack/services/s3/s3_starter.py b/localstack/services/s3/s3_starter.py
--- a/localstack/services/s3/s3_starter.py
+++ b/localstack/services/s3/s3_starter.py
@@ -14,7 +14,7 @@
 LOGGER = logging.getLogger(__name__)
 
 # max file size for S3 objects (in MB)
-S3_MAX_FILE_SIZE_MB = 128
+S3_MAX_FILE_SIZE_MB = 2048
 
 
 def check_s3(expect_shutdown=False, print_error=False):


Test patch: