i have a Problem during deploying an App Engine app with Cloud Build and VPC connector to my MongodDB Atlas Database.
When i deploy it with gcloud, it works perfectly with this command: gcloud beta app deploy
But i want CI (Continuous integration) to be implemented with Cloud Build. During the Cloud build following error appears:
Step #3: #============================================================#
Step #3: #= Uploading 2 files to Google Cloud Storage =#
Step #3: #============================================================#
Step #3: File upload done.
Step #3: Updating service [nodeapi]...
Step #3: .......................................................................................................................................................................................failed.
Step #3: ERROR: (gcloud.beta.app.deploy) Error Response: [7] Error attaching GCE network to app.
Step #3:
Step #3: Details: [
Step #3: [
Step #3: {
Step #3: "@type": "type.googleapis.com/google.rpc.ResourceInfo",
Step #3: "resourceName": "projects/visifingc/global/networks/default",
Step #3: "resourceType": "Network"
Step #3: }
Step #3: ]
Step #3: ]
Step #3:
Finished Step #3
ERROR
ERROR: build step 3 "gcr.io/cloud-builders/gcloud" failed: exit status 1
My app.yaml file:
runtime: nodejs10
service: nodeapi
vpc_access_connector:
name: "projects/visifingc/locations/europe-west1/connectors/app-engine"
network:
name: default
And cloudbuild.yaml:
steps:
- name: node:10.15.1
entrypoint: npm
args: ["install"]
- name: node:10.15.1
entrypoint: npm
args: ["run", "build"]
- name: "gcr.io/cloud-builders/gcloud"
args: ["beta","app","deploy"]
When a I look in App Engine to the configuration of Instance which was deployed (but with the error, therefore not really deployed) following App Engine Instance Configuration can be seen:
runtime: nodejs10
env: standard
instance_class: F1
handlers:
- url: .*
script: auto
automatic_scaling:
min_idle_instances: automatic
max_idle_instances: automatic
min_pending_latency: automatic
max_pending_latency: automatic
network: {}
As you can see, something is wrong with the network because it is empty.
Could you help me please to find a solution? I thought it could be a rights problems, therefore i tried to give to all the accounts access rights to VPC, but id didn't helped. Mostly i am following the defined setup with VPC network which is described here: https://cloud.google.com/appengine/docs/standard/nodejs/connecting-vpc