firefly-cli
firefly-cli copied to clipboard
Environment deletion fails with FF CLI built from `main`
This is a bit challenging in a migration scenario, as I would expect the normal flow is:
- Install new
ff - Find you need to delete your old dev env
- Run
ff rm(currently fails) - Re-run
ff init
./ff/ff rm -f dev
deleting FireFly stack 'dev'... Error: Error: No such volume: dev_geth
Usage:
ff remove <stack_name> [flags]
Aliases:
remove, rm
Flags:
-f, --force Remove the stack without prompting for confirmation
-h, --help help for remove
Global Flags:
--ansi string control when to print ANSI control characters ("never"|"always"|"auto") (default "auto")
-v, --verbose verbose log output
Hmmmn, well I also can't create a new environment I just created...
➜ firefly-cli git:(main) ./ff/ff init --multiparty=false gw2 1
initializing new FireFly stack...
Stack 'gw2' created!
To start your new stack run:
ff start gw2
Your docker compose file for this stack can be found at: /Users/pbroadhurst/.firefly/stacks/gw2/docker-compose.yml
➜ firefly-cli git:(main) ./ff/ff rm gw2
WARNING: This will completely remove your stack and all of its data. Are you sure this is what you want to do?
completely delete FireFly stack 'gw2' [y/N] y
deleting FireFly stack 'gw2'... Error: Error: No such volume: gw2_geth
Usage:
ff remove <stack_name> [flags]
Aliases:
remove, rm
Flags:
-f, --force Remove the stack without prompting for confirmation
-h, --help help for remove
Global Flags:
--ansi string control when to print ANSI control characters ("never"|"always"|"auto") (default "auto")
-v, --verbose verbose log output
Error: Error: No such volume: gw2_geth
Ok - with a bit more testing, I think the scope of the issue is:
- v1.2 environments
- v1.3 environments that haven't been started (
initrun, but notstart)
Thanks for opening this! I think I have seen this issue as well. I thought I fixed it, but maybe it was a similar but slightly different issue.
For background we used to swallow a lot of errors, and when we added the linter it wasn't a big fan of that. Making the linter happy ended up with some errors that still should have been swallowed (or at least logged) getting returned all the way up. This was one of those. Should be an easy fix. I'll open a PR for it.
@peterbroadhurst Are you sure you are running the latest code in main? I think this existing check should allow this condition to not return the error: https://github.com/hyperledger/firefly-cli/blob/3679daf0650b0fa1870b86945603f2b2f71577d6/internal/stacks/stack_manager.go#L707-L709
I've just hit this running v1.3.0 trying to delete an old stack I create with v1.2 FF CLI