Unrecognized or unpermitted key(s) in configuration "beta_settings"

Viewed 453

I deployed a Laravel application to Google App Engine(Flexible environment) and get errors.

Beginning deployment of service [default]...
#============================================================#
#= Uploading 4 files to Google Cloud Storage                =#
#============================================================#
File upload done.
ERROR: (gcloud.beta.app.deploy) INVALID_ARGUMENT: Unrecognized or unpermitted key(s) in configuration "beta_settings"
- '@type': type.googleapis.com/google.rpc.BadRequest
  fieldViolations:
  - description: Unrecognized beta_setting key
    field: no-cache

I wrote app.yaml with reference to this document

runtime: php
env: flex

runtime_config:
  document_root: public

beta_settings:
  cloud_sql_instances: "YOUR_CLOUDSQL_CONNECTION_NAME"

resources:
  cpu: 1
  memory_gb: 0.5

env_variables:
  APP_LOG: errorlog
  # etc.

Why is it unrecognized or unpermitted, "beta_settings" ?

3 Answers

The error message mentions the no-cache field, which is sometimes supplied as a CLI flag to the gcloud app deploy command.

gcloud app deploy app.yaml --no-cache

From what I understand about the difference between GAE Standard and Flex, it is only available on the App Engine's Standard environment. It is likely that the flag is implicitly passed to the instance's config under the beta_settings section by the CLI tool.

I would assume that you've used this flag while debugging the Standard environment app before switching to Flex, or simply picked it up from the documentation. In that case, simply removing the flag from the CLI command should resolve your issue.

[RESOLVED] I use command gcloud app deploy instead of gcloud beta app deploy.

Make sure that your Cloud SQL connection name under beta_settings does not have any reference to TCP since it should be in the format provided at the bottom of the Tutorial:"project:region:cloudsql-instance"

You are able to copy this string directly from your Cloud SQL instance’s dashboard to avoid any errors.

Related