It was suggested on irc that this is due to me having over 300 snaps installed.
I may have found a workaround. I have a script which purges all old revisions of snaps. I ran that, it purged all those old versions (352 snaps), and now snap refresh works.
$ cat purge_old_snap_revisions.sh
#!/bin/bash
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
set -eu
snap list --all | awk '/disabled/{print $1, $3}' |
while read snapname revision; do
sudo snap remove "$snapname" --revision="$revision"
done
I seem to hit similar issue, and it’s definitely because of too many installed snaps, 12.
I’m trying to start simple one shot service which is just shell script.
Service takes ages to start and there is same error : error: cannot communicate with server: timeout exceeded while waiting for response
Easy one to test:
Sorry for reviving this old post, but I am getting this error a lot lately while trying to upgrade (snap refresh).
I guess I have many snap installed, but not a crazy number and I haven’t installed many more lately. It used to work fine…
The weird thing is that I have two PCs in the same network and it works on one and not in the other. And the PC in which snap refresh doesn’t work doesn’t seem to have any internet-related problem.
Just had a similar issue whereby snap commands would work. Turned out the system had run out of disk space. Freed some up, rebooted and everything started working again. Not sure if this will help anyone else.