Some logging to try and track down upload problem.

This commit is contained in:
Sybren A. Stüvel 2016-07-21 15:42:39 +02:00
parent cd967749de
commit 03a041b96e

View File

@ -564,6 +564,8 @@ def stream_to_gcs(project_id):
log.info('Streaming file to bucket for project=%s user_id=%s', project_id, log.info('Streaming file to bucket for project=%s user_id=%s', project_id,
authentication.current_user_id()) authentication.current_user_id())
log.info('request.headers[Origin] = %r', request.headers.get('Origin'))
uploaded_file = request.files['file'] uploaded_file = request.files['file']
# Not every upload has a Content-Length header. If it was passed, we might as # Not every upload has a Content-Length header. If it was passed, we might as
@ -625,6 +627,9 @@ def stream_to_gcs(project_id):
update_file_doc(file_id, status='failed') update_file_doc(file_id, status='failed')
raise wz_exceptions.InternalServerError('Unable to stream file to Google Cloud Storage') raise wz_exceptions.InternalServerError('Unable to stream file to Google Cloud Storage')
if stream_for_gcs.closed:
log.error('Eek, GCS closed its stream, Andy is not going to like this.')
# Reload the blob to get the file size according to Google. # Reload the blob to get the file size according to Google.
blob.reload() blob.reload()
update_file_doc(file_id, update_file_doc(file_id,