Issue
I have spring boot application running on app engine standard, I want to enforce https for all urls.
this is my app.yaml
file:
runtime: java11
instance_class: F2
automatic_scaling:
max_instances: 1
env_variables:
SPRING_PROFILES_ACTIVE: "prod"
handlers:
- url: /.*
secure: always
But during deployment I get this error:
2020-01-30T18:40:26.0058599Z [INFO] Detected App Engine app.yaml based application.
2020-01-30T18:40:26.9028317Z Jan 30, 2020 6:40:26 PM com.google.cloud.tools.appengine.operations.GcloudRunner run
2020-01-30T18:40:26.9032622Z INFO: submitting command: /home/runner/.cache/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk/bin/gcloud app deploy --project ***
2020-01-30T18:40:29.4297525Z [INFO] GCLOUD: ERROR: (gcloud.app.deploy) An error occurred while parsing file: [/home/runner/work/czech-***/czech-***/target/appengine-staging/app.yaml]
2020-01-30T18:40:29.4298835Z [INFO] GCLOUD: Unknown url handler type.
2020-01-30T18:40:29.4299464Z [INFO] GCLOUD: <URLMap
2020-01-30T18:40:29.4300033Z [INFO] GCLOUD: secure=always
2020-01-30T18:40:29.4300627Z [INFO] GCLOUD: static_files=None
2020-01-30T18:40:29.4301260Z [INFO] GCLOUD: application_readable=None
2020-01-30T18:40:29.4301875Z [INFO] GCLOUD: auth_fail_action=redirect
2020-01-30T18:40:29.4302497Z [INFO] GCLOUD: require_matching_file=None
2020-01-30T18:40:29.4303102Z [INFO] GCLOUD: static_dir=None
2020-01-30T18:40:29.4303758Z [INFO] GCLOUD: redirect_http_response_code=None
2020-01-30T18:40:29.4304411Z [INFO] GCLOUD: http_headers=None
2020-01-30T18:40:29.4305023Z [INFO] GCLOUD: url=/.*
2020-01-30T18:40:29.4305588Z [INFO] GCLOUD: script=None
2020-01-30T18:40:29.4306345Z [INFO] GCLOUD: upload=None
2020-01-30T18:40:29.4306954Z [INFO] GCLOUD: api_endpoint=None
2020-01-30T18:40:29.4307550Z [INFO] GCLOUD: expiration=None
2020-01-30T18:40:29.4308157Z [INFO] GCLOUD: position=None
2020-01-30T18:40:29.4308745Z [INFO] GCLOUD: login=optional
2020-01-30T18:40:29.4313014Z [INFO] GCLOUD: mime_type=None
2020-01-30T18:40:29.4317758Z [INFO] GCLOUD: >
2020-01-30T18:40:29.4329558Z [INFO] GCLOUD: in "/home/runner/work/czech-***/czech-***/target/appengine-staging/app.yaml", line 13, column 17
2020-01-30T18:40:29.4894919Z [INFO] ------------------------------------------------------------------------
2020-01-30T18:40:29.4896185Z [INFO] BUILD FAILURE
2020-01-30T18:40:29.4897311Z [INFO] ------------------------------------------------------------------------
2020-01-30T18:40:29.4898621Z [INFO] Total time: 24.680 s
2020-01-30T18:40:29.4899728Z [INFO] Finished at: 2020-01-30T18:40:29Z
it says Unknown url handler type. but it seems ok to me
Solution
In the end I used this handler and it now works:
handlers:
- url: .*
secure: always
script: auto
Answered By - estn
Answer Checked By - Mary Flores (JavaFixing Volunteer)