Bug 1726382 - Snapd support currently broken , missing links to /usr/lib/snapd
Summary: Snapd support currently broken , missing links to /usr/lib/snapd
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: snapd
Version: epel7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Zygmunt Krynicki
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-02 17:46 UTC by Eugene Kanter
Modified: 2019-07-08 02:49 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-07-08 02:49:37 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1536895 0 unspecified CLOSED Snapd support currently broken , missing links to /usr/lib/snapd 2021-02-22 00:41:40 UTC

Description Eugene Kanter 2019-07-02 17:46:15 UTC
Description of problem:

Same as Bug 1536895 which has been fixed by releasing snapd-2.30-1 a year and a half ago. But EPEL is on snapd-2.39.2-1 and exhibits  the same missing link problem. Please update.

Comment 1 Zygmunt Krynicki 2019-07-03 09:59:29 UTC
Thank you for the report. We will check this out.

Comment 2 Maciek Borzecki 2019-07-03 10:13:15 UTC
There should never be a link /usr/libexec/snapd -> /usr/lib/snapd. Can you post the actual error message, which snap is causing this and what is the actual distro you are using snapd from EPEL on?

Things seem to be just fine on CentOS 7:

google:centos-7-64 .../mini/hello# cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core) 
google:centos-7-64 .../mini/hello# rpm -qa \*snapd\*                                                                                                                          
snapd-2.39.2-1.el7.x86_64                                                              
snapd-selinux-2.39.2-1.el7.noarch
Hello World!
google:centos-7-64 .../mini/hello# snap install test-snapd-tools
test-snapd-tools 1.0 from Canonical✓ installed
google:centos-7-64 .../mini/hello# test-snapd-tools.cmd echo foo
foo
google:centos-7-64 .../mini/hello# snap install lxd
lxd 3.14 from Canonical✓ installed
google:centos-7-64 .../mini/hello# lxd init --auto
google:centos-7-64 .../mini/hello# lxc list
To start your first container, try: lxc launch ubuntu:18.04

+------+-------+------+------+------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------+-------+------+------+------+-----------+
google:centos-7-64 .../mini/hello#

Comment 3 Eugene Kanter 2019-07-03 23:47:03 UTC
# yum install snapd
....
Installed:
  snapd.x86_64 0:2.39.2-1.el7                                                                                                     

Dependency Installed:
  snap-confine.x86_64 0:2.39.2-1.el7   snapd-selinux.noarch 0:2.39.2-1.el7  
  squashfuse.x86_64 0:0.1.102-1.el7    squashfuse-libs.x86_64 0:0.1.102-1.el7  

Complete!
# snap install helloworld
error: cannot communicate with server: Post http://localhost/v2/snaps/helloworld: dial unix /run/snapd.socket: connect: no such file or directory
# systemctl start snapd
Job for snapd.service failed because the control process exited with error code. See "systemctl status snapd.service" and "journalctl -xe" for details.
# systemctl status snapd.service
● snapd.service - Snappy daemon
   Loaded: loaded (/usr/lib/systemd/system/snapd.service; disabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Wed 2019-07-03 19:33:34 EDT; 19s ago
  Process: 25980 ExecStart=/usr/libexec/snapd/snapd (code=exited, status=1/FAILURE)
 Main PID: 25980 (code=exited, status=1/FAILURE)
...
# systemctl status snapd.socket
● snapd.socket - Socket activation for snappy daemon
   Loaded: loaded (/usr/lib/systemd/system/snapd.socket; disabled; vendor preset: disabled)
   Active: active (listening) since Wed 2019-07-03 19:33:33 EDT; 1min 4s ago
   Listen: /run/snapd.socket (Stream)
           /run/snapd-snap.socket (Stream)
...
...
# /usr/libexec/snapd/snapd
AppArmor status: apparmor not enabled
cannot run daemon: cannot obtain snap-seccomp version information: fork/exec /usr/lib/snapd/snap-seccomp: no such file or directory
#

Comment 4 Maciek Borzecki 2019-07-04 05:23:17 UTC
Which distro is this? Please post the contents of /etc/os-release.

Comment 5 Eugene Kanter 2019-07-04 14:11:09 UTC
This is private CentOS derivative and /etc/os-release does not say ID=fedora which snap patch https://github.com/snapcore/snapd/commit/fbfee0ea2b7c43de58b2091ee231cc988a9ef925 expects.
Why would EPEL provided snap package perform completely unnecessary /etc/os-release lookup when EPEL packages are built exclusively for RHEL and its derivatives?

Comment 6 Maciek Borzecki 2019-07-05 09:29:53 UTC
Only some snapd components can be configured at build time. Other bits rely on run-time detection. Hopefully, we'll be able to do away with the run time mechanism in the future, but currently we rely on some of the basic distro setup to figure out things right.

Fedora, and other distributions sharing the same layout, commonly use /usr/libexec/<packagename> as the location of package specific internal tools. The fact that these distributions are alike to certain extent, is expressed by setting ID_LIKE=".. fedora .." in /etc/os-release. RHEL, CentOS and Amazon Linux 2 already do that. if your distro has not diverged too much, would you consider adding it too?

Comment 7 Eugene Kanter 2019-07-05 22:03:55 UTC
I understand that generic snapd may need to do some run-time detection but EPEL compiled exclusively for well known RHEL/CentOS layout there is no need to do any kind of run-time OS lookup whatsoever.
Your workaround worked, copied ID_LIKE line from CentOS and snapd started. But please consider eliminating run-time lookup in EPEL packages. Thank you.

Comment 8 Neal Gompa 2019-07-06 13:02:20 UTC
(In reply to Eugene Kanter from comment #7)
> I understand that generic snapd may need to do some run-time detection but
> EPEL compiled exclusively for well known RHEL/CentOS layout there is no need
> to do any kind of run-time OS lookup whatsoever.
> Your workaround worked, copied ID_LIKE line from CentOS and snapd started.
> But please consider eliminating run-time lookup in EPEL packages. Thank you.

I don't think we can reasonably do so. Snapd is primarily written in Go, and Go's ability to handle compile-time conditionals is pretty poor. The reason snapd has so many runtime conditionals is because the language and tooling makes it pretty difficult to do otherwise.

Comment 9 Eugene Kanter 2019-07-07 00:54:42 UTC
I simply meant to say that that EPEL package should apply a patch to eliminate any run-time conditionals.

For example EPEL package spec file defines directory structure at build time

--with-snap-mount-dir=%{_sharedstatedir}/snapd/snap

and thus spec file should patch snapd code to match package directory structure without a need for run-time lookup.

Comment 10 Neal Gompa 2019-07-08 02:49:37 UTC
The philosophy of upstream is that they want to move away from compile time checks to runtime checks as code is converted from C to Go, for the reason outlined earlier. It is unlikely I will be able to convince them otherwise, and I'm not sure I want to, as doing so would inhibit things like having a Fedora based core snap running on non-RH/Fedora systems.


Note You need to log in before you can comment on or make changes to this bug.