-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
Description
Environment details
Issue caused when deployed as cloud function (with google-cloud-storage==1.15.0):
gcloud functions deploy generate_file --runtime python37 --trigger-http
Steps to reproduce
- generate string content
- compress content with brotli
- create new blob
- set blob encoding to
brfor brotli - upload blob via
upload_from_string - download blob via
download_as_string
Code example
Stack trace
textPayload: "Traceback (most recent call last):
File "/env/local/lib/python3.7/site-packages/google/cloud/functions/worker.py", line 346, in run_http_function
result = _function_handler.invoke_user_function(flask.request)
File "/env/local/lib/python3.7/site-packages/google/cloud/functions/worker.py", line 217, in invoke_user_function
return call_user_function(request_or_event)
File "/env/local/lib/python3.7/site-packages/google/cloud/functions/worker.py", line 210, in call_user_function
return self._user_function(request_or_event)
File "/user_code/main.py", line 26, in generate_file
download_content = blob.download_as_string()
File "/env/local/lib/python3.7/site-packages/google/cloud/storage/blob.py", line 697, in download_as_string
self.download_to_file(string_buffer, client=client, start=start, end=end)
File "/env/local/lib/python3.7/site-packages/google/cloud/storage/blob.py", line 636, in download_to_file
self._do_download(transport, file_obj, download_url, headers, start, end)
File "/env/local/lib/python3.7/site-packages/google/cloud/storage/blob.py", line 574, in _do_download
download.consume(transport)
File "/env/local/lib/python3.7/site-packages/google/resumable_media/requests/download.py", line 174, in consume
self._write_to_stream(result)
File "/env/local/lib/python3.7/site-packages/google/resumable_media/requests/download.py", line 137, in _write_to_stream
raise common.DataCorruption(response, msg)
google.resumable_media.common.DataCorruption: Checksum mismatch while downloading:
https://www.googleapis.com/download/storage/v1/b/REDACTED.appspot.com/o/brotli_test%2F2019-08-09.html?generation=1565385647421287&alt=media
The X-Goog-Hash header indicated an MD5 checksum of:
O0XeX+jfZFb9nQYmC6DU2Q==
but the actual MD5 checksum of the downloaded contents was:
qawBTvkgTjJkJklqx11tRw==
"
Metadata
Metadata
Assignees
Labels
api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.