unable to remove snap with always failing disconnect interface hook

Bug #1845880 reported by Ian Johnson
12
This bug affects 2 people
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.

Revision history for this message
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
Revision history for this message
Miguel Pires (miguelpires1) wrote :
Changed in snapd:
assignee: nobody → Miguel Pires (miguelpires1)
status: Triaged → In Progress
Changed in snapd:
status: In Progress → Fix Committed
Changed in snapd:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.