diff --git a/pillar/application/modules/file_storage.py b/pillar/application/modules/file_storage.py index 08b37ba9..3794a04a 100644 --- a/pillar/application/modules/file_storage.py +++ b/pillar/application/modules/file_storage.py @@ -564,6 +564,8 @@ def stream_to_gcs(project_id): log.info('Streaming file to bucket for project=%s user_id=%s', project_id, authentication.current_user_id()) + log.info('request.headers[Origin] = %r', request.headers.get('Origin')) + uploaded_file = request.files['file'] # 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') 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. blob.reload() update_file_doc(file_id,