From 03a041b96e20c3c7ff53e2b03f2219b6982de4ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 21 Jul 2016 15:42:39 +0200 Subject: [PATCH] Some logging to try and track down upload problem. --- pillar/application/modules/file_storage.py | 5 +++++ 1 file changed, 5 insertions(+) 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,