I have a Raspbian system with snapd, where the snapd daemon is no longer running. E.g. I get the following
$ sudo snap refresh error: cannot communicate with server: Post http://localhost/v2/snaps: dial unix /run/snapd.socket: connect: connection refused
In the snapd systemd log I see the following repeated over and over until the service fails:
systemd: Starting Snappy daemon... snapd: AppArmor status: apparmor not enabled snapd: AppArmor status: apparmor not enabled snapd: cannot run daemon: cannot read state: unexpected EOF systemd: snapd.service: Main process exited, code=exited, status=1/FAILURE systemd: snapd.service: Failed with result 'exit-code'. systemd: Failed to start Snappy daemon.
(stripped date and hostname in the above)
Any idea how to troubleshoot the
cannot read state: unexpected EOF message? I checked the part of the source code that triggers it but see no immediate pointers.
By the way, FWIW, there may be a case of SD card corruption due to a power outage. If there’s any way to clean the “state” that would be great.
Thanks in advance for any pointers!