Snap.d error: cannot communicate with server connection refused - cannot install nor run p3x-onenote

Hi there. New here.

I’m trying to install p3x-onenote and now snapd is giving an error saying that it cannot communicate with the server, connection refused.

Here are some outputs:
# cat /etc/os-release
NAME=“Ubuntu”
VERSION=“16.04.5 LTS (Xenial Xerus)”
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME=“Ubuntu 16.04.5 LTS”
VERSION_ID=“16.04”
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial

# systemctl status snapd.socket
    ● snapd.socket - Socket activation for snappy daemon
       Loaded: loaded (/lib/systemd/system/snapd.socket; enabled; vendor preset: enabled)
       Active: inactive (dead)
       Listen: /run/snapd.socket (Stream)

    Jan 30 21:36:39 caelinuxz420 systemd[1]: Failed to listen on Socket activation for snappy daemon.
    Jan 30 21:41:53 caelinuxz420 systemd[1]: Closed Socket activation for snappy daemon.
    Jan 30 21:45:24 caelinuxz420 systemd[1]: snapd.socket: Socket service snapd.service not loaded, refusing.
    Jan 30 21:45:24 caelinuxz420 systemd[1]: Failed to listen on Socket activation for snappy daemon.
    Jan 30 21:45:36 caelinuxz420 systemd[1]: Closed Socket activation for snappy daemon.
    Jan 30 21:46:27 caelinuxz420 systemd[1]: snapd.socket: Socket service snapd.service not loaded, refusing.
    Jan 30 21:46:27 caelinuxz420 systemd[1]: Failed to listen on Socket activation for snappy daemon.
    Jan 30 21:47:30 caelinuxz420 systemd[1]: Closed Socket activation for snappy daemon.
    Jan 30 21:50:06 caelinuxz420 systemd[1]: snapd.socket: Socket service snapd.service not loaded, refusing.
    Jan 30 21:50:06 caelinuxz420 systemd[1]: Failed to listen on Socket activation for snappy daemon.

# journalctl -xe
    Jan 30 21:50:06 caelinuxz420 systemd[1]: snapd.socket: Socket service snapd.service not loaded, refusing.
    Jan 30 21:50:06 caelinuxz420 systemd[1]: Failed to listen on Socket activation for snappy daemon.
    -- Subject: Unit snapd.socket has failed
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    -- 
    -- Unit snapd.socket has failed.
    -- 
    -- The result is failed.

# journalctl -u snapd.service
    -- Logs begin at Tue 2020-01-28 23:31:03 EST, end at Thu 2020-01-30 21:52:25 EST. --
    Jan 28 23:31:03 caelinuxz420 systemd[1]: Starting Snappy daemon...
    Jan 28 23:31:04 caelinuxz420 snapd[891]: AppArmor status: apparmor is enabled and all features are available
    Jan 28 23:31:04 caelinuxz420 snapd[891]: 2020/01/28 23:31:04.178684 backend.go:112: snapd enabled NFS support, additional implicit
    Jan 28 23:31:04 caelinuxz420 snapd[891]: 2020/01/28 23:31:04.442977 daemon.go:343: started snapd/2.34.2 (series 16; classic) ubunt
    Jan 28 23:31:04 caelinuxz420 systemd[1]: Started Snappy daemon.
    Jan 28 23:31:04 caelinuxz420 snapd[891]: 2020/01/28 23:31:04.444933 stateengine.go:101: state ensure error: Get https://api.snapcr
    Jan 30 21:30:11 caelinuxz420 snapd[891]: 2020/01/30 21:30:11.313702 api.go:1046: Installing snap "p3x-onenote" revision unset
    Jan 30 21:30:26 caelinuxz420 snapd[891]: 2020/01/30 21:30:26.600752 autorefresh.go:387: auto-refresh: all snaps are up-to-date
    Jan 30 21:33:37 caelinuxz420 snapd[891]: 2020/01/30 21:33:37.135506 api.go:1046: Installing snap "p3x-onenote" revision unset
    Jan 30 21:34:35 caelinuxz420 systemd[1]: Stopping Snappy daemon...
    Jan 30 21:34:35 caelinuxz420 snapd[891]: 2020/01/30 21:34:35.565492 main.go:81: Exiting on terminated signal.
    Jan 30 21:34:35 caelinuxz420 systemd[1]: Stopped Snappy daemon.

I’ve also tried uninstalling and re-installing p3x-onenote as well as uninstall and reinstall snapd but when it gets to trying to start the snap.socket, this is where and when it fails when I try to reinstall it.

Any help that the team would be able to provide in regards to how I can correct this issue would be greatly appreciated.

(I got the idea to run those commands from the other posts that I was able to find here, and tried them, and still to no avail, hence why I am starting yet another new topic with this error message.)

Thank you.

Are you running some exotic kernel ?
What is the output of the snap version command ?

Nope.

Output of uname -a:
Linux caelinuxz420 4.10.0-35-generic #39~16.04.1-Ubuntu SMP Wed Sep 13 09:02:42 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Output of snap version:
error: Unknown command 'version'. Please specify one command of: abort, ack, changes, connect, disconnect, find, install, interfaces, known, list, login, logout, refresh or remove

Output of `sudo apt install snapd`:
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    snapd is already the newest version (2.0.2).

2.0.2 is not the “newest version” in 16.04.5 on amd64: it’s 2.37.4 (packages.ubuntu.com/snapd says it’s still 2.0.2 in ports, ie arm and the like, for reasons that escape me).

What’s the output of journalctl -u snapd?

edit to add: there also isn’t a 4.10 linux-image-generic anywhere that I can see

do you actually have the “snap” .deb package installed ???

$ apt-cache show snap|grep -A4 Description-en
Description-en: location of genes from DNA sequence with hidden markov model
 SNAP is a general purpose gene finding program suitable for both eukaryotic
 and prokaryotic genomes. SNAP is an acroynm for Semi-HMM-based Nucleic Acid
 Parser.

If you have this installed, uninstall it … what you want is the snap command coming with the snapd package …

snapd's snap didn’t grow version until 2.0.5 or thereabouts (it had --version though); the error you’re seeing is from that ancient snap.

1 Like

Ah, thanks, i thought it was related to

1 Like

Yeah, but no. That snap package no longer has a snap binary (it’s snap-dna instead), and even when it did its output was very distinctive:

$ snap version

SNAP - Semi-HMM-based Nucleic Acid Parser (version 2006-07-28)

usage: snap [options] <HMM file> <FASTA file> [options]
options:
  -help           report useful information
  -lcmask         treat lowercase as N
  -plus           predict on plus strand only
  -minus          predict on minus strand only
  -gff            output annotation as GFF
  -ace            output annotation as ACED
  -quiet          do not send progress to STDERR
  -aa <file>      create FASTA file of proteins
  -tx <file>      create FASTA file of transcripts
  -xdef <file>    external definitions
  -name <string>  name for the gene [default snap]

The output of that can be found above in my original post, although it showed the output for journalctl -u snapd.service, but when I run it for snapd, it says basically the same thing (just with different timestamps).

ah, sorry, i missed that bit! reading now.

Two other quick notes:

  1. The strange thing about this was that it had worked previously, so I am not really sure why it isn’t working now.

And 2. I am unable to update the system because CAE Linux 2018 is particularly finicky in regards to updates (because if I update the system, some of the CAE applications that are part of this variant of the Xubuntu distro will stop working).

Also 3. when it started to not work and I tried to uninstall it using sudo apt remove snapd, it originally failed because it said that some of the directories (e.g. /snap…) weren’t empty, so I manually removed/unmounted /dev/loop{0…2} in order to try and resolve that.

Not sure if that’s relevant information or not, but then again, I didn’t make much of it when the original attempt at uninstalling failed either.

Thank you.

P.S. I only removed/unmounted those folders/directories/devices manually after the uninstall had failed, and not prior. And the weird thing is that it had worked before, so I am not really sure why it didn’t work (and the extent to which it stopped working) now, even after trying to re-install it.

So I don’t know if there is supposed to be some other procedure that I should following in order to return my system to a state prior to installing snapd for the first time so that I can try and give snapd a relatively “clean slate” to try install again from in hopes that it might work.

try sudo apt purge snapd next time, this will remove the snaps and make sure to clean the directories (apt tries specifically to be clever to not remove application data if you do not purge)

Yes, I tried that as well.

From googling the issue, another thread came up on this forum which suggested:
sudo apt autoremove --purge snapd, so I tried that as well and that too, also failed to remove/uninstall snapd because there was a /dev/loop0 that was point to /snap, so it was unable to uninstall it.

Also note as well that prior to attempting to uninstall snapd, I had attempted to install p3x-onenote and I used snap uninstall p3x-onenote in order to try and clean that up before trying to uninstall snapd and nothing seemed to work like the commands would have or should have otherwise suggest or allude to.

Thank you.

You are safe to update installed packages with sudo apt update && sudo apt upgrade. What you cannot do is switch to Ubuntu 18.04, which would be via sudo do-system-upgrade or the UI prompting you to switch. From the CAELinux GettingStart.html page:

you can safely update the system packages but do not attempt to upgrade to Ubuntu 18.04

That, unfortunately, is not true.

(please see update below)

I spent two days installing, updating, breaking, reinstalling, updating, breaking, reinstalling, NO UPDATING to get that system/distro to work.

If I even remotely attempt to update it, when I use Salome Meca 2018 and try to start the geometry module, I will get this error:
glx: Failed to create context window
Or something along those lines.

I have also tried to update the Nvidia video card driver (I have a EVGA GTX 660 installed in the system) and that didn’t work either. (And then tried permutations of the default driver vs. the Nvidia driver and ended up concluding that after you install CAE Linux 2018, you don’t bother to update ANYTHING and then everything will work as advertised.)

I can’t remember the exact error message.

That and also Freecad will no longer start after the update as well. It will say something along the lines of:
/usr/sbin/freecad not found
Or something like that.

So, after yet another fresh install, I took it to ensure that auto update is completely disabled by editing:
sudo vi /etc/apt/apt.conf.d/20-auto-upgrades

So…yeah, I spent like two-to-three days/two-ish days screwing around with it, trying to get everything to work, and eventually concluded that the most reliable/stable way that OS will run is if you don’t update ANYTHING post-OS installation.

Then everything will work.

(Here is the rest of my system hardware specs: HP Z420 workstation, Intel Xeon E5-2690 (v1, 8-core, HTT disabled, 2.9 GHz base clock, 3.6 GHz max turbo, 3.3 GHz max all-core turbo), 8x 16 GB Samsung DDR3-1600 ECC Reg RAM (128 GB total), EVGA GTX 660, OCZ Vertex 240 GB SATA 6 Gbps SSD. It’s a bit of a random hodge-podge of components because I am testing out the distro and the open source based CAE tools to evaluate whether I can deploy it for production use.)

Thank you.

*update:
So…that statement that I made earlier about the updates breaking the OS distro was true as off a day or two ago.

It would appear that now, when you run the update, it will actually automatically holdback on updating freecad so it stays at version 0.17, which resolves that issue.

Further, a point of clarification:
The glx issue that I think that I was having was probably most likely to be due to the Nvidia driver, from Nvidia as opposed to the OS itself, also I did have a temporary fatal exception issue about an hour ago where I started up Salome Meca 2018, and then ran the updates whilst that was running.

Start Salome Meca 2018 back up again after the updates were fully completed appears to have resolved that. At least for now.

But suffice it to say that I did encounter an issue with the updates and Freecad where version 0.18 would cause the 0.16 version to stop working. So…updates, as it would seem/appear (to the novice user of this platform), is a bit of a hit and miss.

Over the last three to four days, I must have installed and reinstalled CAE Linux between half-a-dozen to a dozen times.

Course, with my recent reinstall of the OS (again – reinstalled it tonight), this probably will render this thread moot, but will also leave this thread without a solution should someone else encounter it again in the future.

Thanks.

(Alternatively, the “not-the-greatest” solution was that I just reinstalled my OS, which I know that most people normally won’t be able to do.)