unable to remove snap with always failing disconnect interface hook

Bug #1845880 reported by Ian Johnson on 2019-09-29
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
High
Unassigned

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.

Ian Johnson (anonymouse67) wrote :

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.

Changed in snapd:
status: New → Triaged
importance: Undecided → High
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers