Skip to content
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

You can end up with an impossible to delete service #44

Open
RichardChester opened this issue Oct 9, 2023 · 6 comments
Open

You can end up with an impossible to delete service #44

RichardChester opened this issue Oct 9, 2023 · 6 comments

Comments

@RichardChester
Copy link

Using the cdk repo here as an example what would happen if you created the service but through human error you accidentally deleted your package.json and then tried to deploy the service. It would fail to deploy as expected then you might try to delete the service but the delete is also going to try and find a package.json and fail to delete. You now have a service you can't delete or update and is just kind of stuck in a delete failed state.

Ps I deleted my package.json and I have 4 services I can't get rid of please help

@racicot-amzn @nouvionp

@racicot-amzn
Copy link

Hello Richard,

Can you provide the ARNs of the services that are stuck? If not can you provide the name and region?

Also can you be more specific on when / where you deleted the package.json?

@RichardChester
Copy link
Author

Hello Ryan thanks for getting back to me so quick

the arns are:

  1. arn:aws:proton:eu-west-1:xxxxxxxxxx:service/regression-test
  2. arn:aws:proton:eu-west-1:xxxxxxxxxx:service/regression
  3. arn:aws:proton:eu-west-1:xxxxxxxxxx:service/regression-testing

Account numbers are the same as with my previous tickets

Well to actually be specific what I did was try writing some infra using the java CDK and forgot to update my manifest accordingly so what I actually did was not include a package.json because there was no need for one if the first place, The other errors I got were to do with the lombok serializer but to keep the ticket simple I didn't go into the details and just kept it to the high level question of: What can I do when delete fails ?

@racicot-amzn
Copy link

As for the 3rd instance, you would have to investigate the errors thrown during the CodeBuild job run. The only error we can see on our side is:

Phase: BUILD failed with reason(s) StatusCode: 'COMMAND_EXECUTION_ERROR', Message: 'Error while executing command: cdk destroy --force. Reason: exit status 1'  Phase: COMPLETED failed with no context.

Investigating the root cause of that error should hopefully lead you to the updates you need to make to your instance to be able to delete it.

@racicot-amzn
Copy link

I'd assume the solution would be updating your service to include a package.json, but let me consult with the rest of the team and get back to you with other possible solutions.

@RichardChester
Copy link
Author

See I understand why it's failing but it's that last suggestion I can't seem to do. Like I know what I would have to do to fix them so they can be deleted but when I push the new version with the fix I can't update the failed service to it because you can't update a failed service to the next minor version if I could I'd do as you say or just fix the manifest and then delete it

@racicot-amzn
Copy link

Hello Richard,

After consulting the team, this is actually related to an issue we have resolved recently. You should be able to get yourself unstuck by doing the following:

  1. Create and publish a new template minor version for the template used to deploy the failing instances, which includes a valid package.json
  2. Call our UpdateServiceInstance API as follows to kick off a successful deployment for the failed instances using the new template version:
$ aws proton update-service-instance --service-name "<SERVICE_NAME>" --name "<INSTANCE_NAME>" --spec file://spec.yaml --deployment-type MINOR_VERSION
  1. Then you should be able to delete those instances by either calling UpdateService or DeleteService.

Let me know if you run into any troubles with this process!

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