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

delete_stemcell is causing bosh CLI to fail when stemcell already does not exist #619

Open
ryanmichaelsmith opened this issue May 10, 2023 · 2 comments

Comments

@ryanmichaelsmith
Copy link

This code snip is the end of a bosh create-env run where it's trying to clean up an unused stemcell. I'm not sure why it's trying to clean up a stemcell that doesn't exist, however this operation shouldn't cause the command to fail.

Deleting unused stemcell 'ami-092de32f5f076d587'... Failed (00:00:03)
Cleaning up rendered CPI jobs... Finished (00:00:00)


Deleting stemcell from cloud:
  CPI 'delete_stemcell' method responded with error: CmdError{"type":"Bosh::Clouds::CloudError","message":"could not find AMI 'ami-092de32f5f076d587'","ok_to_retry":false}
Exit code 1
===== 2023-05-10 03:43:09 UTC Finished "/usr/local/bin/bosh --no-color --non-interactive --tty create-env /var/tempest/workspaces/default/deployments/bosh.yml"; Duration: 1234s; Exit Status: 1
{"type":"step_finished","id":"bosh_product.deploying","description":"Installing BOSH"}

I believe delete_stemcell is already supposed to ignore this error, but this doesn't appear to be working as expected. At least in the context of CreateEnv.

func (s *cloudStemcell) Delete() error {
	deleteErr := s.cloud.DeleteStemcell(s.cid)
	if deleteErr != nil {
		// allow StemcellNotFoundError for idempotency
		cloudErr, ok := deleteErr.(bicloud.Error)
		if !ok || cloudErr.Type() != bicloud.StemcellNotFoundError {
			return bosherr.WrapError(deleteErr, "Deleting stemcell from cloud")
		}
	}
@ryanmichaelsmith
Copy link
Author

Bosh cli 7.2.3. CPI is AWS.

@rkoster
Copy link
Contributor

rkoster commented May 11, 2023

Thanks for reporting this, unfortunately we currently don't have the bandwidth to fix this, but we are happy to review a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Waiting for Changes | Open for Contribution
Development

No branches or pull requests

2 participants