Search code examples
google-cloud-platformgcloudgoogle-cloud-build

Issue in deploying NodeJs app on Google Cloud Build


I am trying to deploy node.js app on google cloud but getting the following error:

Finished Step #2 - "detector"
Starting Step #3 - "analyzer"
Step #3 - "analyzer": Already have image (with digest): asia.gcr.io/gae-runtimes/buildpacks/nodejs10/builder:nodejs10_20200913_10_22_0_RC00
Step #3 - "analyzer": ERROR: failed to initialize cache: failed to create image cache: accessing cache image "asia.gcr.io/[redacted]/app-engine-tmp/build-cache/ttl-7d/default/buildpack-cache:latest": connect to repo store 'asia.gcr.io/[redacted]/app-engine-tmp/build-cache/ttl-7d/default/buildpack-cache:latest': GET https://asia.gcr.io/v2/[redacted]/app-engine-tmp/build-cache/ttl-7d/default/buildpack-cache/manifests/latest: DENIED: Permission denied for "latest" from request "/v2/[redacted]/app-engine-tmp/build-cache/ttl-7d/default/buildpack-cache/manifests/latest". 
Finished Step #3 - "analyzer"
ERROR
ERROR: build step 3 "asia.gcr.io/gae-runtimes/buildpacks/nodejs10/builder:nodejs10_20200913_10_22_0_RC00" failed: step exited with non-zero status: 1

Originally I was facing the issue mentioned in this thread: Facing error while deploying node.js app on google cloud

Then, after using the solution, I am facing this new error.

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'

Solution

  • Searching for the error message, the most common cause for such errors is billing issues. Please make sure that billing is enabled and there are no issues with previous payments.

    If this doesn't solve the issue, please follow Google's documentation on how to troubleshoot common Container Registry and Docker issues.

    Let me know how this works for you.