Help: snapd can't start

Hi, I have a problem with snapd, I can’t figure out what the solution can be, could you please help me?

joyce@workstation:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.6 LTS
Release:	16.04
Codename:	xenial

joyce@workstation:~$ snap version
snap    2.42.1
snapd   unavailable
series  -


joyce@workstation:~$ sudo SNAPD_DEBUG=1 /usr/lib/snapd/snapd
AppArmor status: apparmor is enabled and all features are available
2020/05/03 12:14:00.957905 activation.go:64: DEBUG: socket "/run/snapd.socket" was not activated; listening
2020/05/03 12:14:00.957987 activation.go:64: DEBUG: socket "/run/snapd-snap.socket" was not activated; listening
2020/05/03 12:14:00.958779 daemon.go:346: started snapd/2.42.1 (series 16; classic) ubuntu/16.04 (amd64) linux/4.4.0-178-generic.
2020/05/03 12:14:01.023497 daemon.go:439: adjusting startup timeout by 30s (pessimistic estimate of 30s plus 5s per snap)
2020/05/03 12:14:01.037701 main.go:143: DEBUG: activation done in 85ms
2020/05/03 12:14:06.038396 daemon.go:540: gracefully waiting for running hooks
2020/05/03 12:14:06.038439 daemon.go:542: done waiting for running hooks
daemon stop requested to wait for socket activation

joyce@workstation:~$ journalctl -u snapd
No journal files were found.
-- No entries --

joyce@workstation:~$ sudo service snaptd start
snaptd: unrecognized service

Whether this could relate to hardware? My laptop works well, no this problem. But my desktop has this problem, I use AMD Ryzen 1700 cpu.

joyce@workstation:~$ sudo lshw -C cpu
[sudo] password for joyce: 
  *-cpu                   
       description: CPU
       product: AMD Ryzen 7 1700 Eight-Core Processor
       vendor: Advanced Micro Devices [AMD]
       physical id: 31
       bus info: cpu@0
       version: AMD Ryzen 7 1700 Eight-Core Processor
       serial: Unknown
       slot: AM4
       size: 3GHz
       capacity: 3750MHz
       width: 64 bits
       clock: 100MHz
       capabilities: x86-64 fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_l2 mwaitx cpb hw_pstate ssbd ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 clzero arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic overflow_recov succor smca cpufreq
       configuration: cores=8 enabledcores=8 threads=16

Thanks for your help.

I don’t know about the rest but it’s snapd, not snaptd.

Do you have any snaps installed? Snapd will automatically shut itself down if there are no snaps installed. Try installing the hello-world snap with snap install hello-world.

Hi, my bad, just a typo, but result the same

joyce@workstation:~$ sudo service snapd start
snapd: unrecognized service

Hi, I can’t install anything by snap. It seems snapd daemon doesn’t start correctly.

joyce@workstation:~$ snap install hello-world
error: cannot communicate with server: Post http://localhost/v2/snaps/hello-world: dial unix /run/snapd.socket: connect: no such file or directory

whats the output of uname -a ?

Hi, here it is

joyce@workstation:~$ uname -a
Linux workstation 4.4.0-178-generic #208-Ubuntu SMP Sun Apr 5 23:45:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

you want systemctl start snapd not service snapd start

Hi, thanks, I do really found something wrong with my systemctl.

joyce@workstation:~$ systemctl start snapd
Failed to add /run/systemd/ask-password to directory watch: No such file or directory
Failed to start snapd.service: Unknown unit: snapd.service
See system logs and 'systemctl status snapd.service' for details.

My installed systemd is not complete, I tried to reinstall it again, it obvisously something wrong going on. I’ll try to figure it out. Before reinstall:

joyce@workstation:~$ ll /run/systemd/
total 0
drwxr-xr-x  6 root root  120 Mai  2 22:13 ./
drwxr-xr-x 30 root root 1140 Mai  4 08:38 ../
drwxr-xr-x  2 root root  240 Mai  4 13:31 inhibit/
drwxr-xr-x  2 root root   60 Mai  2 22:13 seats/
drwxr-xr-x  2 root root  140 Mai  2 22:13 sessions/
drwxr-xr-x  2 root root   80 Mai  2 22:13 users/

When I reinstall:

joyce@workstation:~$ sudo apt-get install --reinstall systemd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 3.799 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 systemd amd64 229-4ubuntu21.27 [3.799 kB]
Fetched 3.799 kB in 1s (2.975 kB/s)  
(Reading database ... 386846 files and directories currently installed.)
Preparing to unpack .../systemd_229-4ubuntu21.27_amd64.deb ...
Unpacking systemd (229-4ubuntu21.27) over (229-4ubuntu21.27) ...
Processing triggers for ureadahead (0.100.0-19.1) ...
ureadahead will be reprofiled on next reboot
Processing triggers for dbus (1.10.6-1ubuntu3.5) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up systemd (229-4ubuntu21.27) ...
addgroup: The group `systemd-journal' already exists as a system group. Exiting.
Operation failed: No such file or directory
[/usr/lib/tmpfiles.d/var.conf:14] Duplicate line for path "/var/log", ignoring.

After I reinstall:

joyce@workstation:~$ ll /run/systemd/
total 4
drwxr-xr-x 10 root            root             220 Mai  4 14:10 ./
drwxr-xr-x 31 root            root            1180 Mai  4 14:10 ../
drwxr-xr-x  2 root            root              40 Mai  4 14:10 ask-password/
drwxr-xr-x  2 root            root             240 Mai  4 14:10 inhibit/
drwxr-xr-x  2 root            root              40 Mai  4 14:10 machines/
drwxr-xr-x  4 systemd-network systemd-network   80 Mai  4 14:10 netif/
drwxr-xr-x  2 root            root              60 Mai  2 22:13 seats/
drwxr-xr-x  2 root            root             140 Mai  2 22:13 sessions/
drwxr-xr-x  2 root            root              40 Mai  4 14:10 shutdown/
drwxr-xr-x  2 root            root              80 Mai  2 22:13 users/
-rw-r--r--  1 root            root              72 Mai  4 14:09 was-enabled

I compared this directory with the one in my laptop, a lot missing.

you probably want to put a sudo in front next time ?

thanks, :innocent:

joyce@workstation:~$ sudo systemctl start snapd
Failed to start snapd.service: Unknown unit: snapd.service
See system logs and 'systemctl status snapd.service' for details.

looks like a more systemic issue, I’d try re-installing the snapd package like you did with systemd above …

I have tried installing snapd service on my Debian 10 lxd container.

however, I was not able to run snap install core

root@server:~# snap install core
error: cannot communicate with server: Post "http://localhost/v2/snaps/core": dial unix /run/snapd.socket: connect: no such file or directory

since systemd is disabled on this container for other reasons I cannot run systemctl start snapd.service.

Instead, I tried service snapd start but I am getting package error.

root@server:~# service snapd status
snapd: unrecognized service

can you please help me with this?

i fear systemd is currently a hard requirement. not only to make snapd start but also to install and run snaps (snap packaged daemons create system units, instaling a snap creates a system mount unit for the squashfs snap file)

You are facing this issues b’cos of the Graphic card It’ll we work with Nvidia CUDA GPU!!