Snap.d error: cannot communicate with server connection refused

Feb 18 17:16:25 localhost.localdomain systemd[1]: Starting Snappy daemon…
Feb 18 17:16:26 localhost.localdomain snapd[1088]: AppArmor status: apparmor is enabled and all features are available
Feb 18 17:16:26 localhost.localdomain snapd[1088]: daemon.go:379: started snapd/2.37.1 (series 16) ubuntu-core/16 (armhf) linux/4.4.0-1100-raspi2.
Feb 18 17:16:27 localhost.localdomain systemd[1]: Started Snappy daemon.
Feb 18 17:21:29 localhost.localdomain snapd[1088]: state.go:247: PANIC cannot checkpoint even after 5m0s of retries every 3s: write /var/lib/snapd/state.json.T2wbn2XBCWMr~: no space left on de
Feb 18 17:21:29 localhost.localdomain snapd[1088]: panic: cannot checkpoint even after 5m0s of retries every 3s: write /var/lib/snapd/state.json.T2wbn2XBCWMr~: no space left on device
Feb 18 17:21:29 localhost.localdomain snapd[1088]: panic: internal error: accessing state without lock [recovered]
Feb 18 17:21:29 localhost.localdomain snapd[1088]: panic: internal error: accessing state without lock
Feb 18 17:21:29 localhost.localdomain snapd[1088]: panic: sync: unlock of unlocked mutex
Feb 18 17:21:29 localhost.localdomain snapd[1088]: goroutine 21 [running]:
Feb 18 17:21:29 localhost.localdomain snapd[1088]: panic(0x1031ea0, 0x11a74078)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /usr/lib/go-1.6/src/runtime/panic.go:481 +0x370
Feb 18 17:21:29 localhost.localdomain snapd[1088]: sync.(*Mutex).Unlock(0x118c4280)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /usr/lib/go-1.6/src/sync/mutex.go:109 +0xa0
Feb 18 17:21:29 localhost.localdomain snapd[1088]: github.com/snapcore/snapd/overlord/state.(*State).unlock(0x118c4280)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /build/snapd-AyZ5nb/snapd-2.37.1/_build/src/github.com/snapcore/snapd/overlord/state/state.go:157 +0x58
Feb 18 17:21:29 localhost.localdomain snapd[1088]: panic(0x1031ea0, 0x11a74068)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /usr/lib/go-1.6/src/runtime/panic.go:443 +0x490
Feb 18 17:21:29 localhost.localdomain snapd[1088]: encoding/json.(*encodeState).marshal.func1(0x1174964c)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /usr/lib/go-1.6/src/encoding/json/encode.go:269 +0x104
Feb 18 17:21:29 localhost.localdomain snapd[1088]: panic(0x1031ea0, 0x11a74060)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /usr/lib/go-1.6/src/runtime/panic.go:443 +0x490
Feb 18 17:21:29 localhost.localdomain snapd[1088]: github.com/snapcore/snapd/overlord/state.(*State).reading(0x118c4280)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /build/snapd-AyZ5nb/snapd-2.37.1/_build/src/github.com/snapcore/snapd/overlord/state/state.go:144 +0x94
Feb 18 17:21:29 localhost.localdomain snapd[1088]: github.com/snapcore/snapd/overlord/state.(*State).MarshalJSON(0x118c4280, 0x0, 0x0, 0x0, 0x0, 0x0)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /build/snapd-AyZ5nb/snapd-2.37.1/_build/src/github.com/snapcore/snapd/overlord/state/state.go:173 +0x38
Feb 18 17:21:29 localhost.localdomain snapd[1088]: encoding/json.marshalerEncoder(0x11b701e0, 0x1176488, 0x118c4280, 0x16, 0x118c4200)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /usr/lib/go-1.6/src/encoding/json/encode.go:418 +0x100
Feb 18 17:21:29 localhost.localdomain snapd[1088]: encoding/json.(*encodeState).reflectValue(0x11b701e0, 0x1176488, 0x118c4280, 0x16)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /usr/lib/go-1.6/src/encoding/json/encode.go:301 +0x64
Feb 18 17:21:29 localhost.localdomain snapd[1088]: encoding/json.(*encodeState).marshal(0x11b701e0, 0x1176488, 0x118c4280, 0x0, 0x0)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /usr/lib/go-1.6/src/encoding/json/encode.go:274 +0xa0
Feb 18 17:21:29 localhost.localdomain snapd[1088]: encoding/json.Marshal(0x1176488, 0x118c4280, 0x0, 0x0, 0x0, 0x0, 0x0)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /usr/lib/go-1.6/src/encoding/json/encode.go:139 +0x70
Feb 18 17:21:29 localhost.localdomain snapd[1088]: github.com/snapcore/snapd/overlord/state.(*State).checkpointData(0x118c4280, 0x0, 0x0, 0x0)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /build/snapd-AyZ5nb/snapd-2.37.1/_build/src/github.com/snapcore/snapd/overlord/state/state.go:213 +0x40
Feb 18 17:21:29 localhost.localdomain snapd[1088]: github.com/snapcore/snapd/overlord/state.(*State).Unlock(0x118c4280)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /build/snapd-AyZ5nb/snapd-2.37.1/_build/src/github.com/snapcore/snapd/overlord/state/state.go:237 +0x70
Feb 18 17:21:29 localhost.localdomain snapd[1088]: panic(0x1031ea0, 0x11a74050)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /usr/lib/go-1.6/src/runtime/panic.go:443 +0x490
Feb 18 17:21:29 localhost.localdomain snapd[1088]: github.com/snapcore/snapd/logger.Panicf(0x1263c90, 0x37, 0x11749800, 0x3, 0x3)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /build/snapd-AyZ5nb/snapd-2.37.1/_build/src/github.com/snapcore/snapd/logger/logger.go:67 +0x14c
Feb 18 17:21:29 localhost.localdomain snapd[1088]: github.com/snapcore/snapd/overlord/state.(*State).Unlock(0x118c4280)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /build/snapd-AyZ5nb/snapd-2.37.1/_build/src/github.com/snapcore/snapd/overlord/state/state.go:247 +0x310
Feb 18 17:21:29 localhost.localdomain snapd[1088]: github.com/snapcore/snapd/overlord/auth.(*authContext).UpdateDeviceAuth(0x119ea340, 0x11afcb70, 0x11b36000, 0x230, 0x11ada1e0, 0x0, 0x0)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /build/snapd-AyZ5nb/snapd-2.37.1/_build/src/github.com/snapcore/snapd/overlord/auth/auth.go:457 +0x210
Feb 18 17:21:29 localhost.localdomain snapd[1088]: github.com/snapcore/snapd/store.(*Store).refreshDeviceSession(0x119d87e0, 0x11afcb70, 0x0, 0x0)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /build/snapd-AyZ5nb/snapd-2.37.1/_build/src/github.com/snapcore/snapd/store/store.go:574 +0x2ac
Feb 18 17:21:29 localhost.localdomain snapd[1088]: github.com/snapcore/snapd/store.(*Store).refreshAuth(0x119d87e0, 0x0, 0x76460001, 0x0, 0x0)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /build/snapd-AyZ5nb/snapd-2.37.1/_build/src/github.com/snapcore/snapd/store/store.go:833 +0x110
Feb 18 17:21:29 localhost.localdomain snapd[1088]: github.com/snapcore/snapd/store.(*Store).SnapAction(0x119d87e0, 0x74ac4198, 0x11a6ca80, 0x11a6e8a0, 0x3, 0x3, 0x11a6fc90, 0x3, 0x4, 0x0, …)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /build/snapd-AyZ5nb/snapd-2.37.1/_build/src/github.com/snapcore/snapd/store/store.go:2065 +0x3c4
Feb 18 17:21:29 localhost.localdomain snapd[1088]: github.com/snapcore/snapd/overlord/snapstate.refreshCandidates(0x74ac4198, 0x11a6ca80, 0x118c4280, 0x0, 0x0, 0x0, 0x0, 0x11a6e870, 0x0, 0x0

– Logs begin at Mon 2019-02-18 17:16:16 UTC, end at Mon 2019-02-18 17:27:08 UTC. –
Feb 18 17:16:25 localhost.localdomain systemd[1]: Starting Snappy daemon…
Feb 18 17:16:26 localhost.localdomain snapd[1088]: AppArmor status: apparmor is enabled and all features are available
Feb 18 17:16:26 localhost.localdomain snapd[1088]: daemon.go:379: started snapd/2.37.1 (series 16) ubuntu-core/16 (armhf) linux/4.4.0-1100-raspi2.
Feb 18 17:16:27 localhost.localdomain systemd[1]: Started Snappy daemon.
Feb 18 17:21:29 localhost.localdomain snapd[1088]: state.go:247: PANIC cannot checkpoint even after 5m0s of retries every 3s: write /var/lib/snapd/state.json.T2wbn2XBCWMr~: no space left on d
Feb 18 17:21:29 localhost.localdomain snapd[1088]: panic: cannot checkpoint even after 5m0s of retries every 3s: write /var/lib/snapd/state.json.T2wbn2XBCWMr~: no space left on device
Feb 18 17:21:29 localhost.localdomain snapd[1088]: panic: internal error: accessing state without lock [recovered]
Feb 18 17:21:29 localhost.localdomain snapd[1088]: panic: internal error: accessing state without lock
Feb 18 17:21:29 localhost.localdomain snapd[1088]: panic: sync: unlock of unlocked mutex
Feb 18 17:21:29 localhost.localdomain snapd[1088]: goroutine 21 [running]:
Feb 18 17:21:29 localhost.localdomain snapd[1088]: panic(0x1031ea0, 0x11a74078)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /usr/lib/go-1.6/src/runtime/panic.go:481 +0x370
Feb 18 17:21:29 localhost.localdomain snapd[1088]: sync.(*Mutex).Unlock(0x118c4280)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /usr/lib/go-1.6/src/sync/mutex.go:109 +0xa0
Feb 18 17:21:29 localhost.localdomain snapd[1088]: github.com/snapcore/snapd/overlord/state.(*State).unlock(0x118c4280)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /build/snapd-AyZ5nb/snapd-2.37.1/_build/src/github.com/snapcore/snapd/overlord/state/state.go:157 +0x58
Feb 18 17:21:29 localhost.localdomain snapd[1088]: panic(0x1031ea0, 0x11a74068)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /usr/lib/go-1.6/src/runtime/panic.go:443 +0x490
Feb 18 17:21:29 localhost.localdomain snapd[1088]: encoding/json.(*encodeState).marshal.func1(0x1174964c)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /usr/lib/go-1.6/src/encoding/json/encode.go:269 +0x104
Feb 18 17:21:29 localhost.localdomain snapd[1088]: panic(0x1031ea0, 0x11a74060)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /usr/lib/go-1.6/src/runtime/panic.go:443 +0x490
Feb 18 17:21:29 localhost.localdomain snapd[1088]: github.com/snapcore/snapd/overlord/state.(*State).reading(0x118c4280)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /build/snapd-AyZ5nb/snapd-2.37.1/_build/src/github.com/snapcore/snapd/overlord/state/state.go:144 +0x94
Feb 18 17:21:29 localhost.localdomain snapd[1088]: github.com/snapcore/snapd/overlord/state.(*State).MarshalJSON(0x118c4280, 0x0, 0x0, 0x0, 0x0, 0x0)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /build/snapd-AyZ5nb/snapd-2.37.1/_build/src/github.com/snapcore/snapd/overlord/state/state.go:173 +0x38
Feb 18 17:21:29 localhost.localdomain snapd[1088]: encoding/json.marshalerEncoder(0x11b701e0, 0x1176488, 0x118c4280, 0x16, 0x118c4200)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /usr/lib/go-1.6/src/encoding/json/encode.go:418 +0x100
Feb 18 17:21:29 localhost.localdomain snapd[1088]: encoding/json.(*encodeState).reflectValue(0x11b701e0, 0x1176488, 0x118c4280, 0x16)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /usr/lib/go-1.6/src/encoding/json/encode.go:301 +0x64
Feb 18 17:21:29 localhost.localdomain snapd[1088]: encoding/json.(*encodeState).marshal(0x11b701e0, 0x1176488, 0x118c4280, 0x0, 0x0)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /usr/lib/go-1.6/src/encoding/json/encode.go:274 +0xa0
Feb 18 17:21:29 localhost.localdomain snapd[1088]: encoding/json.Marshal(0x1176488, 0x118c4280, 0x0, 0x0, 0x0, 0x0, 0x0)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /usr/lib/go-1.6/src/encoding/json/encode.go:139 +0x70
Feb 18 17:21:29 localhost.localdomain snapd[1088]: github.com/snapcore/snapd/overlord/state.(*State).checkpointData(0x118c4280, 0x0, 0x0, 0x0)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /build/snapd-AyZ5nb/snapd-2.37.1/_build/src/github.com/snapcore/snapd/overlord/state/state.go:213 +0x40
Feb 18 17:21:29 localhost.localdomain snapd[1088]: github.com/snapcore/snapd/overlord/state.(*State).Unlock(0x118c4280)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /build/snapd-AyZ5nb/snapd-2.37.1/_build/src/github.com/snapcore/snapd/overlord/state/state.go:237 +0x70
Feb 18 17:21:29 localhost.localdomain snapd[1088]: panic(0x1031ea0, 0x11a74050)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /usr/lib/go-1.6/src/runtime/panic.go:443 +0x490
Feb 18 17:21:29 localhost.localdomain snapd[1088]: github.com/snapcore/snapd/logger.Panicf(0x1263c90, 0x37, 0x11749800, 0x3, 0x3)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /build/snapd-AyZ5nb/snapd-2.37.1/_build/src/github.com/snapcore/snapd/logger/logger.go:67 +0x14c
Feb 18 17:21:29 localhost.localdomain snapd[1088]: github.com/snapcore/snapd/overlord/state.(*State).Unlock(0x118c4280)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /build/snapd-AyZ5nb/snapd-2.37.1/_build/src/github.com/snapcore/snapd/overlord/state/state.go:247 +0x310
Feb 18 17:21:29 localhost.localdomain snapd[1088]: github.com/snapcore/snapd/overlord/auth.(*authContext).UpdateDeviceAuth(0x119ea340, 0x11afcb70, 0x11b36000, 0x230, 0x11ada1e0, 0x0, 0x0)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /build/snapd-AyZ5nb/snapd-2.37.1/_build/src/github.com/snapcore/snapd/overlord/auth/auth.go:457 +0x210
Feb 18 17:21:29 localhost.localdomain snapd[1088]: github.com/snapcore/snapd/store.(*Store).refreshDeviceSession(0x119d87e0, 0x11afcb70, 0x0, 0x0)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /build/snapd-AyZ5nb/snapd-2.37.1/_build/src/github.com/snapcore/snapd/store/store.go:574 +0x2ac
Feb 18 17:21:29 localhost.localdomain snapd[1088]: github.com/snapcore/snapd/store.(*Store).refreshAuth(0x119d87e0, 0x0, 0x76460001, 0x0, 0x0)
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /build/snapd-AyZ5nb/snapd-2.37.1/_build/src/github.com/snapcore/snapd/store/store.go:833 +0x110
Feb 18 17:21:29 localhost.localdomain snapd[1088]: github.com/snapcore/snapd/store.(*Store).SnapAction(0x119d87e0, 0x74ac4198, 0x11a6ca80, 0x11a6e8a0, 0x3, 0x3, 0x11a6fc90, 0x3, 0x4, 0x0, …
Feb 18 17:21:29 localhost.localdomain snapd[1088]: /build/snapd-AyZ5nb/snapd-2.37.1/_build/src/github.com/snapcore/snapd/store/store.go:2065 +0x3c4
Feb 18 17:21:29 localhost.localdomain snapd[1088]: github.com/snapcore/snapd/overlord/snapstate.refreshCandidates(0x74ac4198, 0x11a6ca80, 0x118c4280, 0x0, 0x0, 0x0, 0x0, 0x11a6e870, 0x0, 0x0,
lines 1-54

Feb 18 17:21:29 localhost.localdomain systemd[1]: snapd.service: Unit entered failed state.
Feb 18 17:21:29 localhost.localdomain systemd[1]: snapd.service: Triggering OnFailure= dependencies.
Feb 18 17:21:29 localhost.localdomain systemd[1]: snapd.service: Failed with result ‘exit-code’.
Feb 18 17:21:29 localhost.localdomain systemd[1]: snapd.service: Service hold-off time over, scheduling restart.
Feb 18 17:21:29 localhost.localdomain systemd[1]: Stopped Snappy daemon.
Feb 18 17:21:29 localhost.localdomain systemd[1]: Starting Snappy daemon…
Feb 18 17:21:29 localhost.localdomain snapd[1259]: AppArmor status: apparmor is enabled and all features are available
Feb 18 17:21:29 localhost.localdomain snapd[1259]: daemon.go:379: started snapd/2.37.1 (series 16) ubuntu-core/16 (armhf)

This looks like a problem to me.

1 Like

Thank you for the help. I am getting a bigger card and see if that fixes it.

A bigger card fixed my problems, thank you for your help.

2 Likes

systemctl restart snapd.service to fix it

it helps me for above same issue.thanks

Solution To This Problem Is Simple. Just Run Your PC In Systemd Mode.

1 Like

solution is to check your proxy connection.

sudo nano /etc/environment

change your https_proxy = “https://whatever_IP_address:port_no”
to https_proxy = “http://whatever_IP_address:port_no”

remove the s in the http
cat /etc/environment to see changes and install whatever app needs snap e.g sudo snap install discord

The thing is snap tries to enforce it self to boot into boot-time by lunching its services.
This increase the boot time.
Which is why I use tend to disable all of those services to increase boot time.

Now there are other 2 problem:
i) Canonical supply system application through Snap.
ii) Snap doesn’t let users to launch application which are installed using Snap unless user run Snap services.

Its like you can’t launch YouTube if Playstore services are not running. And thank God, its not like that in Android phones.

This is bad, really bad for Ubuntu.
But we have an huge distros to change to.

I have been having the same problem with chrome os.
error: cannot communicate with server: Post http://localhost/v2/snaps/snap-store: dial unix /run/snapd.socket: connect: no such file or directory

This is a super popular thread on the forum. We’re seeing a lot of people coming here with this specific issue.

@mborzecki / @zyga-snapd / @ogra - tagging you as you seem knowledgeable about this. Can we get a canonical debugging process or solution which we can mark as the solution so people don’t have to read this entire thread?

Unfortunately I don’t think there is a single solution to this error message as it could have multiple underlying causes. What’s most useful I think is to try the following steps to fix the problem and if it still doesn’t work to use the latter debugging info:

  1. try restarting snapd
sudo systemctl restart snapd snapd.socket
  1. try reloading systemd’s daemon state
sudo systemctl daemon-reload
  1. Try just rebooting the machine
sudo reboot
  1. gather snapd logs / state
sudo journalctl --no-pager -u snapd
sudo snap version
sudo snap changes
sudo snap debug state /var/lib/snapd/state.json

If folks get to step 4 and things still are not working, please create a new forum topic with the debugging info from step 4 in the #snapd category and we will have a look.

7 Likes

am having the same exact issue…i have tried everything on this thread and no luck, this is kinda silly, how could this be so problematic?

it is not … for 99.99% of the users :wink:

collect the data ian asked for so it can be debugged what is wrong with your system …

wish i could, most of it fails

$ sudo journalctl --no-pager -u snapd
– Logs begin at Mon 2020-10-19 09:13:23 EDT, end at Mon 2020-10-19 09:45:32 EDT. –
– No entries –
imrj@mx-19:/usr/lib/systemd/system
$ sudo snap version
snap 2.37.4-1+b1
snapd unavailable
series -
imrj@mx-19:/usr/lib/systemd/system
$ sudo snap changes
error: cannot communicate with server: Get http://localhost/v2/changes?select=all: dial unix /run/snapd.socket: connect: no such file or directory
imrj@mx-19:/usr/lib/systemd/system
$ sudo snap debug state /var/lib/snapd/state.json
error: unknown command “debug”, see ‘snap help’
imrj@mx-19:/usr/lib/systemd/system

this is definitely unexpected, this command does not need snapd to run and it should still report distro name and kernel version here.

the output indicates that whatever distro you use does not follow certain standards … what distro is this ?

Can you post the output of systemctl snapd.socket ?

i guess you mean systemctl status snapd.socket
(my suspicion would be that this is a system that doesnt (fully ?) use systemd though)