You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ApiError: Insufficient Permission even when the same API wrote the file to Storage #1017
vargcs=GLOBAL.gcloud.storage();varbucket=gcs.bucket(GLOBAL.storage_names.products);varfile=bucket.file('images/'+targetValue+'_'+filename);stdout.pipe(file.createWriteStream()).on('error',function(err){varmsg={"status":"Error""err":err};console.log(msg);}).on('finish',function(){// The file upload is complete.console.log("Successfully uploaded "+targetValue+'_'+filename);file.acl.add({entity: 'allUsers',role: gcs.acl.READER_ROLE},function(err,aclObject){if(err==null){//stream upload filefile.makePublic();}else{console.log("ERROR in ACL Adding");console.log(err)}});file.makePublic(function(err,apiResponse){if(err==null){console.log("File made public");}else{console.log("make public error");console.log(err);}});});
It looks like the only way it's working for me is when I provide a keyFilename path to a service account key file. I was able to reproduce the error when trying to update the ACL as an authenticated user.
@jgeewax is this intentional, or is something off here?
One note though, this error was in the Compute Engine environment and not in the app engine environment and I did not use the keyfilename inside the Compute Engine environment
I did an experiment where I set the bucket allUsers as owner. Used the same program to upload pictures to the bucket and change the permissions through Compute Engine and the same error happened
@ajpyoung can you share with me your compute engine instance's scopes? run gcloud compute instances describe your-instance-name and the scopes should be listed under the serviceAccounts section.
@jonparrott - umm, sorry for asking this but how do I do that? I'm on the Google Cloud dashboard, clicked on Compute Engine and clicked on VM Instance and then New Instance.
Add tags and firewall rules to allow specific network traffic from the Internet
Allow HTTP traffic
Allow HTTPS traffic
Project access
Allow API access to all Google Cloud services in the same project.
@jonparrott - sorry for the delayed response, I've been busy writing technical papers for a Patent for the company I work for. Thank you for your help, I'll execute this process ASAP and reply before the week ends. Again my apologies for my tardiness in replying and thank you for your assistance in this.
No worries. :) I will be on vacation until 2016 so I may not be able to
review your response quickly.
On Thu, Dec 17, 2015, 6:36 PM Andrew John P. Young [email protected]
wrote:
@jonparrotthttps://github.com/jonparrott - sorry for the delayed
response, I've been busy writing technical papers for a Patent for the
company I work for. Thank you for your help, I'll do execute this process
ASAP and reply before the week ends. Again my apologies for my tardiness in
replying and thank you for your assistance in this.
—
Reply to this email directly or view it on GitHub #1017 (comment)
.
Activity
stephenplusplus commentedon Dec 12, 2015
It looks like the only way it's working for me is when I provide a
keyFilenamepath to a service account key file. I was able to reproduce the error when trying to update the ACL as an authenticated user.@jgeewax is this intentional, or is something off here?
ajpyoung commentedon Dec 14, 2015
One note though, this error was in the Compute Engine environment and not in the app engine environment and I did not use the keyfilename inside the Compute Engine environment
ajpyoung commentedon Dec 14, 2015
I did an experiment where I set the bucket allUsers as owner. Used the same program to upload pictures to the bucket and change the permissions through Compute Engine and the same error happened
stephenplusplus commentedon Dec 14, 2015
(Attaching the SO thread: http://stackoverflow.com/questions/34235381/gcloud-apierror-insufficient-permission-even-when-the-same-api-wrote-the-file-t)
@jonparrott - any tips for this one?
theacodes commentedon Dec 14, 2015
@ajpyoung can you share with me your compute engine instance's scopes? run
gcloud compute instances describe your-instance-nameand the scopes should be listed under theserviceAccountssection.ajpyoung commentedon Dec 15, 2015
@stephenplusplus - the link you posted was written by me.
@jonparrott - sure... I hope this is what your looking for
stephenplusplus commentedon Dec 15, 2015
@ajpyoung I know :) It's helpful to link all of the places you post an issue.
theacodes commentedon Dec 15, 2015
@ajpyoung can you try with a new instance that has both
cloud_platformanddevstorage.full_control?ajpyoung commentedon Dec 16, 2015
@jonparrott - umm, sorry for asking this but how do I do that? I'm on the Google Cloud dashboard, clicked on Compute Engine and clicked on VM Instance and then New Instance.
Add tags and firewall rules to allow specific network traffic from the Internet
How do I activate devstorage.full_control?
theacodes commentedon Dec 16, 2015
You don't have to apologize. :)
I seems you can no longer do this easily in the UI, so here's the command line to do it:
ajpyoung commentedon Dec 18, 2015
@jonparrott - sorry for the delayed response, I've been busy writing technical papers for a Patent for the company I work for. Thank you for your help, I'll execute this process ASAP and reply before the week ends. Again my apologies for my tardiness in replying and thank you for your assistance in this.
theacodes commentedon Dec 18, 2015
No worries. :) I will be on vacation until 2016 so I may not be able to
review your response quickly.
On Thu, Dec 17, 2015, 6:36 PM Andrew John P. Young [email protected]
wrote:
stephenplusplus commentedon Jan 9, 2016
@ajpyoung happy new year! 🎉 Just doing a little issue cleaning, are there any updates for how this one is progressing?
chore(deps): update dependency puppeteer to v10 (#1017)
docs(entity): Fix typo in Int class documentation (#1017)
chore: relocate owl bot post processor (#1017)
docs(entity): Fix typo in Int class documentation (#1017)
docs(entity): Fix typo in Int class documentation (#1017)
chore(deps): update dependency sinon to v10 (#1017)
docs(samples): include metadata file, add exclusions for samples to h…
docs(samples): include metadata file, add exclusions for samples to h…
docs(samples): include metadata file, add exclusions for samples to h…
docs(samples): include metadata file, add exclusions for samples to h…