在Google Cloud上部署Node.js应用时遇到错误 [英] Facing error while deploying node.js app on google cloud

查看:73
本文介绍了在Google Cloud上部署Node.js应用时遇到错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Google云上部署 node.js 应用,但出现以下错误.自10月10日以来,我一直面临着这个错误.不知道如何解决:

I am trying to deploy node.js app on google cloud but getting following error. I am facing this error since 10th October. don't know how to resolve:

Step #2: ERROR: (gcloud.beta.app.deploy) PERMISSION_DENIED: You do not have permission to act as '[xxxxxxx]@appspot.gserviceaccount.com'
Step #2: - '@type': type.googleapis.com/google.rpc.ResourceInfo
Step #2:   description: You do not have permission to act as this service account.
Step #2:   resourceName: [xxxxxx]@appspot.gserviceaccount.com
Step #2:   resourceType: serviceAccount
Finished Step #2
ERROR
ERROR: build step 2 "gcr.io/cloud-builders/gcloud" failed: step exited with non-zero status: 1

CloudBuild.yaml :

steps:

- name: node:10.15.1
  entrypoint: npm
  args: ['install']

- name: node:10.15.1
  entrypoint: npm
  args: [ 'run', 'build', '--prod --verbose']

- name: 'gcr.io/cloud-builders/gcloud'
  args: ['beta', 'app', 'deploy', '--version=prod', '--no-cache']


timeout: '4800s'

推荐答案

我相信您应该向我的CI/CD服务帐户授予服务帐户用户权限.

I believe you should grant the Service Account User permission to my CI/CD service account.

您可以使用控制台UI或gcloud命令:

You can use the console UI or gcloud command:

授予,更改和撤消对资源的访问权限

gcloud iam service-accounts add-iam-policy-binding \
    ${PROJECT_ID}@appspot.gserviceaccount.com \
    --member=serviceAccount:${PROJECT_NUMBER}@cloudbuild.gserviceaccount.com \
    --role=roles/iam.serviceAccountUser \
    --project=${PROJECT_ID}

这篇关于在Google Cloud上部署Node.js应用时遇到错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆