I am trying to perform OCR on pdf documents using google cloud vision API, i uploaded a pdf document into a cloud bucket and downloaded the oauth key file and added it in the script as below. But when i run the file, i get the permissiondenined: 403 error, can anyone please give me instructions on how to fix it, i did extensive google search and did not yield any results, i am surely missing something here.
#authenitcation file
os.environ["GOOGLE_APPLICATION_CREDENTIALS"]="mykeylocation/key1.json"
#method being called
operation = client.async_batch_annotate_files(requests=[async_request])
#error message
PermissionDenied: 403 Error opening file: gs://myocrbucket-vamsi/2017 Form 3W-2.pdf.
I have checked the older stack overflow questions and the links provided in answers are not active anymore.
Thanks in advance for your help.
$ gsutil iam get gs://<BUCKET>
. Also you can get the acl permissions for the target object by running$ gsutil acl get gs://<BUCKET>/<OBJECT>
– Federico Panunzio