prototipando / google-cloud-sdk

Automatically exported from code.google.com/p/google-cloud-sdk
1 stars 0 forks source link

Unable to delete old version immediately after deploying new default #332

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

- Have Managed VM version X running.

- Deploy a new version Y and make it the default:
$ gcloud preview app deploy app.yaml --docker-build=remote --version Y --force 
--promote

- Wait until deployment is confirmed as complete:
Deployed module [default] to [https://reviewable-prod.appspot.com]

- Immediately try to delete version X:
$ gcloud preview app modules delete default --version X

What is the expected output? What do you see instead?

Expected: version X is deleted.  Actual:

ERROR: (gcloud.preview.app.modules.delete) Error Response: [400] Cannot delete 
a version with a non-zero traffic allocation. Please update your traffic split 
to remove the allocation for this Version and try again.

My app is headless and services task queues instead, so leaving an old version 
running leads to unnecessary version skew (not to mention unnecessary charges).

What is the output of 'gcloud info'?

Google Cloud SDK [0.9.83]

Platform: [Linux, x86_64]
Python Version: [2.7.6 (default, Mar 22 2014, 22:59:56)  [GCC 4.8.2]]
Site Packages: [Enabled]

Installation Root: [/root/google-cloud-sdk]
Installed Components:
  core: [2015.10.16]
  core-nix: [2015.09.03]
  app: [2015.10.16]
  gcloud: [2015.10.16]
  gsutil-nix: [4.14]
  gsutil: [4.15]
  bq: [2.0.18]
  bq-nix: [2.0.18]
System PATH: 
[/root/bin:/root/shippable_ve/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/
bin:/sbin:/bin:/root/usr/local/bin:/root/google-cloud-sdk/bin]
Cloud SDK on PATH: [True]

Installation Properties: [/root/google-cloud-sdk/properties]
User Config Directory: [/root/.config/gcloud]
User Properties: [/root/.config/gcloud/properties]
Current Workspace: [None]
Workspace Config Directory: [None]
Workspace Properties: [None]

Account: [piotr@reviewable.io]
Project: [reviewable-prod]

Current Properties:
  [core]
    project: [reviewable-prod]
    account: [piotr@reviewable.io]
    disable_usage_reporting: [False]
  [app]
    use_appengine_api: [True]

Logs Directory: [/root/.config/gcloud/logs]
Last Log File: [/root/.config/gcloud/logs/2015.10.22/19.40.41.794447.log]

Please provide any additional information below.

Original issue reported on code.google.com by pi...@ideanest.com on 22 Oct 2015 at 8:04

GoogleCodeExporter commented 8 years ago
Adding a 10 second delay between deploying and deleting seems to be sufficient 
to bypass the error.

Original comment by pi...@ideanest.com on 29 Oct 2015 at 2:59

GoogleCodeExporter commented 8 years ago
Thanks for reporting this. You're right--we shouldn't tell you that your app 
has been deployed to the default version if we think the old version is still 
receiving traffic.

We have a command-line flag in the works that will do this for you--we agree 
that deleting VMs is good

I'm glad that you can work around for now.

Original comment by z...@google.com on 24 Nov 2015 at 11:28