We have a bunch of volumes associated with an app - I can see ten of them in the web interface, and I see associated charges on our bill, but when I try to interact with them via the cli, it’s as though they don’t exist.
fly volume list $app_name gives an empty list, grabbing the ID from the web interface and running fly volume show <id> or fly volume delete <id> both give Failed to get volume <id>: volume not found
Am I doing something wrong? I was able to delete very similar-looking volumes in another org of ours, but these seem stuck somehow.
Hi ben, do you have some volume IDs we could look at? volume IDs should be safeish to share, they’re hashed.
Sure - these are the two I’ve been trying with:
vol_40lly6zq876zxj94
vol_4o55xp1mpmn2029v
Thanks! These two show as created from my side. You said fly volume list is empty? because I see this app has 19 volumes on my side. Let me know - we can likely clear them out for you.
One more thing - fly volume list $app_name likely won’t work, have you tried fly volume list -a $app_name?
interesting - that does work to find them.
I’m not sure why I had it without the -a, but it happened to work that way in our staging org/with our staging app
Hi Ben,
If you don’t use -a it’ll take the name of the app from the fly.toml in the current directory - maybe staging has no volumes and that’s what you were looking at?
That is: if fly.toml has “app=staging” and you run fly volumes list production thinking it’ll show you the volumes for the production app, it silently and confusingly won’t - it’ll show you the volumes for the production app, silently ignoring the positional argument.
However, fly volumes list -a production correctly forces flyctl to look at the production app, ignoring the fly.toml in the current directory.
Let me know if this explains things!
That got me trying more different combinations, and fly volume delete -a $app_name $volume_id worked for me.
I think it would be helpful if the error (or command help) let me know that the app flag was required
Hi Ben,
that’s partly the thing - -a is not required. If you don’t specify it it’ll take the app name from fly.toml, or barf if there’s no fly.toml (try it in an empty dir). But a positional argument is not used at all, and that’s where the confusion came from.
There’s a possible improvement here, but it’d be something like: if you give a positional argument, which is going to be ignored, it should say something to that effect.