Snapd is unavailable on Centos7

I installed snapd on CentOs7and it is showing running, but when wanna install a package or checking version it shows snapd is not available, and when wanna install sth with snap or doing snap ack it says: cannot communicate with server: timeout exceeded while waiting for response; could please tell me what should I do? by the way, I removed with: rpm -e snapd and reinstall it again but still has the same problem. also used binary .rpm file and install it and had the same problem mentioned…

You can see versions installed and commands and logs following:

[root@localhost ~]# systemctl restart snapd [root@localhost ~]# systemctl status snapd ● snapd.service - Snap Daemon Loaded: loaded (/usr/lib/systemd/system/snapd.service; disabled; vendor preset: disabled) Active: active (running) since Mon 2021-12-20 16:14:42 +0330; 8s ago Main PID: 2096 (snapd) CGroup: /system.slice/snapd.service └─2096 /usr/libexec/snapd/snapd

Dec 20 16:14:42 localhost.localdomain systemd[1]: Starting Snap Daemon… Dec 20 16:14:42 localhost.localdomain snapd[2096]: AppArmor status: apparmor not enabled Dec 20 16:14:42 localhost.localdomain snapd[2096]: patch.go:63: Patching system state level 6 to sublevel 1… Dec 20 16:14:42 localhost.localdomain snapd[2096]: patch.go:63: Patching system state level 6 to sublevel 2… Dec 20 16:14:42 localhost.localdomain snapd[2096]: patch.go:63: Patching system state level 6 to sublevel 3… Dec 20 16:14:42 localhost.localdomain snapd[2096]: daemon.go:242: started snapd/2.53.4-1.el7 (series 16; classic; …86_. Dec 20 16:14:42 localhost.localdomain snapd[2096]: daemon.go:335: adjusting startup timeout by 30s (pessimistic es…nap) Dec 20 16:14:42 localhost.localdomain systemd[1]: Started Snap Daemon. Hint: Some lines were ellipsized, use -l to show in full.


[root@localhost ~]# snap --version snap 2.53.4-1.el7 snapd unavailable series -

[root@localhost Microk8s-Offline]# snap ack core_11993.assert error: cannot assert: cannot communicate with server: timeout exceeded while waiting for response

[root@localhost Microk8s-Offline]# journalctl -u snapd – Logs begin at Mon 2021-12-20 15:26:07 +0330, end at Mon 2021-12-20 17:01:01 +0330. – Dec 20 15:28:50 localhost.localdomain systemd[1]: Starting Snap Daemon… Dec 20 15:28:50 localhost.localdomain snapd[1778]: AppArmor status: apparmor not enabled Dec 20 15:28:50 localhost.localdomain snapd[1778]: daemon.go:242: started snapd/2.53.4-1.el7 (series 16; classic; devmode Dec 20 15:28:50 localhost.localdomain snapd[1778]: daemon.go:335: adjusting startup timeout by 30s (pessimistic estimate Dec 20 15:28:50 localhost.localdomain systemd[1]: Started Snap Daemon. Dec 20 15:53:15 localhost.localdomain systemd[1]: Stopping Snap Daemon… Dec 20 15:53:15 localhost.localdomain snapd[1778]: main.go:155: Exiting on terminated signal. Dec 20 15:54:45 localhost.localdomain systemd[1]: snapd.service stop-sigterm timed out. Killing. Dec 20 15:54:45 localhost.localdomain systemd[1]: snapd.service: main process exited, code=killed, status=9/KILL Dec 20 15:54:45 localhost.localdomain systemd[1]: Stopped Snap Daemon. Dec 20 15:54:45 localhost.localdomain systemd[1]: Unit snapd.service entered failed state. Dec 20 15:54:45 localhost.localdomain systemd[1]: Triggering OnFailure= dependencies of snapd.service. Dec 20 15:54:45 localhost.localdomain systemd[1]: snapd.service failed. Dec 20 16:11:19 localhost.localdomain systemd[1]: Starting Snap Daemon… Dec 20 16:11:19 localhost.localdomain snapd[2037]: AppArmor status: apparmor not enabled Dec 20 16:11:19 localhost.localdomain snapd[2037]: daemon.go:242: started snapd/2.53.4-1.el7 (series 16; classic; devmode Dec 20 16:11:19 localhost.localdomain snapd[2037]: daemon.go:335: adjusting startup timeout by 30s (pessimistic estimate Dec 20 16:11:19 localhost.localdomain snapd[2037]: helpers.go:105: error trying to compare the snap system key: system-ke Dec 20 16:11:19 localhost.localdomain systemd[1]: Started Snap Daemon. Dec 20 16:13:12 localhost.localdomain systemd[1]: Stopping Snap Daemon… Dec 20 16:13:12 localhost.localdomain snapd[2037]: main.go:155: Exiting on terminated signal. Dec 20 16:14:42 localhost.localdomain systemd[1]: snapd.service stop-sigterm timed out. Killing. Dec 20 16:14:42 localhost.localdomain systemd[1]: snapd.service: main process exited, code=killed, status=9/KILL Dec 20 16:14:42 localhost.localdomain systemd[1]: Stopped Snap Daemon. Dec 20 16:14:42 localhost.localdomain systemd[1]: Unit snapd.service entered failed state. Dec 20 16:14:42 localhost.localdomain systemd[1]: Triggering OnFailure= dependencies of snapd.service. Dec 20 16:14:42 localhost.localdomain systemd[1]: snapd.service failed. Dec 20 16:14:42 localhost.localdomain systemd[1]: Starting Snap Daemon… Dec 20 16:14:42 localhost.localdomain snapd[2096]: AppArmor status: apparmor not enabled Dec 20 16:14:42 localhost.localdomain snapd[2096]: patch.go:63: Patching system state level 6 to sublevel 1… Dec 20 16:14:42 localhost.localdomain snapd[2096]: patch.go:63: Patching system state level 6 to sublevel 2… Dec 20 16:14:42 localhost.localdomain snapd[2096]: patch.go:63: Patching system state level 6 to sublevel 3… Dec 20 16:14:42 localhost.localdomain snapd[2096]: daemon.go:242: started snapd/2.53.4-1.el7 (series 16; classic; devmode Dec 20 16:14:42 localhost.localdomain snapd[2096]: daemon.go:335: adjusting startup timeout by 30s (pessimistic estimate Dec 20 16:14:42 localhost.localdomain systemd[1]: Started Snap Daemon.


[root@localhost ~]# cat /etc/*-release CentOS Linux release 7.9.2009 (Core) NAME=“CentOS Linux” VERSION=“7 (Core)” ID=“centos” ID_LIKE=“rhel fedora” VERSION_ID=“7” PRETTY_NAME=“CentOS Linux 7 (Core)” ANSI_COLOR=“0;31” CPE_NAME=“cpe:/o:centos:centos:7” HOME_URL=“https://www.centos.org/” BUG_REPORT_URL=“https://bugs.centos.org/

CENTOS_MANTISBT_PROJECT=“CentOS-7” CENTOS_MANTISBT_PROJECT_VERSION=“7” REDHAT_SUPPORT_PRODUCT=“centos” REDHAT_SUPPORT_PRODUCT_VERSION=“7”

CentOS Linux release 7.9.2009 (Core) CentOS Linux release 7.9.2009 (Core)

Best; Sal

I found the answer, must stop firewalld and SELinux… or config them such that connection can establishes…

Found an SELinux related issue. See Snap.d error: cannot communicate with server connection refused for a fix for that

And you might want to enable your firewall and SELinux again

1 Like