I have recently gotten into GCP, and am now trying to deploy an angular frontend with a python backend, same AppEngine application but different services. The problem is that when I run gcloud app deploy dispatch.yaml
I get
Updating config [dispatch]...failed.
ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: The request contained an invalid argument.
- '@type': type.googleapis.com/google.rpc.BadRequest
fieldViolations:
- description: Service 'server' does not exist.
field: dispatch_rules
Seems like it should be an easy fix, as I can't find any resources about it, but I just don't see it
Folder structure
-- appname/
---- display.yaml
---- client/
------ app.yaml (default - this one works)
------ dist/
---- server/
------ app.yaml (the troublemaker)
------ appname_backend/
app.yaml (the working one):
runtime: nodejs16
instance_class: F2
env_variables:
BUCKET_NAME: "appname-bucket"
handlers:
- url: /
static_files: dist/index.html
upload: dist/index.html
- url: /
static_dir: dist
app.yaml (the one it can't find):
runtime: python310
env_variables:
BUCKET_NAME: 'appname-bucket-backend'
service: server
dispatch:
dispatch:
- url: "*/favicon.ico"
service: default
- url: "*/api/*"
service: server
Documentation I have read
https://cloud.google.com/appengine/docs/standard/configuration-files https://cloud.google.com/appengine/docs/legacy/standard/python/reference/dispatch-yaml https://cloud.google.com/appengine/docs/legacy/standard/python/how-requests-are-routed https://cloud.google.com/appengine/docs/standard/communicating-between-services https://cloud.google.com/appengine/docs/standard/reference/app-yaml?tab=python
(and lots more, but these felt the most relevant)
Google reference project on Github https://github.com/GoogleCloudPlatform/issuetracker/tree/c783a93af2c9214c13b3777a4b2da366ce65f248/services