unable to remove snap with always failing disconnect interface hook
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Fix Released
|
High
|
Miguel Pires |
Bug Description
With a snap that plugs an interface and has a disconnect-plug-* interface hook for that interface defined which always exits 1, you can't directly remove the snap after the interface is connected.
This is because a normal `snap remove` will first disconnect all the interfaces, one at a time, which fails because we can't finish executing the disconnect-plug hook successfully, and thus can't disconnect that interface before continuing to remove the snap.
In order to remove such a snap, you have to `snap disable` it first and then `snap remove` it. This works because the `snap disable` just removes the security backend entirely without first affecting interfaces. The subsequent `snap remove` works because `snap remove` on a disabled snap doesn't need to do anything with the connections.
Changed in snapd: | |
status: | New → Triaged |
importance: | Undecided → High |
Changed in snapd: | |
status: | In Progress → Fix Committed |
Changed in snapd: | |
status: | Fix Committed → Fix Released |
Perhaps one way to fix this is to have `snap remove` ignore disconnect-* interface hooks for the `snap remove` change specifically like we do for the remove hook.