Can't copy files with permissions

16 views
Skip to first unread message

Artyom Bolshakov

unread,
May 24, 2012, 9:00:59 AM5/24/12
to gs-dis...@googlegroups.com
I tried to copy files from one backed to another:

> $ gsutil -m cp -R -p gs://production/* gs://production.example.com/
Copying gs://
production/sitemap/sitemap1.xml...
Copying gs://
production/sitemap/sitemap_index.xml...
Copying gs://
production/uploads/login_photo/image/1/c0b0bbb9a1def69cb16a55e346d7c603.jpg...
Copying gs://
production/uploads/login_photo/image/1/icon_c0b0bbb9a1def69cb16a55e346d7c603.jpg...
GSResponseError: 403 Forbidden
<?xml version='1.0' encoding='UTF-8'?><Error><Code>AccessDenied</Code><Message>Access denied.</Message></Error>
Copying gs://
production/uploads/login_photo/image/104/d3bfc6f56cf0919f419eb60001abeda5.jpg...

I tried to copy files as owner of google storage but have no permissions to do that. Why? 
What the right way to copy files with permissions?

Mike Schwartz (Google Storage Team)

unread,
May 24, 2012, 2:43:13 PM5/24/12
to gs-dis...@googlegroups.com
Hi Artyom,

From the output you included I see that the first 3 objects were successfully copied and then you got the 403 error while trying to copy the fourth object. It sounds like you may not have read access to this fourth object. That might happen, for example, if two different projects copied files into that bucket, without specifying any ACLs, which by default would mean the object was ACL'd project-private to that second project.

If that's what happened here, you will need to add your identity as one of the project members allowed to read the object (or you could just re-upload to that object, with an ACL permitting you read access). You might also consider setting a default object ACL on the bucket, that allows each of the projects to read the objects in that bucket.

Mike


--
You received this message because you are subscribed to the Google Groups "Google Cloud Storage" group.
To view this discussion on the web visit https://groups.google.com/d/msg/gs-discussion/-/MsEWO84ZxZIJ.
To post to this group, send email to gs-dis...@googlegroups.com.
To unsubscribe from this group, send email to gs-discussio...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gs-discussion?hl=en.

Reply all
Reply to author
Forward
0 new messages