37 votes

Using JSON keys with google cloud gsutil

As of today, gsutil config -e is still in the doc when you do gsutil help config, but does not work. gsutil help creds tells to first do gcloud auth activate-service-account So i did: gcloud auth ...
Alex F's user avatar
  • 858
25 votes

Service account does not have storage.buckets.get access to bucket

GCP has the concept of roles and permissions. A role is something like Storage Admin (roles/storage.admin) and a permission is something like storage.buckets.get. Roles are made up of one or more ...
Garrett's user avatar
  • 1,382
21 votes

Backing up Google Cloud Storage Bucket

There are several options you could consider for this. Firstly, you can create a transfer job using the Storage Transfer Service ( navigate to 'Storage' > 'Transfer'). This can be configured to ...
neilH's user avatar
  • 997
13 votes

Google Cloud : check disk space usage

The workaround with snapshot size will work in the console. For more precise (and quicker) detailed overview you can SSH into your instance and do: sudo df -h The response you get will look ...
Dalibor Tesanovic's user avatar
12 votes
Accepted

Checking file's existence by name in a GCS bucket with Node.js

They added the file.exists() method. const fileExists = _=>{ return file.exists().then((data)=>{ console.log(data[0]); }); } fileExists(); //logs a boolean to the console; //true if the ...
Lex's user avatar
  • 191
12 votes
Accepted

Lost Permissions to Google Cloud Storage Bucket

You can regain access to the object by assigning an appropriate role, such as roles/storage.objectAdmin, to yourself or another member. Go to IAM under IAM & admin session Add members, and ...
Xiaoxia Lin's user avatar
12 votes

getSignedUrl giving "SigningError: Failure from metadata server"

I solved it by adding "Cloud Functions Service Agent" role to my "App Engine default service account" service account. Go to: https://console.cloud.google.com/iam-admin/iam find "Cloud Functions ...
Matjaz Hirsman's user avatar
12 votes

Service account does not have storage.buckets.get access to bucket

To add to the top answer, note that the role roles/storage.legacyBucketReader has the storage.buckets.get permission too. (See https://cloud.google.com/iam/docs/permissions-reference) So to add that ...
JohnFlux's user avatar
  • 221
9 votes
Accepted

Why can't I access a cloud storage object despite being a project owner?

Access to GCS resources is not recursive. Owning a project or a bucket within that project does not necessarily imply that you also have read access to some specific object. Owning the bucket does ...
Brandon Yarbrough's user avatar
8 votes

Google Cloud : check disk space usage

I use a simple workaround for this. Create a snapshot of your persistent disk, and look at the snapshot size:
Dalibor Tesanovic's user avatar
8 votes

GCP: No access to Container Registry from Compute Engine

This command automatically logs the Docker client in GCR: docker-credential-gcr configure-docker
Sony's user avatar
  • 251
6 votes
Accepted

Can I mount Google cloud storage bucket to a pod as a persistent disk. If yes how?

Follow this github link. You need to install fuse in the image. Your container should be in previliged mode and you need to use lifecycle. https://github.com/maciekrb/gcs-fuse-sample
Ram's user avatar
  • 261
6 votes
Accepted

How to handle retention policies in GCP Container Registry

There seems to be currently no way to add retention policies to Container Registry. Deletion of extra images can however be automated by using gcloud. Here's a script I wrote that can be used as a ...
Fleuri's user avatar
  • 255
5 votes
Accepted

Does gcsfuse sync all data to the system it is mounted on?

gcsfuse doesn't download all data in the bucket. It stores the entirety of all files that have been written to but not closed locally. For non-dirtied files, reads are served directly from GCS and don'...
jacobsa's user avatar
  • 459
5 votes
Accepted

Google Cloud : check disk space usage

You can't see it in the disk preview as Faizan said, But you could Use Google StackDriver Monitoring tool to get a nice preview of your instances status.
nelasx's user avatar
  • 161
5 votes
Accepted

Secure static web page hosted on Google Cloud Storage

I understand that you are using a Backend buckets behind a HTTP(S) Load Balancer. At the moment, it is not possible to set permissions or authentication checks at the load balancer level when ...
Lozano's user avatar
  • 143
5 votes
Accepted

gsutil rsync "too many values to unpack" error

As @MBen said, this is a known issue, the last comment states: v4.40 includes the fix for this bug. The standalone install of v4.40 is now available, and we're waiting on a release of gcloud that ...
Mayeru's user avatar
  • 166
4 votes

permission errors using gcsfuse as nonroot user on google compute instance

To create the fstab entry using echdee's example, specify the gcsfuse dir-mode and file-mode attributes with underscores: test_bucket_00 /data/cloud/tb-00 gcsfuse rw,allow_other,file_mode=777,...
Phil Brammer's user avatar
4 votes

Google Cloud Storage mount on windows

You can use Rclone. Rclone is an open-source command-line program to manage files on cloud storage. It use WinFsp to mount remote drive to Windows. Install Rclone and WinFsp. Remember to add Rclone ...
seismonastic's user avatar
4 votes

Copy list of files (-I flag) with gsutil preserving path

Either approach (enumerating the files using find or using a gsutil recursive (**) wildcard) produces a list of path names for the source of the copy, and gsutil will always 'flatten' the paths when ...
Mike Schwartz's user avatar
4 votes

An internal error occurred while creating a Google Cloud Storage bucket

Try by setting this configuration parameter first: gcloud config set app/use_deprecated_preparation True as proposed in Google's Public Issue Tracker If that doesn't work, can you provide the link ...
Tudormi's user avatar
  • 143
4 votes

How to use JSON keys with google cloud gsutil to manage multiple Keys

Approach the solution differently. Instead of trying to use different service accounts, use one service account that has access (privileges) to each project. Create a service account (or use the ...
John Hanley's user avatar
  • 4,924
4 votes

How to get a download URL for files in Google Cloud Storage?

You can get the downloadable link replacing the values of the following string: https://storage.googleapis.com/{bucket.name}/{blob.name} If you need to limit permissions or time to make the request, ...
Jose V's user avatar
  • 153
4 votes
Accepted

Cloud Run service account does not have permission to sign

TL;DR: Make sure the service account has the iam.serviceAccounts.signBlob permission. After further investigating the method I used to acquire credentials on Cloud Run: GoogleCredentials credentials ...
Cas's user avatar
  • 191
3 votes
Accepted

Google cloud storage public object cached on the server side

You are correct. Google Cloud Storage currently ignores anonymous client requests to skip the cache. You can get around this by explicitly setting a different cache-control policy on the object, by ...
Brandon Yarbrough's user avatar
3 votes

Google Cloud Storage mount on windows

There are many 3rd party tools (i.e. [1][2]) that will allow you to mount a bucket and see it as a drive in Windows. Nevertheless, FUSE is only available for Linux. As per the previous comment, if ...
Carlos's user avatar
  • 1,395
3 votes

Why can't I access a cloud storage object despite being a project owner?

You can set Cloud IAM policy to project or bucket. For example, if you are a project owner and you want to full access of all buckets in the project, follow the steps below. Open IAM management ...
tsu1980's user avatar
  • 131
3 votes
Accepted

Using JSON keys with google cloud gsutil

The short version is to run the following command and follow instructions: gsutil config -e The gsutil tool has built-in help which can be consulted for all kinds of options and modes of operation. ...
Nick's user avatar
  • 194
3 votes
Accepted

Advice on choosing Standard or Durable Reduced Availability for file storage Google cloud storage package

I need files to be available for download on demand with minimal delay. Minimal delay is not the important part. Both Standard and Reduced Availability will serve your objects quickly. "Available on ...
Brandon Yarbrough's user avatar
3 votes

How to store wordpress media files in Google Cloud Storage buckets?

You could use the GCSFuse driver (https://cloud.google.com/storage/docs/gcs-fuse) to mount a GCS bucket in your filesystem.
Lennert Kuijpers's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible