The closest thing we currently have is:
remove-module --no-preserve --force
The --force flag is specifically intended to proceed with the removal even when the application’s destroy-module action fails.
What you’re describing is a slightly different and, as far as I know, largely unexplored use case: the module homedir has already been manually removed or otherwise lost, leaving only cluster metadata behind.
One possible improvement would be to extend the --force behavior to explicitly handle the missing homedir case, avoiding hangs or failures when the application files are no longer present.
If someone wanted to improve the cleanup path for this scenario, I would start by looking at the implementations of cluster/remove-module and node/remove-module.
Assuming the module homedir is already gone, the remaining cleanup should mostly consist of:
- Removing Redis references (see
cluster/remove-module/50update) - Releasing allocated TCP/UDP ports (see
node/remove-module/60ports)
In other words, the problem is probably not deleting files anymore, but cleaning up the cluster state that still references the removed module.