GreenLantern22
GreenLantern22

Reputation: 487

gsutil cp errors with Permission denied

I just want to share this since it took me a while to figure it out and couldn't find anything on the web. I was running this command on a CMD prompt on my Windows computer:

gsutil cp gs://my_bucket/myfile.txt .

to transfer myfile.txt from Google Cloud Storage to my current directory but the command resulted in the following error:

IOError: [Errno 13] Permission denied

I checked all other SO posts and nothing seems to solve the issue. The user has permissions on the project (it's actually a project owner), it's authenticated via Google Cloud SDK and can read the file. I even tried making the file public in the bucket but got the same error. The user has has write permissions on the directory where it wants to write. In fact other files on the same bucket can be copied using the same command, but not this file. What is the problem?

Upvotes: 3

Views: 3792

Answers (1)

GreenLantern22
GreenLantern22

Reputation: 487

The problem was lack of disk space on the current directory. It seems the Google Cloud SDK tries to reserve the space before writing the file. myfile.txt was 12 GB but there was only 5 GB left of disk space, so gsutil refused to attempt to copy the file with a very misleading error!

Upvotes: 4

Related Questions