ERROR: (gcloud.beta.functions.deploy) ... message=[The caller does not have permission] : <p>I am trying to deploy code from this repo:</p>

<p><a href="https://github.com/anishkny/puppeteer-on-cloud-functions" rel="noreferrer">https://github.com/anishkny/puppeteer-on-cloud-functions</a></p>

<p>in Google Cloud Build. My cloudbuild.yaml file contents are:</p>

<pre><code>steps:
- name: 'gcr.io/cloud-builders/gcloud'
  args: ['beta', 'functions', 'deploy', 'screenshot', '--trigger-http', '--runtime', 'nodejs8', '--memory', '1024MB']
</code></pre>

<p>I have given the following roles to my Cloud Build Service account (****@cloudbuild.gserviceaccount.com):</p>

<ul>
<li><strong>Cloud Build Service Account</strong></li>
<li><strong>Cloud Functions Developer</strong></li>
</ul>

<p>Yet, in my Cloud Build log I see the following error:</p>

<pre><code>starting build "1f04522c-fe60-4a25-a4a8-d70e496e2821"

FETCHSOURCE
Fetching storage object: gs://628906418368.cloudbuild-source.googleusercontent.com/94762cc396ed1bb46e8c5dbfa3fa42550140c2eb-b3cfa476-cb21-45ba-849c-c28423982a0f.tar.gz#1534532794239047
Copying gs://628906418368.cloudbuild-source.googleusercontent.com/94762cc396ed1bb46e8c5dbfa3fa42550140c2eb-b3cfa476-cb21-45ba-849c-c28423982a0f.tar.gz#1534532794239047...
/ [0 files][    0.0 B/  835.0 B]                                                
/ [1 files][  835.0 B/  835.0 B]                                                
Operation completed over 1 objects/835.0 B.                                      
tar: Substituting `.' for empty member name
BUILD
Already have image (with digest): gcr.io/cloud-builders/gcloud
ERROR: (gcloud.beta.functions.deploy) ResponseError: status=[403], code=[Forbidden], message=[The caller does not have permission]
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/gcloud" failed: exit status 1
</code></pre>

<p>What am I missing?</p>
