Open vahid-dan opened 5 years ago
Thank you for the thorough bug report!
I patched in a fix for this over in microstack, but hadn't ported the fix back in to the original snap.
Here's a PR w/ the fix: https://github.com/openstack-snaps/snap-openvswitch/pull/2
Hi @petevg;
Thanks for the quick response. I applied the patch you suggested but there is another error:
$ sudo snap install openvswitch_2.10.0_armhf.snap --devmode
error: cannot perform the following tasks:
- Start snap "openvswitch" (unset) services ([start snap.openvswitch.ovsdb-server.service] failed with exit status 1: Job for snap.openvswitch.ovsdb-server.service failed because the control process exited with error code.
See "systemctl status snap.openvswitch.ovsdb-server.service" and "journalctl -xe" for details.
)
The logs:
$ systemctl status snap.openvswitch.ovsdb-server.service
Unit snap.openvswitch.ovsdb-server.service could not be found.
$ journalctl -xe
Dec 11 06:04:34 ubuntu audit[4261]: AVC apparmor="ALLOWED" operation="open" profile="snap.openvswitch.ovsdb-server//null-/bin/systemctl" name="/proc/4261/stat" pid=4261 comm="systemctl" requested_mask="r"
Dec 11 06:04:34 ubuntu audit[4261]: AVC apparmor="ALLOWED" operation="open" profile="snap.openvswitch.ovsdb-server//null-/bin/systemctl" name="/proc/1/environ" pid=4261 comm="systemctl" requested_mask="r"
Dec 11 06:04:34 ubuntu audit[4261]: AVC apparmor="ALLOWED" operation="capable" profile="snap.openvswitch.ovsdb-server//null-/bin/systemctl" pid=4261 comm="systemctl" capability=19 capname="sys_ptrace"
Dec 11 06:04:34 ubuntu audit[4261]: AVC apparmor="ALLOWED" operation="open" profile="snap.openvswitch.ovsdb-server//null-/bin/systemctl" name="/proc/1/sched" pid=4261 comm="systemctl" requested_mask="r" d
Dec 11 06:04:34 ubuntu audit[4261]: AVC apparmor="ALLOWED" operation="open" profile="snap.openvswitch.ovsdb-server//null-/bin/systemctl" name="/proc/cmdline" pid=4261 comm="systemctl" requested_mask="r" d
Dec 11 06:04:34 ubuntu openvswitch.ovsdb-server[4235]: ovsdb-tool: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.28' not found (required by ovsdb-tool)
Dec 11 06:04:34 ubuntu openvswitch.ovsdb-server[4235]: * /var/snap/openvswitch/common/etc/openvswitch/conf.db does not exist
Dec 11 06:04:34 ubuntu openvswitch.ovsdb-server[4235]: ovsdb-tool: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.28' not found (required by ovsdb-tool)
Dec 11 06:04:34 ubuntu openvswitch.ovsdb-server[4235]: * Creating empty database /var/snap/openvswitch/common/etc/openvswitch/conf.db
Dec 11 06:04:34 ubuntu systemd[1]: snap.openvswitch.ovsdb-server.service: Control process exited, code=exited status=1
Dec 11 06:04:34 ubuntu systemd[1]: snap.openvswitch.ovsdb-server.service: Failed with result 'exit-code'.
Dec 11 06:04:34 ubuntu systemd[1]: Failed to start Service for snap application openvswitch.ovsdb-server.
-- Subject: Unit snap.openvswitch.ovsdb-server.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit snap.openvswitch.ovsdb-server.service has failed.
--
-- The result is RESULT.
Dec 11 06:04:34 ubuntu systemd[1]: snap.openvswitch.ovsdb-server.service: Service hold-off time over, scheduling restart.
Dec 11 06:04:34 ubuntu systemd[1]: snap.openvswitch.ovsdb-server.service: Scheduled restart job, restart counter is at 1.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Automatic restarting of the unit snap.openvswitch.ovsdb-server.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Dec 11 06:04:34 ubuntu systemd[1]: Stopped Service for snap application openvswitch.ovsdb-server.
-- Subject: Unit snap.openvswitch.ovsdb-server.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit snap.openvswitch.ovsdb-server.service has finished shutting down.
Dec 11 06:04:34 ubuntu systemd[1]: Starting Service for snap application openvswitch.ovsdb-server...
-- Subject: Unit snap.openvswitch.ovsdb-server.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit snap.openvswitch.ovsdb-server.service has begun starting up.
Dec 11 06:04:35 ubuntu systemd[1]: Stopped Service for snap application openvswitch.ovsdb-server.
-- Subject: Unit snap.openvswitch.ovsdb-server.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit snap.openvswitch.ovsdb-server.service has finished shutting down.
Dec 11 06:04:41 ubuntu systemd[1]: Reloading.
Dec 11 06:04:44 ubuntu audit[4332]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="/snap/core/6035/usr/lib/snapd/snap-confine" pid=43
Dec 11 06:04:44 ubuntu audit[4332]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="/snap/core/6035/usr/lib/snapd/snap-confine//mount-
Dec 11 06:04:44 ubuntu kernel: kauditd_printk_skb: 51 callbacks suppressed
Dec 11 06:04:44 ubuntu kernel: audit: type=1400 audit(1544508284.082:224): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="/snap/core/6035
Dec 11 06:04:44 ubuntu kernel: audit: type=1400 audit(1544508284.082:225): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="/snap/core/6035
Dec 11 06:04:44 ubuntu audit[4334]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="snap-update-ns.core" pid=4334 comm="apparmor_parse
Dec 11 06:04:44 ubuntu kernel: audit: type=1400 audit(1544508284.110:226): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="snap-update-ns.
Dec 11 06:04:44 ubuntu audit[4335]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="snap.core.hook.configure" pid=4335 comm="apparmor_
Dec 11 06:04:44 ubuntu kernel: audit: type=1400 audit(1544508284.114:227): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="snap.core.hook.
Dec 11 06:04:44 ubuntu systemd-udevd[669]: Network interface NamePolicy= disabled on kernel command line, ignoring.
Dec 11 06:04:44 ubuntu systemd[1]: Reloading.
Dec 11 06:04:47 ubuntu snapd[1213]: handlers.go:394: Reported install problem for "openvswitch" as a94577f2-fd0a-11e8-9734-fa163e102db1 OOPSID
Dec 11 06:04:48 ubuntu sudo[3925]: pam_unix(sudo:session): session closed for user root
Thanks in advance.
Bests, Vahid
I found out the error is caused by base: core18
added to prevent the linker errors on Ubuntu 18.04 Server on Raspberry Pi. I'll try with LXD and cleanbuild
and update you. :-)
@vahid-dan We were just having a discussion about bases and cleanbuild, and I came here to suggest exactly that :-)
Let me know if that doesn't fix things, and I'll see what else I can do.
(Also, a raspberrypi based project sounds like a lot of fun -- I hope that things go well, and good luck!)
@petevg,
I tried hard to install openvswitch snap on Ubuntu 16.04 and 18.04 on RPi with and without LXD and cleanbuild
and none of them was successful. I can create the snap package on Ubuntu 16.04 on RPi but I get errors installing it.
With cleanbuild
, I cannot build the package:
dropping privs did not work
With and without base: core18
, I can build the package but cannot install it:
openvswitch.ovsdb-server[18569]: ovsdb-tool: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.28' not found (required by ovsdb-tool)
My system ldd --version
is 2.28
but for core
is 2.23
and for core18
is 2.27
. I don't know how to update them. Even ldd --version
on edge
release for core is not 2.28
.
If I try to install libc6
as a stage package, I get:
Segmentation fault (core dumped)
Failed to run 'override-pull': Exit code was 139.
Thanks in advance. Vahid
Hi @vahid-dan,
It looks like there's an issue w/ cleanbuild in 16.04, with the deb version of lxd:
https://github.com/snapcore/snapcraft/pull/1912
You should be able to fix it either by grabbing an lxd update from the xenial-backports repo, or by installing lxd from the snap.
If that doesn't unblock you, I'd suggest raising a topic on snapcraft.io forums, as we're moving out of my area of expertise (and also, I'll be on vacation for the next few days).
hth, ~ Pete
Hi;
Using cleanbuild
on snapcraft 3.0.1
and lxd 3.0.3
I got this error:
Could not find a required package in 'build-packages': libnuma-dev
Error: not found
Stopping local:snapcraft-nonfatally-isobaric-kira
An error occurred when trying to copy files using 'lxd': returned exit code 1.
How can I make sure the prerequisite packages will be installed inside the LXD?
Thanks in advance. :-)
Bests, Vahid
@vahid-dan I'm able to do a cleanbuild on a fresh machine running bionic (I also tested with xenial).
I'd say that it's likely one of two things have happened: 1) The lxd machine is having trouble talking to the Internet, and can't fetch packages. 2) You're running on a fresh machine, and didn't run apt update on the host machine.
If you're still having trouble after checking those two things, let me know. That should unblock you, though.
Hi @petevg;
Thanks for your response. I guess I've found the source of the issue: There is no libnuma-dev
for Ubuntu 16.04 and 18.04 on RPi (armhf). So it won't automatically be installed inside the LXD.
https://packages.ubuntu.com/search?keywords=libnuma-dev&searchon=names&suite=all§ion=all
Is there an easy way to install it inside the LXD?
Thanks, Vahid
@vahid-dan Aha! That would explain why the package is missing.
I'm not sure what the absolute best practices are for adding a build time dependency via source. I'd try fetching the debian package via wget, and installing it with dpkg. To do so, edit snapcraft.yaml, and add an override-build section to the openvswitch part:
...
parts:
...
openvswitch:
...
override-build: |
wget https://<url of libnuma-dev package> .
sudo dpkg --install ./<libnuma-dev>.dpkg
snapcraftctl build
Basically, you doing what you need to do in order to install the package, then running the normal snapcraft build step.
If nobody has built a debian package, you could technically install the dependency from source in the same way.
Hi;
I'm trying to build and install the snap but I encounter the following error:
Here are the logs:
Thanks, Vahid