Unable to install certbot

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?

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 ~]$

Something seems terribly wrong with your system.
Please show:
df -h
[while it is having trouble]

How do I run df -h while waiting for the command to timeout?

Or did you mean right after I get the timeout error?

This is what I get:

[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 ~]$ df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        1.9G     0  1.9G   0% /dev
tmpfs           1.9G     0  1.9G   0% /dev/shm
tmpfs           1.9G  8.5M  1.9G   1% /run
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/sda2        20G  2.7G   18G  14% /
/dev/sda1       200M   12M  189M   6% /boot/efi
tmpfs           379M     0  379M   0% /run/user/1001
tmpfs           379M     0  379M   0% /run/user/0
[dokgu@domain ~]$ sudo snap install core; sudo snap refresh core
df -h
error: cannot communicate with server: timeout exceeded while waiting for response

I'm not sure what the problem is.
And I'm definitely sure that I would not want to case it down any rabbit hole either.
Can you just blow that VM away and start a fresh one?

1 Like

I could since it is new but this is already the second VM I created since I already blew up the first one where I first encountered this issue.and I'm guessing if I re-create another one, I'll have the same issue. Unless I do something different when I create a new VM, I don't think anything will change. What that change is, I really don't know.

Basically when I created the VM from Google Compute Engine, I went to the marketplace and selected CentOS 7 and clicked on the "Launch" button. From there I basically just enabled HTTP and HTTPS and selected the zone and added a hostname, and I believe those are the only custom settings I put on it.

Not sure if this is going to help but this is a bit of information about the VM:

Would you paste the output of the systemctl status snapd.socket command, please?

1 Like

Are there any other options you can work with (other than CentOS 7) ?

1 Like

Here you go:

[dokgu@domain ~]$ sudo systemctl status snapd.socket
● snapd.socket - Socket activation for snappy daemon
   Loaded: loaded (/usr/lib/systemd/system/snapd.socket; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2021-12-30 06:48:15 UTC; 8h ago
   Listen: /run/snapd.socket (Stream)
           /run/snapd-snap.socket (Stream)

Dec 30 06:48:15 domain systemd[1]: Starting Socket activation for snappy daemon.
Dec 30 06:48:15 domain systemd[1]: Listening on Socket activation for snappy daemon.

Yeah for sure, I could always try Ubuntu. Do you think this is more of an OS issue rather than a hardware issue? I believe the VM had 2 CPUs and 4GB memory. I was thinking that might not have been enough. I'm not really sure.

Definitely NOT a hardware issue.

1 Like

Thanks, that seems to be fine. Do you have working outbound access towards the Internet? What does the command curl 'http://ifconfig.me/' give?

2 Likes

Unfortunately I already nuked the VM and started with Ubuntu 20.04 and I am able to install certbot there. I do have another issue with the challenges but I will post a separate question for that. Thanks!

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.