Skip to content

Cancelling a rollback and trying it again fails #4232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
joaopapereira opened this issue Feb 21, 2025 · 1 comment
Open

Cancelling a rollback and trying it again fails #4232

joaopapereira opened this issue Feb 21, 2025 · 1 comment

Comments

@joaopapereira
Copy link
Contributor

Hey
I was working on a scenario where I was doing the following steps but I am getting an error from CAPI.

  1. push an app
  2. restage it to create a new revision
  3. Execute cf revisions test-dora and get the output
Getting revisions for app test-dora in org test / space test as admin...

revision       description                                        deployable   revision guid                          created at
10(deployed)   New droplet deployed.                              true         7e2f381b-f8d3-49a7-a81a-faedaed348c1   2025-02-21T18:45:16Z
9              New droplet deployed. Rolled back to revision 1.   true         1df6188f-518b-4237-adea-8018ddd4bd58   2025-02-20T18:08:17Z
8              New droplet deployed.                              true         208c4716-38bd-4935-b7a2-23e3a10cf5a8   2025-02-20T18:05:51Z
7              New droplet deployed. Rolled back to revision 1.   true         580a624d-b2b2-47d1-b2dc-bd7b38d91d67   2025-02-20T17:35:46Z
6              New droplet deployed.                              true         a8bba232-9e64-4a2b-9d1a-57610e215c38   2025-02-20T17:19:00Z
5              New droplet deployed. Rolled back to revision 1.   true         acf05ec4-0a26-4569-9570-5fc653793e68   2025-02-20T17:13:05Z
4              New droplet deployed.                              true         b719c3f8-8a91-42e2-a5af-ceed6a045be6   2025-02-20T17:11:38Z
3              New droplet deployed. Rolled back to revision 1.   true         a9d3d8e3-808b-40a6-8249-666eb2eade27   2025-02-19T18:59:04Z
2              New droplet deployed.                              true         617a33e0-2245-4c99-a722-de447094feea   2025-02-19T18:57:13Z
1              Initial revision.                                  true         edbe120e-d62e-43f9-aa64-30f9ce278b68   2025-02-19T18:52:35Z
  1. do cf rollback --strategy canary dora -v 1
  2. execute cf revisions test-dora with the output
Getting revisions for app test-dora in org test / space test as admin...

Info: this app is in the middle of a rolling deployment. More than one revision is deployed.

Info: this app is in the middle of a deployment. More than one revision is deployed.

revision       description                                        deployable   revision guid                          created at
11(deployed)   New droplet deployed. Rolled back to revision 1.   true         73facf40-ea02-4d75-9cbe-7bfed584838f   2025-02-21T18:46:30Z
10(deployed)   New droplet deployed.                              true         7e2f381b-f8d3-49a7-a81a-faedaed348c1   2025-02-21T18:45:16Z
9              New droplet deployed. Rolled back to revision 1.   true         1df6188f-518b-4237-adea-8018ddd4bd58   2025-02-20T18:08:17Z
8              New droplet deployed.                              true         208c4716-38bd-4935-b7a2-23e3a10cf5a8   2025-02-20T18:05:51Z
7              New droplet deployed. Rolled back to revision 1.   true         580a624d-b2b2-47d1-b2dc-bd7b38d91d67   2025-02-20T17:35:46Z
6              New droplet deployed.                              true         a8bba232-9e64-4a2b-9d1a-57610e215c38   2025-02-20T17:19:00Z
5              New droplet deployed. Rolled back to revision 1.   true         acf05ec4-0a26-4569-9570-5fc653793e68   2025-02-20T17:13:05Z
4              New droplet deployed.                              true         b719c3f8-8a91-42e2-a5af-ceed6a045be6   2025-02-20T17:11:38Z
3              New droplet deployed. Rolled back to revision 1.   true         a9d3d8e3-808b-40a6-8249-666eb2eade27   2025-02-19T18:59:04Z
2              New droplet deployed.                              true         617a33e0-2245-4c99-a722-de447094feea   2025-02-19T18:57:13Z
1              Initial revision.                                  true         edbe120e-d62e-43f9-aa64-30f9ce278b68   2025-02-19T18:52:35Z
  1. execute cf cancel-deployment dora
  2. Execute cf revisions test-dora with the output
Getting revisions for app test-dora in org test / space test as admin...

revision       description                                        deployable   revision guid                          created at
11             New droplet deployed. Rolled back to revision 1.   true         73facf40-ea02-4d75-9cbe-7bfed584838f   2025-02-21T18:46:30Z
10(deployed)   New droplet deployed.                              true         7e2f381b-f8d3-49a7-a81a-faedaed348c1   2025-02-21T18:45:16Z
9              New droplet deployed. Rolled back to revision 1.   true         1df6188f-518b-4237-adea-8018ddd4bd58   2025-02-20T18:08:17Z
8              New droplet deployed.                              true         208c4716-38bd-4935-b7a2-23e3a10cf5a8   2025-02-20T18:05:51Z
7              New droplet deployed. Rolled back to revision 1.   true         580a624d-b2b2-47d1-b2dc-bd7b38d91d67   2025-02-20T17:35:46Z
6              New droplet deployed.                              true         a8bba232-9e64-4a2b-9d1a-57610e215c38   2025-02-20T17:19:00Z
5              New droplet deployed. Rolled back to revision 1.   true         acf05ec4-0a26-4569-9570-5fc653793e68   2025-02-20T17:13:05Z
4              New droplet deployed.                              true         b719c3f8-8a91-42e2-a5af-ceed6a045be6   2025-02-20T17:11:38Z
3              New droplet deployed. Rolled back to revision 1.   true         a9d3d8e3-808b-40a6-8249-666eb2eade27   2025-02-19T18:59:04Z
2              New droplet deployed.                              true         617a33e0-2245-4c99-a722-de447094feea   2025-02-19T18:57:13Z
1              Initial revision.                                  true         edbe120e-d62e-43f9-aa64-30f9ce278b68   2025-02-19T18:52:35Z
  1. execute cf rollback --strategy canary test-dora --version 1 with the output
Rolling 'test-dora' back to revision '1' will create a new revision. The new revision will use the settings from revision '1'.
Are you sure you want to continue? [yN]: y
Rolling back to revision 1 for app test-dora in org test / space test as admin...
Creating deployment for app test-dora...

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

This happens with both strategies canary and rolling.

@sethboyles
Copy link
Member

Thanks for the report! I think this line is the culprit:

reasons = revision_reasons(app.latest_revision, revision)
. It shouldn't assume the latest revision is the current revision

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants