You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 31, 2026. It is now read-only.
I am trying to download file content to a file using blob.download_to_file function but it's getting 400 from from GCS APIs while fetching the file content.
File "/Users/PJ/Documents/Workspace/projects/white/box/lib/gcs/storage.py", line 68, in write_to_file
blob.download_to_file(file_obj)
File "/Users/PJ/.local/share/virtualenvs/white-Pt7g6jSz/lib/python3.8/site-packages/google/cloud/storage/blob.py", line 1008, in download_to_file
_raise_from_invalid_response(exc)
File "/Users/PJ/.local/share/virtualenvs/white-Pt7g6jSz/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 GET https://storage.googleapis.com/download/storage/v1/b/spotlight-stag/o/COVReport_Final_20200320-2020-07-29-165239-defd0fdbe121411b8a3a419f87c5594b.pdf?generation=1596041564648328&alt=media: ('Request failed with status code', 400, 'Expected one of', <HTTPStatus.OK: 200>, <HTTPStatus.PARTIAL_CONTENT: 206>)
I am trying to download file content to a file using
blob.download_to_filefunction but it's getting 400 from from GCS APIs while fetching the file content.Environment details
3.820.1.1google-cloud-storageversion:1.3Code example
Stack trace
Thanks!