Snapd: "cannot run daemon: cannot read state: unexpected EOF"

This is almost certainly because your state.json file is corrupted/empty. Please do not upload that file as it can contain sensitive information, namely macaroons or other authorization keys. Can you confirm if the following things work (you can use jq from the archive for this purpose):

$ sudo ls -lah /var/lib/snapd/state.json
$ sudo cat /var/lib/snapd/state.json | jq keys

the jq command should show something like

[
  "changes",
  "data",
  "last-change-id",
  "last-lane-id",
  "last-task-id",
  "tasks"
]

for a valid state.json

Just delete the state.json file and snapd will re-create it but note that this may lead to unexpected state for the installed snaps, so your installed snaps may then show up as broken, etc. so you might be better off with apt remove --purge snapd and then re-install.

2 Likes