Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Cloud Storage - PUT Fails on Development Server

On my dev server, Google Cloud Storage fails to save files during a PUT command.

This same command works fine on production. The response headers (see below) have little debug information. I have plenty of space on my hard-drive, and I have been running the dev server as an administrator, so it should have all necessary permissions.

Any ideas?

Below is the relevant Traceback (I changed the bucket name):

INFO     2015-08-07 14:14:41,415 module.py:809] default: "PUT /_ah/gcs/bucket/IPR2013-00219%2C%20No.%2016%20Institution%20Decision%20-%20Decis_2015-08-07%2018-14-25.100000.pdf?upload_id=encoded_gs_file%3AZG9ja2V0YWxhcm0tZGV2L0lQUjIwMTMtMDAyMTksIE5vLiAxNiBJbnN0aXR1dGlvbiBEZWNpc2lvbiAtIERlY2lzXzIwMTUtMDgtMDcgMTgtMTQtMjUuMTAwMDAwLnBkZg%3D%3D HTTP/1.1" 500 -
Traceback (most recent call last):
  File "Project\libs\cloudstorage\storage_api.py", line 794, in __exit__
    self.close()
  File "Project\libs\cloudstorage\storage_api.py", line 787, in close
    self._flush(finish=True)
  File "Project\libs\cloudstorage\storage_api.py", line 841, in _flush
    self._send_data(data, self._written, file_len)
  File "Project\libs\cloudstorage\storage_api.py", line 874, in _send_data
    {'upload_path': self._path_with_token})
  File "Project\libs\cloudstorage\errors.py", line 141, in check_status
    raise ServerError(msg)
ServerError: Expect status [200] from Google Storage. But got status 500.
Path: '/bucket/IPR2013-00219%2C%20No.%2016%20Institution%20Decision%20-%20Decis_2015-08-07%2018-14-25.100000.pdf'.
Request headers: {'accept-encoding': 'gzip, *', 'content-range': 'bytes 0-195060/195061', 'x-goog-api-version': '2'}.
Response headers: {'date': 'Fri, 07 Aug 2015 18:14:41 GMT', 'transfer-encoding': 'chunked', 'server': 'Development/2.0'}.
Body: ''.
Extra info: {'upload_path': '/bucket/IPR2013-00219%2C%20No.%2016%20Institution%20Decision%20-%20Decis_2015-08-07%2018-14-25.100000.pdf?upload_id=encoded_gs_file%3AZG9ja2V0YWxhcm0tZGV2L0lQUjIw
MTMtMDAyMTksIE5vLiAxNiBJbnN0aXR1dGlvbiBEZWNpc2lvbiAtIERlY2lzXzIwMTUtMDgtMDcgMTgtMTQtMjUuMTAwMDAwLnBkZg%3D%3D'}.

Update 2020 FYI, I raised this issue with Google here, and they said that they won't fix it because it has already been fixed, even though it clearly has not.

Update 2022 Still broken! See the proposed patch in the issue with Google.

like image 232
speedplane Avatar asked Sep 12 '25 11:09

speedplane


1 Answers

Make sure that you have the correct permissions to access the bucket. You can check this by running the following command:

gsutil ls -l gs://bucket/

If you do not have the correct permissions, you will need to contact your Google Cloud Storage administrator to grant you the necessary permissions.

Also, make sure that the bucket exists. You can check this by running the following command:

gsutil ls gs://bucket/

Make sure that you are using the correct API version. The API version that you are using may not be supported on your dev server.

like image 129
Syed Shafiyullah Avatar answered Sep 14 '25 02:09

Syed Shafiyullah