Snapd `internal error: connection "[slot] [plug]" not found in state`

Bug #1882957 reported by Joseph Borg
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Fix Committed
High
Unassigned

Bug Description

I've been developing a test snap. During this, I had a broken `connect-plug` hook which failed for an expected reason.

However, this as left snapd in a broken state as I cannot remove the snap, nor the connection.

➜ snap remove [snap_1]
error: cannot perform the following tasks:
- Disconnect [snap_1]:[slot] from [snap_2]:[plug] (internal error: connection "[snap_1]:[slot] [snap_2]:[plug]" not found in state)

➜ snap disconnect [snap_1]:[slot] [snap_2]:[plug]
error: cannot perform the following tasks:
- Disconnect [snap_1]:[slot] from [snap_2]:[plug] (internal error: connection "[snap_1]:[slot] [snap_2]:[plug]" not found in state)

affects: snappy → snapd
Changed in snapd:
status: New → Triaged
importance: Undecided → High
Changed in snapd:
assignee: nobody → Paweł Stołowski (stolowski)
Revision history for this message
Paweł Stołowski (stolowski) wrote :

@Joseph Thanks for the report! Did you use 'snap try' when working on this snap?

Revision history for this message
Paweł Stołowski (stolowski) wrote :

I've managed to reproduce it without snap try (nonetheless please let me know if you used snap try).

Changed in snapd:
status: Triaged → Confirmed
Revision history for this message
Joseph Borg (joeborg) wrote :

Hey Pavel,

I did not, is it something should try? That wasn't even mean to be a pun :).

Thanks,
Joe

Revision history for this message
Paweł Stołowski (stolowski) wrote :

@Joseph No, I was just looking for ways to reproduce and what execution paths to focus on. Don't worry about snap try.

Changed in snapd:
status: Confirmed → In Progress
Revision history for this message
Paweł Stołowski (stolowski) wrote :

Proposed a fix: https://github.com/snapcore/snapd/pull/8914

As a workaround you can restart snapd, this should let you remove this snap.

Changed in snapd:
status: In Progress → Fix Committed
Revision history for this message
Tom Chiverton (bugs-launchpad-net-falkensweb) wrote :

Workaround does not work :
```
falken@wopr:/var/cache$ systemctl restart snapd
falken@wopr:/var/cache$ sudo snap remove --purge chromium
error: cannot perform the following tasks:
- Remove data for snap "chromium" (2424) (failed to remove snap "chromium" base directory: remove /var/snap/chromium: directory not empty)
```

Changed in snapd:
assignee: Paweł Stołowski (stolowski) → nobody
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.