copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

Swallow errors when trying to delete jobs that don't exist

Open efekarakus opened this issue 3 years ago • 0 comments

Ask

Today, trying to delete jobs copilot job delete in environments with no cluster result in the following error:

✘ Failed to stop running tasks of job reporter from environment bootstrap: no cluster found in environment bootstrap.
✘ execute job delete: stop tasks for environment bootstrap: no cluster found in environment bootstrap

Copilot should swallow the error if there are no jobs in the first place and exit successfully.

Reproduction steps

  1. Run copilot env init -n bootstrap to create an environment with only IAM roles and no cluster yet.
  2. Run copilot job init -n reporter to create a scheduled job.
  3. Run copilot job delete to trigger the error.

Note that after step 1, we did not run copilot env deploy to create the ECS cluster.

efekarakus avatar Jul 19 '22 17:07 efekarakus