Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple upload and downloads fail #237

Closed
AndrewAXue opened this issue Aug 10, 2020 · 0 comments · Fixed by #238
Closed

Multiple upload and downloads fail #237

AndrewAXue opened this issue Aug 10, 2020 · 0 comments · Fixed by #238
Assignees
Labels
api: storage Issues related to the googleapis/python-storage API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@AndrewAXue
Copy link

Environment details

  • OS type and version: Linux rodete
  • Python version: Python 3.8.5
  • pip version: pip 20.0.2
  • google-cloud-storage version: 1.30.0

Steps to reproduce

Run:

from google.cloud import storage
client = storage.Client()
bucket = client.get_bucket('fishbucket1')
blob2 = bucket.blob('file')
blob2.upload_from_string('hi')
blob2.download_as_string()
blob2.upload_from_string('hi')

Stack trace

Traceback (most recent call last):
  File "/usr/local/google/home/aaxue/Documents/google/temp/lib/python3.8/site-packages/google/cloud/storage/blob.py", line 1910, in upload_from_file
    created_json = self._do_upload(
  File "/usr/local/google/home/aaxue/Documents/google/temp/lib/python3.8/site-packages/google/cloud/storage/blob.py", line 1758, in _do_upload
    response = self._do_multipart_upload(
  File "/usr/local/google/home/aaxue/Documents/google/temp/lib/python3.8/site-packages/google/cloud/storage/blob.py", line 1404, in _do_multipart_upload
    response = upload.transmit(
  File "/usr/local/google/home/aaxue/Documents/google/temp/lib/python3.8/site-packages/google/resumable_media/requests/upload.py", line 148, in transmit
    self._process_response(response)
  File "/usr/local/google/home/aaxue/Documents/google/temp/lib/python3.8/site-packages/google/resumable_media/_upload.py", line 116, in _process_response
    _helpers.require_status_code(response, (http_client.OK,), self._get_status_code)
  File "/usr/local/google/home/aaxue/Documents/google/temp/lib/python3.8/site-packages/google/resumable_media/_helpers.py", line 106, in require_status_code
    raise common.InvalidResponse(
google.resumable_media.common.InvalidResponse: ('Request failed with status code', 400, 'Expected one of', <HTTPStatus.OK: 200>)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "t", line 7, in <module>
    blob2.upload_from_string('hi')
  File "/usr/local/google/home/aaxue/Documents/google/temp/lib/python3.8/site-packages/google/cloud/storage/blob.py", line 2097, in upload_from_string
    self.upload_from_file(
  File "/usr/local/google/home/aaxue/Documents/google/temp/lib/python3.8/site-packages/google/cloud/storage/blob.py", line 1925, in upload_from_file
    _raise_from_invalid_response(exc)
  File "/usr/local/google/home/aaxue/Documents/google/temp/lib/python3.8/site-packages/google/cloud/storage/blob.py", line 3262, in _raise_from_invalid_response
    raise exceptions.from_http_status(response.status_code, message, response=response)
google.api_core.exceptions.BadRequest: 400 POST https://storage.googleapis.com/upload/storage/v1/b/fishbucket1/o?uploadType=multipart: ('Request failed with status code', 400, 'Expected one of', <HTTPStatus.OK: 200>)
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/python-storage API. label Aug 10, 2020
@HemangChothani HemangChothani added priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Aug 11, 2020
@HemangChothani HemangChothani self-assigned this Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/python-storage API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants