Terraform google flexible appengine creation timesout with app developed in flask_sockets and blueprint

I am trying to create a flexible appengine with persistent connections (websockets).
I see that the appengine does not get created.
This issue is seen only when application is implemented in flask_socket and blueprint. I dont see this issue if the application is implemented with just flask_socket without blueprints.

It is stuck at the below line.
Increasing create/delete/update timeouts did not help.

module.abc.google_app_engine_flexible_app_version.abc: Still creating… [9m20s elapsed]
module.abc.google_app_engine_flexible_app_version.abc: Still creating… [9m30s elapsed]
module.abc.google_app_engine_flexible_app_version.abc: Still creating… [9m40s elapsed]

Looking at the logs, i see some issues with the readiness_check and liveliness_check

Warning 2021-04-19 13:17:53.854 PDT GET 502 150 B 0 ms GoogleHC 1.0 /liveness_check failReason:“null”
Warning 2021-04-19 13:17:54.270 PDT GET 503 14 B 0 ms GoogleHC 1.0 /readiness_check failReason:“null”
Warning 2021-04-19 13:18:53.661 PDT GET 404 232 B 2 ms GoogleHC 1.0 /liveness_check failReason:“null”
Warning 2021-04-19 13:18:54.285 PDT GET 404 232 B 2 ms GoogleHC 1.0 /readiness_check failReason:“null”

Terraform version:
Terraform v0.14.10

Your version of Terraform is out of date! The latest version
is 0.15.0. You can update by downloading from Download Terraform - Terraform by HashiCorp

Terraform config:

resource “google_app_engine_flexible_app_version” “abc” {
version_id = “v1”
service = “abc”
runtime = “python”

entrypoint {
shell = “gunicorn -b :$PORT -k flask_sockets.worker main:app”
}
network {
name = var.abc_network_name
}
vpc_access_connector {
name = var.abc_connector_name
}
handlers {
url_regex = “/.*”
script {
script_path = “auto”
}
}

deployment {
zip {
source_url = “https://storage.googleapis.com/{var.source_bkt}/{google_storage_bucket_object.abc.name}
}

cloud_build_options {
  app_yaml_path = "abc_app.yaml"
}

}

liveness_check {
path = “/liveness_check”
check_interval = “30s”
timeout = “4s”
failure_threshold = 2
success_threshold = 2
}

readiness_check {
path = “/readiness_check”
app_start_timeout = “1800s”
check_interval = “5s”
timeout = “4s”
failure_threshold = 2
success_threshold = 2
}

timeouts {
create = “30m”
update = “30m”
delete = “30m”
}

delete_service_on_destroy = true
noop_on_destroy = true
}

Please help.

Hello, did you solve this problem? I have the same problem.

The below configuration for liveness and readiness resolved my issue:

liveness_check {
path = “”
}

readiness_check {
path = “”
}

1 Like