I have created a new VM on Google Compute Engine with CentOS 7 and installed Apache and it is working. I am now in the process of enabling HTTPS on this VM through Let’s Encrypt certbot.
I followed the instructions on how to install snapd on to my server. When I’m done I usually go and verify that it’s working:
[dokgu@domain ~]$ sudo snap version
snap 2.53.4-1.el7
snapd 2.53.4-1.el7
series 16
centos 7
kernel 3.10.0-1160.45.1.el7.x86_64
However I’d like to mention that this command most of the time takes a while to return anything and when it does I get this:
[dokgu@domain ~]$ sudo snap version
snap 2.53.4-1.el7
snapd unavailable
series -
This also always happens when I try to move forward with the instruction where it says to verify that I have the latest version of snapd.
[dokgu@domain ~]$ sudo snap install core; sudo snap refresh core
error: cannot communicate with server: timeout exceeded while waiting for response
error: cannot communicate with server: timeout exceeded while waiting for response
[dokgu@domain ~]$
The same error comes up when I ignore the verification and proceed to install the certbot.
[dokgu@domain ~]$ sudo snap install --classic certbot
error: cannot communicate with server: timeout exceeded while waiting for response
error: cannot communicate with server: timeout exceeded while waiting for response
[dokgu@domain ~]$
How do I fix this issue?
Update
Cheking the status of snapd
gives me this:
[dokgu@domain ~]$ sudo systemctl status snapd
● snapd.service - Snap Daemon
Loaded: loaded (/usr/lib/systemd/system/snapd.service; disabled; vendor preset: disabled)
Active: active (running) since Thu 2021-12-30 04:35:54 UTC; 18min ago
Main PID: 28505 (snapd)
CGroup: /system.slice/snapd.service
└─28505 /usr/libexec/snapd/snapd
Dec 30 04:35:54 domain systemd[1]: Starting Snap Daemon...
Dec 30 04:35:54 domain snapd[28505]: AppArmor status: apparmor not enabled
Dec 30 04:35:54 domain snapd[28505]: daemon.go:242: started snapd/2.53.4-1.el7 (series 16; classic; dev...x86_.
Dec 30 04:35:54 domain snapd[28505]: daemon.go:335: adjusting startup timeout by 30s (pessimistic estim...snap)
Dec 30 04:35:54 domain snapd[28505]: helpers.go:105: error trying to compare the snap system key: syste... disk
Dec 30 04:35:54 domain systemd[1]: Started Snap Daemon.
Hint: Some lines were ellipsized, use -l to show in full.
[dokgu@domain ~]$
2
Answers
I just resolved a similar problem. /var was out of space, and journalctl -xe identified the problem as such. After extending the volume (LVM) and resize2fs, snapd started immediately. This would have been difficult to analyze if the logs themselves were not being written out. I’m not certain if journalctl is reporting in-memory records, but it did answer the question. I would start there.
not sure why the domain is timing out, you would have to inspect dns queries, network traffic and certbot logs to troubleshoot further.
did you try installing from the epel-release repository instead?
https://pocketadmin.tech/en/install-certbot-on-centos/