Error when refreshing or removing snap

The mir-test-tools failed to refresh this morning, and now cannot be used, refreshed nor removed:

$ mir-test-tools.basic-test

Command 'mir-test-tools.basic-test' not found, but can be installed with:

sudo snap install mir-test-tools

$ snap install mir-test-tools
snap "mir-test-tools" is already installed, see 'snap help refresh'

$ snap refresh --candidate mir-test-tools
error: cannot perform the following tasks:
- Stop snap "mir-test-tools" services ([--root / is-enabled snap.mir-test-tools.dummy.service] failed with exit status 1: Failed to get unit file state for snap.mir-test-tools.dummy.service: No such file or directory
)

$ snap remove --purge mir-test-tools
error: cannot perform the following tasks:
- Stop snap "mir-test-tools" services ([--root / is-enabled snap.mir-test-tools.dummy.service] failed with exit status 1: Failed to get unit file state for snap.mir-test-tools.dummy.service: No such file or directory
)

$ snap --version
snap    2.44+20.04
snapd   2.44+20.04
series  16
ubuntu  20.04
kernel  5.4.0-18-generic

I’ve only seen this on one machine, and I don’t know how to reproduce. But this seems like a “should not happen” state. Happy to help investigate.

$ snap changes
ID   Status  Spawn                   Ready                   Summary
...
249  Done    yesterday at 15:46 GMT  yesterday at 15:46 GMT  Running service command for snap "scummvm"
250  Done    yesterday at 15:46 GMT  yesterday at 15:46 GMT  Running service command for snap "mir-kiosk-scummvm"
251  Done    yesterday at 15:46 GMT  yesterday at 15:46 GMT  Running service command for snap "mir-kiosk-apps"
252  Done    yesterday at 15:49 GMT  yesterday at 15:49 GMT  Revert "telegram-desktop" snap
253  Done    today at 08:43 GMT      today at 08:43 GMT      Running service command for snap "mir-kiosk-scummvm"
254  Done    today at 08:43 GMT      today at 08:43 GMT      Running service command for snap "mir-kiosk-kodi"
255  Done    today at 08:43 GMT      today at 08:43 GMT      Running service command for snap "scummvm"
256  Done    today at 08:43 GMT      today at 08:43 GMT      Running service command for snap "mir-kiosk-apps"
257  Error   today at 08:43 GMT      today at 08:43 GMT      Auto-refresh snaps "review-tools", "mir-test-tools"
258  Error   today at 08:45 GMT      today at 08:45 GMT      Refresh "mir-test-tools" snap
259  Error   today at 08:46 GMT      today at 08:46 GMT      Refresh "mir-test-tools" snap
260  Error   today at 08:46 GMT      today at 08:46 GMT      Refresh snap "mir-test-tools"
261  Error   today at 08:46 GMT      today at 08:46 GMT      Remove "mir-test-tools" snap
262  Error   today at 09:32 GMT      today at 09:32 GMT      Refresh "mir-test-tools" snap
263  Error   today at 09:33 GMT      today at 09:33 GMT      Refresh "mir-test-tools" snap
264  Error   today at 09:37 GMT      today at 09:37 GMT      Remove "mir-test-tools" snap
265  Error   today at 09:37 GMT      today at 09:37 GMT      Refresh "mir-test-tools" snap from "edge" channel
266  Error   today at 09:38 GMT      today at 09:38 GMT      Refresh "mir-test-tools" snap from "edge" channel
267  Error   today at 09:38 GMT      today at 09:38 GMT      Remove "mir-test-tools" snap
268  Done    today at 09:54 GMT      today at 09:54 GMT      Refresh "snapd" snap from "edge" channel
269  Error   today at 09:55 GMT      today at 09:55 GMT      Refresh "mir-test-tools" snap
270  Done    today at 09:57 GMT      today at 09:57 GMT      Refresh "snapd" snap
271  Error   today at 09:57 GMT      today at 09:57 GMT      Refresh "mir-test-tools" snap from "candidate" channel
272  Error   today at 10:03 GMT      today at 10:03 GMT      Remove "mir-test-tools" snap
273  Error   today at 10:04 GMT      today at 10:04 GMT      Remove "mir-test-tools" snap

i noticed some similar error this week for a snap that i had disabled and wanted to upgrade.

it seems like disabling removes the service units but then an upgrade ot removal tries to systemctl stop them …

was mir-test-tools disabled before you tried to remove it ?

No, there’s no reason to disable it. (The service is only a dummy to work around a problem encountered long ago - I should check if it is still needed.)