Search code examples
google-app-engineapp-engine-flexiblegoogle-app-engine-php

ERROR: (gcloud.app.deploy) Error Response: [4] - App engine flex


I started getting this error all of a sudden when i deploy app engine flex.

The full error i get is the following

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>2024-02-11T09:54:47.328Z208.wa.2: Timed out waiting for the app infrastructure to become healthy.

This is the yaml file i use.

runtime: custom
api_version: '1.0'
env: flexible
service: service-name
automatic_scaling:
  min_num_instances: 1
  max_num_instances: 1

resources:
  cpu: 1
  memory_gb: 1
  disk_size_gb: 15

readiness_check:
  app_start_timeout_sec: 1800

beta_settings:
  cloud_sql_instances: sql-instance

vpc_access_connector:
  name: vonnector-name
  egress_setting: all-traffic

network:
  name: network-name

includes:
  - secrets.yaml

I followed this from the documentation and i made sure that the services have the right permissions.

https://cloud.google.com/appengine/docs/flexible/troubleshooting#healthy-time-out

These are the following things are tried

  • increased disk size
  • checked ip quota limits
  • deleted docker images and created new ones
  • removed the network name vpc connector and sql instance from the yaml file
  • I used --verbosity=debug when i deployed to get extra information but nothing useful was found.
  • I tried to remove "readiness_check: app_start_timeout_sec: 1800"

Solution

  • Based on the recent error message Updating service. Operation not complete. Waiting to retry.

    1. It seems like the root cause of the issue is with the Constraints. Can you check the activity log in the cloud console? You can refer to this Documentation.

    2. Also the above error may occur due to quotas in your project associated with App Engine and Compute Engine. Need to remember that, App Engine Flex runs in VMs. There is a similar Issue, related to the quotas: In-use IP addresses. Also check other quotas like CPU cores, memory. Check their quotas page in Cloud Console and make sure they are not near any limits, and to request increases for those that they are near.

    3. Also if you are using a Shared VPC configuration to deploy your application make sure that you enabled the required permissions.

    4. Alternatively, Can you try running the following commands by replacing the field “PROJECT_ID” with your Google Cloud Project ID and then try redeploying which may help you in resolving the issue.

      gcloud config set interactive/hidden true
      
      gcloud app update--service-account=<PROJECT_ID>@appspot.gserviceaccount.com
      
      gcloud config set interactive/hidden false ```
      
    5. Also try adding a gcp-build script with an empty value in your package.json file as per gcp-build. Please refer to the Documentation for more information regarding adding gcp-build in your package.json file.

    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.