While S3 was down, we failed a bunch of requests because we try to read the tile from S3 as a short-cut before querying it from the database. Unfortunately, there are many things that can go wrong with fetching a tile over the network.
I've grabbed a selection of errors from the logs at the bottom of this issue.
The request could have been served by querying the database, but these exceptions thrown mean we return 500 errors instead. Throwing exceptions seems appropriate for tilequeue, where we want to make sure that the job isn't marked complete unless the tile is stored safely. For tileserver, where there's a client waiting on the other end of a connection, perhaps we want to catch and log the exceptions and then continue as if the tile were missing?
After the tile has been rendered, we store it. It looks like if that raises an exception then we just log it and move on rather than stopping, since it happens on a background thread.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/tileserver/__init__.py", line 204, in __call__ response = self.handle_request(request)
File "/usr/local/lib/python2.7/dist-packages/tileserver/__init__.py", line 249, in handle_request tile_data = self.reformat_from_stored_json(request_data, layer_data)
File "/usr/local/lib/python2.7/dist-packages/tileserver/__init__.py", line 331, in reformat_from_stored_json tile_data = self.read_tile(coord)
File "/usr/local/lib/python2.7/dist-packages/tileserver/__init__.py", line 389, in read_tile raw_data = self.store.read_tile(coord, fmt, 'all')
File "/usr/local/lib/python2.7/dist-packages/tilequeue/store.py", line 60, in read_tile key = self.bucket.get_key(key_name)
File "/usr/local/lib/python2.7/dist-packages/boto/s3/bucket.py", line 192, in get_key key, resp = self._get_key_internal(key_name, headers, query_args_l)
File "/usr/local/lib/python2.7/dist-packages/boto/s3/bucket.py", line 199, in _get_key_internal query_args=query_args)
File "/usr/local/lib/python2.7/dist-packages/boto/s3/connection.py", line 664, in make_request retry_handler=retry_handler
File "/usr/local/lib/python2.7/dist-packages/boto/connection.py", line 1068, in make_request retry_handler=retry_handler)
File "/usr/local/lib/python2.7/dist-packages/boto/connection.py", line 942, in _mexe request.body, request.headers)
File "/usr/lib/python2.7/httplib.py", line 1017, in request self._send_request(method, url, body, headers)
File "/usr/lib/python2.7/httplib.py", line 1051, in _send_request self.endheaders(body)
File "/usr/lib/python2.7/httplib.py", line 1013, in endheaders self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 864, in _send_output self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 826, in send self.connect()
File "/usr/lib/python2.7/httplib.py", line 1216, in connect self.timeout, self.source_address)
File "/usr/lib/python2.7/socket.py", line 571, in create_connection raise err
timeout: timed out
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/tileserver/__init__.py", line 204, in __call__ response = self.handle_request(request)
File "/usr/local/lib/python2.7/dist-packages/tileserver/__init__.py", line 249, in handle_request tile_data = self.reformat_from_stored_json(request_data, layer_data)
File "/usr/local/lib/python2.7/dist-packages/tileserver/__init__.py", line 331, in reformat_from_stored_json tile_data = self.read_tile(coord)
File "/usr/local/lib/python2.7/dist-packages/tileserver/__init__.py", line 389, in read_tile raw_data = self.store.read_tile(coord, fmt, 'all')
File "/usr/local/lib/python2.7/dist-packages/tilequeue/store.py", line 60, in read_tile key = self.bucket.get_key(key_name)
File "/usr/local/lib/python2.7/dist-packages/boto/s3/bucket.py", line 192, in get_key key, resp = self._get_key_internal(key_name, headers, query_args_l)
File "/usr/local/lib/python2.7/dist-packages/boto/s3/bucket.py", line 199, in _get_key_internal query_args=query_args)
File "/usr/local/lib/python2.7/dist-packages/boto/s3/connection.py", line 664, in make_request retry_handler=retry_handler
File "/usr/local/lib/python2.7/dist-packages/boto/connection.py", line 1068, in make_request retry_handler=retry_handler)
File "/usr/local/lib/python2.7/dist-packages/boto/connection.py", line 1025, in _mexe raise BotoServerError(response.status, response.reason, body)
BotoServerError: BotoServerError: 500 Internal Server Error
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/tileserver/__init__.py", line 204, in __call__ response = self.handle_request(request)
File "/usr/local/lib/python2.7/dist-packages/tileserver/__init__.py", line 249, in handle_request tile_data = self.reformat_from_stored_json(request_data, layer_data)
File "/usr/local/lib/python2.7/dist-packages/tileserver/__init__.py", line 331, in reformat_from_stored_json tile_data = self.read_tile(coord)
File "/usr/local/lib/python2.7/dist-packages/tileserver/__init__.py", line 389, in read_tile raw_data = self.store.read_tile(coord, fmt, 'all')
File "/usr/local/lib/python2.7/dist-packages/tilequeue/store.py", line 60, in read_tile key = self.bucket.get_key(key_name)
File "/usr/local/lib/python2.7/dist-packages/boto/s3/bucket.py", line 192, in get_key key, resp = self._get_key_internal(key_name, headers, query_args_l)
File "/usr/local/lib/python2.7/dist-packages/boto/s3/bucket.py", line 199, in _get_key_internal query_args=query_args)
File "/usr/local/lib/python2.7/dist-packages/boto/s3/connection.py", line 664, in make_request retry_handler=retry_handler
File "/usr/local/lib/python2.7/dist-packages/boto/connection.py", line 1068, in make_request retry_handler=retry_handler)
File "/usr/local/lib/python2.7/dist-packages/boto/connection.py", line 1025, in _mexe raise BotoServerError(response.status, response.reason, body)
BotoServerError: BotoServerError: 503 Service Unavailable