Skip to content

Can't rollback to revision N if rollback to revision N was previously executed and cancelled before deployment is completed #1964

@heyjcollins

Description

@heyjcollins

Issue

Once a rollback to a previous revision has been cancelled before the rollback has completed, all attempts to re-run that same rollback fail because the backend seems to think that the code and config to be rolled back to is the same as the currently deployed revision.

Context

The CLI Team is implementing the revisions and rollback CLI commands.
In the output of cf revisions APP_NAME, a (deployed) decorator is displayed adjacent to the revision number(s) that's currently deployed as per /v3/apps/:guid/revisions/deployed.
Click HERE to view screenshot of the UX.

We found a specific sequence where the backend is preventing rollback to a previous revision because it is the same as the deployed revision, but that is clearly not the case.

Once it's in this state, it isn't possible to rollback to the target revision.

Steps to Reproduce

Env/Setup:

cf api
API endpoint:   https://api.arsicault.cli.fun
API version:    3.88.0
cf version
cf version 7.1.0+e3e7571bc.2020-09-26

Repro:
Using the latest edge version of the v7 CLI

  1. open two terminals and target the same env/org/space
  2. In term 1:
    • cf push app_name 3X
    • cf rollback app_name --revision 1 -f
  3. In term 2:
    • before the term 1 rollback has completed
    • cf cancel-deployment app_name
  4. In term 1:
    • cf rollback app_name --revision 1 -f

Expected result

I'd expect the rollback to succeed without error since the previous rollback to revision 1 was cancelled and the currently deployed revision is revision 3 - which doesn't share the same droplet as revision 1.
A new revision cloudfoundry/capi-release#4 was created during the cancelled rollback, but the system still appears to think the currently deployed revision is revision cloudfoundry/capi-release#3
cf curl /v3/apps/$(cf app app_name --guid)/revisions/deployed
However, it's responding as if it believes the rollback was completed successfully and that I'm trying to rollback from revision #4 which does have the same code and configs as revision cloudfoundry/capi-release#1

Current result

the rollback fails with the following error:

cf rollback dora3 --revision 1 -f
This command is in EXPERIMENTAL stage and may change without notice

Rolling back to revision 1 for app dora3 in org o / space s as admin...
Creating deployment for app dora3...

Unable to rollback. The code and configuration you are rolling back to is the same as the deployed revision.
FAILED

verbose_rollback_failure_output.txt

Screen Shot 2020-10-09 at 5 25 13 PM

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions