0

I have successfully deployed a spring boot application deployed in google cloud app engine flex environment on May 20, 2025. I tried to deploy same version of the application without any success on May 21, 2025. Following are the logs

Updating service [my-agent] (this may take several minutes)...⠹DEBUG: Operation [apps/my-proj-prod/operations/f1b60017-ba71-4988-8854-2b2222ec6dee] complete. Result: {                           
    "done": true,
    "error": {
        "code": 4,
        "message": "An internal error occurred while processing task /app-engine-flex/flex_await_healthy/flex_await_healthy>2025-05-22T05:55:45.336Z148159.jc.0: Timed out waiting for the app infrastructure to become healthy."
    },
    "metadata": {
        "@type": "type.googleapis.com/google.appengine.v1.OperationMetadataV1",
        "createVersionMetadata": {
            "cloudBuildId": "52c676c3-4319-4a6f-9eed-84fb44737a31"
        },
        "insertTime": "2025-05-22T05:50:43.734Z",
        "method": "google.appengine.v1.Versions.CreateVersion",
        "target": "apps/my-proj-prod/services/my-agent/versions/20250521t235039",
        "user": "[email protected]"
    },
    "name": "apps/my-proj-prod/operations/f1b60017-ba71-4988-8854-2b2222ec6dee"
}
Updating service [my-agent] (this may take several minutes)...failed.                                                                                                                                 
DEBUG: (gcloud.app.deploy) Error Response: [4] An internal error occurred while processing task /app-engine-flex/flex_await_healthy/flex_await_healthy>2025-05-22T05:55:45.336Z148159.jc.0: Timed out waiting for the app infrastructure to become healthy.
Traceback (most recent call last):
  File "/home/user-1/tools/google-cloud-sdk-352.0.0-linux-x86_64/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 987, in Execute
    resources = calliope_command.Run(cli=self, args=args)
  File "/home/user-1/tools/google-cloud-sdk-352.0.0-linux-x86_64/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 809, in Run
    resources = command_instance.Run(args)
  File "/home/user-1/tools/google-cloud-sdk-352.0.0-linux-x86_64/google-cloud-sdk/lib/surface/app/deploy.py", line 127, in Run
    return deploy_util.RunDeploy(
  File "/home/user-1/tools/google-cloud-sdk-352.0.0-linux-x86_64/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/deploy_util.py", line 692, in RunDeploy
    deployer.Deploy(
  File "/home/user-1/tools/google-cloud-sdk-352.0.0-linux-x86_64/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/deploy_util.py", line 471, in Deploy
    self.api_client.DeployService(new_version.service, new_version.id,
  File "/home/user-1/tools/google-cloud-sdk-352.0.0-linux-x86_64/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/appengine_api_client.py", line 230, in DeployService
    return operations_util.WaitForOperation(
  File "/home/user-1/tools/google-cloud-sdk-352.0.0-linux-x86_64/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/operations_util.py", line 307, in WaitForOperation
    completed_operation = waiter.WaitFor(
  File "/home/user-1/tools/google-cloud-sdk-352.0.0-linux-x86_64/google-cloud-sdk/lib/googlecloudsdk/api_lib/util/waiter.py", line 261, in WaitFor
    operation = PollUntilDone(
  File "/home/user-1/tools/google-cloud-sdk-352.0.0-linux-x86_64/google-cloud-sdk/lib/googlecloudsdk/api_lib/util/waiter.py", line 322, in PollUntilDone
    operation = retryer.RetryOnResult(
  File "/home/user-1/tools/google-cloud-sdk-352.0.0-linux-x86_64/google-cloud-sdk/lib/googlecloudsdk/core/util/retry.py", line 249, in RetryOnResult
    if not should_retry(result, state):
  File "/home/user-1/tools/google-cloud-sdk-352.0.0-linux-x86_64/google-cloud-sdk/lib/googlecloudsdk/api_lib/util/waiter.py", line 320, in _IsNotDone
    return not poller.IsDone(operation)
  File "/home/user-1/tools/google-cloud-sdk-352.0.0-linux-x86_64/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/operations_util.py", line 182, in IsDone
    raise OperationError(requests.ExtractErrorMessage(
googlecloudsdk.api_lib.app.operations_util.OperationError: Error Response: [4] An internal error occurred while processing task /app-engine-flex/flex_await_healthy/flex_await_healthy>2025-05-22T05:55:45.336Z148159.jc.0: Timed out waiting for the app infrastructure to become healthy.
ERROR: (gcloud.app.deploy) Error Response: [4] An internal error occurred while processing task /app-engine-flex/flex_await_healthy/flex_await_healthy>2025-05-22T05:55:45.336Z148159.jc.0: Timed out waiting for the app infrastructure to become healthy.

What might be happening. I was able to successfully deploy the application on the previous day without any issues.             
  

I was able to successfully deploy the application on the just previous day without any issues. I was able to run the docker image that was built as part of the process successfully.

1 Answer 1

0

What happens is that the error indicates that updating an unhealthy deployment with a working Docker image doesn't always result in a healthy deployment.

According to this document, despite the error, if you provide a good Docker image, the deployment might eventually become healthy. Updating an existing version with a new Docker image, though allowed, is not a good practice. Additionally, there is currently no rollback in case of version failure.

Here are the things that you might consider as well:

  1. Extend app health check timeouts in app.yaml file. Add a /health endpoint and explicitly configure health checks and startup timeouts.

Update app.yaml file:

runtime: custom
env: flex

# Add health checks with higher timeout   wwwwwwwwwwwwws
readiness_check:
  path: "/health"
  check_interval_sec: 10
  timeout_sec: 4
  failure_threshold: 10
  success_threshold: 1
  app_start_timeout_sec: 300

liveness_check:
  path: "/health"
  check_interval_sec: 10
  timeout_sec: 4
  failure_threshold: 5
  1. Retry the Deployment with a new version ID This ensures no internal state is cached, for instance:
gcloud app deploy --version=20250522

Check here if there were App Engine or GCE issues around May 21, 2025.

If the above suggestions do not help, then it might be observed that the issue is specifically for your project and requires a project inspection. It’s better to contact Google support for the same.

Sign up to request clarification or add additional context in comments.

1 Comment

Did this work? Any suggestions or confirmation to my solution would be appreciated.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.