Reputation: 1363
I am trying to use gsutil to set CORS on my firebase storage bucket according to googles instructions using the newest version of MacOS. I am not sure if I havn't installed gsutil correctly or if the is something else I don't understand, but when I run gsutil cors set cors.json gs://docavea2.appspot.com
I get the following error:
Setting CORS on gs://docavea2.appspot.com/...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/jr/google-cloud-sdk/platform/gsutil/gslib/__init__.py", line 119, in <module>
CHECKSUM_FILE, CHECKSUM = _GetFileContents('CHECKSUM')
File "/Users/jr/google-cloud-sdk/platform/gsutil/gslib/__init__.py", line 107, in _GetFileContents
content = pkgutil.get_data('gslib', filename)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pkgutil.py", line 591, in get_data
return loader.get_data(resource_name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pkgutil.py", line 255, in get_data
return open(pathname, "rb").read()
IOError: [Errno 2] No such file or directory: '/Users/jr/google-cloud-sdk/platform/gsutil/gslib/CHECKSUM'
I think my cors.json is fine, because when I use it with gsutil on Windows it works fine and CORS is set correctly, but this is the content:
[
{
"origin": ["*"],
"method": ["GET"],
"maxAgeSeconds": 3600
}
]
I have seen here on stackoverflow that somebody said that it worked for him if he put [{ on the same line, but it makes no difference for me.
Upvotes: 1
Views: 1486
Reputation: 3313
What worked for me was re-installing google-cloud-sdk into my home directory (Users/sam/google-cloud-sdk). It was in the downloads folder.
Upvotes: 2
Reputation: 1363
I found out CHECKSUM is installed in /Users/jr/google-cloud-sdk/platform/gsutil.
After I copy it to /Users/jr/google-cloud-sdk/platform/gsutil/gslib/ it works.
Upvotes: 8