Failed to delete Google App Engine with Flex env

```
gcloud app versions delete 20240130t214347 --project xxxxxx
Deleting the following versions:
- xxxxxx/default/20240130t214347
Do you want to continue (Y/n)? Y

Deleting [default/20240130t214347]...failed.
ERROR: (gcloud.app.versions.delete) Issue deleting version: [default/20240130t214347]

[default/20240130t214347]: Error Response: [10] There is an existing exclusive operation on this Flex deployment. Please try again later.
```


When I tried to delete a version of flex GAE, I encounter the above error. How should I do to delete the version of GAE?



1 3 120
3 REPLIES 3

Hi @victorfu,

Welcome to Google Cloud Community!

You have to have at least one version for the default module. That's the reason why it doesn't allow you to delete it.

Workaround is uploading a new version that you know that doesn't have errors and migrating to it. After that, you were able to delete the un-deletable version.

Thanks for your help. In fact, I have two versions for the default service 😭. The first one is standard and the second one is flex.

If you want to migrate to only Flex:

  1. Ensure all traffic is routed to the Flex version.
  2. Disable or delete the Standard version:
    • Disable the Standard version if you might need it again in the future.
    • Delete the Standard version if you're sure you won't need it again.

If you want to keep both Standard and Flex:

  1. Identify which version you want to delete (Standard or Flex).
  2. Check for active operations and wait for them to finish.
  3. Stop traffic to the version you want to delete (if applicable).
  4. Address any deployment errors that might be blocking deletion.
  5. Consider deploying a new, empty version and migrating traffic before deleting the problematic version (if necessary).

Additional notes:

  • Double-check version IDs to avoid deleting the wrong one.
  • Use Cloud Logging for detailed error insights.
  • Contact Google Cloud Support for further assistance if needed.
  • Remember to always have at least one version per module.