gsutil

Your credentials are invalid. Please run $ gcloud auth login

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 05:45:08
问题 gsutil was working as a stand-alone on my system. Then I installed SDK, including some authentication stuff. Now gsutil says my credentials are invalid. $ gcloud auth login wolfvolpi@gmail.com WARNING: `gcloud auth login` no longer writes application default credentials. If you need to use ADC, see: gcloud auth application-default --help You are now logged in as [redacted]. Your current project is [redacted]. You can change this setting by running: $ gcloud config set project PROJECT_ID $

Can't access resource as OWNER despite the fact I'm the owner

大憨熊 提交于 2019-12-24 05:38:33
问题 I'm trying to act on a bucket and resources but I keep getting access denied error e.g. ``` $ gsutil ls -L gs://images/large gs://images/large/aa.png: Creation time: Tue, 25 Nov 2014 20:03:19 GMT Cache-Control: public, max-age=2592000 Content-Length: 343034 Content-Type: image/png Generation: 1416945799570000 Metageneration: 2 ACL: ACCESS DENIED. Note: you need OWNER permission on the object to read its ACL. ``` Same when I try to run acl operations or override a file. 回答1: First of all, I'd

gsutil giving Failure: PKCS12 format is not supported by the PyCrpto library

六眼飞鱼酱① 提交于 2019-12-24 01:08:11
问题 I was trying object storage notification configuration as specified in https://developers.google.com/storage/docs/object-change-notification#_Service_Account I followed the exact steps however on running 'gsutil ls' command I get following error: /usr/local/gsutil/gsutil ls Failure: PKCS12 format is not supported by the PyCrpto library. Try converting to a "PEM" (openssl pkcs12 -in xxxxx.p12 -nodes -nocerts > privatekey.pem) or using PyOpenSSL if native code is an option.. I tried converting

Google Cloud Storage ACL confusion

本秂侑毒 提交于 2019-12-23 07:49:14
问题 I'm the owner of a Google Cloud project, with a Google Cloud Storage bucket inside. All our backups are moved to this bucket. When I try to retrieve some of the backups, I get a permission denied. I'm not able to do anything but to list the bucket. When I try to reset the bucket ACL with gsutil acl ch -u xxx@yyy.zzz:FC gs://abc/** i get the following error. CommandException: Failed to set acl for gs://abc/1234.sql. Please ensure you have OWNER-role access to this resource. Which makes no

gsutil / gcloud storage file listing sorted date descending?

我的梦境 提交于 2019-12-23 07:07:07
问题 Is there no way to get a file listing out from a Google Cloud Storage bucket that is sorted by date descending? This is very frustrating. I need to check the status of files that are uploaded and the bucket has thousands of objects. gsutil ls does not have the standard linux -t option. Google cloud console also lists it but does not offer sorting options. 回答1: I use this as a workaround: gsutil ls -l gs://[bucket-name]/ | sort -k 2 回答2: The only ordering supported by GCS is lexicographic. As

Reading appengine backup_info file gives EOFError

隐身守侯 提交于 2019-12-22 18:28:26
问题 I'm trying to inspect my appengine backup files to work out when a data corruption occured. I used gsutil to locate and download the file: gsutil ls -l gs://my_backup/ > my_backup.txt gsutil cp gs://my_backup/LongAlphaString.Mymodel.backup_info file://1.backup_info I then created a small python program, attempting to read the file and parse it using the appengine libraries. #!/usr/bin/python APPENGINE_PATH='/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default

Keep getting 403 Forbidden from Google API (using PHP client library v1)

久未见 提交于 2019-12-22 14:59:23
问题 Okay... I have to say I don't have enough experience on using Google's API, so I'll try to explain as detail as I could. I need to use PHP to grab the Cloud storage's data, so I tried my credential with gsUtil to grab data from bucket and it works; But when I try to use PHP library to grab data, the API replied me with this content: "error": { "errors": [ { "domain": "global", "reason": "forbidden", "message": "Forbidden" } ], "code": 403, "message": "Forbidden" } Since it didn't tell me

Change storage class of (existing) objects in Google Cloud Storage

谁说胖子不能爱 提交于 2019-12-22 10:53:39
问题 Good day! I recently learnt of the new storage tiers and reduced prices announced on the Google Cloud Storage platform/service. So I wanted to change the default storage class for one of my buckets from Durable Reduced Availability to Coldline, as that is what is appropriate for the files that I'm archiving in that bucket. I got this note though: Changing the default storage class only affects objects you add to this bucket going forward. It does not change the storage class of objects that

gsutil AccessDeniedException: 401 Login Required

痞子三分冷 提交于 2019-12-21 19:55:31
问题 So I run the following: gsutil -m cp -R file.png gs://bucket/file.png And I get the following error message: Copying file://file.png [Content-Type=application/pdf]... Uploading file.png: 42.59 KiB/42.59 KiB AccessDeniedException: 401 Login Required CommandException: 1 files/objects could not be transferred. I'm not sure what the problem is since I ran config and I can see all my buckets. Does anyone know what I need to do? Note: I do not have gcloud , I just installed gsutil and ran the

gsutil cors set command returns 403 AccessDeniedException

只愿长相守 提交于 2019-12-19 19:47:37
问题 I'm following these instructions on how to set a CORS configuration on a Google Cloud Storage bucket and when I run the gsutil cors set command it returns the following error message: AccessDeniedException: 403 The account for bucket "[REDACTED]" has been disabled. For the record, I have access to the bucket. I have owner privileges for this project in the Developer Console. Running gsutil cp and gsutil ls work just fine. Any ideas on what might be wrong here? 回答1: I'm answering my question