Crossbuilder issues

I’m trying to cross-build a plugin, but can’t seem to get the container to run.

My steps so far:

cd project_directory
crossbuilder -a armhf -u stretch

This leads to the following output:

crossbuilder -a armhf -u stretch
Using DEB_BUILD_PROFILES: nocheck nodoc noautodbgsym
\033[0;32mBuilding nymea-plugin-ws281xspi for armhf and deploying to device.\033[0m
\033[0;32mCreating LXD container nymea-plugin-ws281xspi-stretch-amd64-armhf using nymea:nymea-builder-stretch-amd64-armhf.\033[0m
Error: Remote nymea exists as https://jenkins.nymea.io:8443
Creating nymea-plugin-ws281xspi-stretch-amd64-armhf
Error: Failed to run: /snap/lxd/current/bin/lxd forkstart nymea-plugin-ws281xspi-stretch-amd64-armhf /var/snap/lxd/common/lxd/containers /var/snap/lxd/common/lxd/logs/nymea-plugin-ws281xspi-stretch-amd64-armhf/lxc.conf:
Try lxc info --show-log nymea-plugin-ws281xspi-stretch-amd64-armhf for more info

The lxc info command yields the following information:

Name: nymea-plugin-ws281xspi-stretch-amd64-armhf
Location: none
Remote: unix://
Architecture: x86_64
Created: 2020/10/07 09:18 UTC
Status: Stopped
Type: container
Profiles: default

Log:

lxc nymea-plugin-ws281xspi-stretch-amd64-armhf 20201007091910.982 WARN     cgfsng - cgroups/cgfsng.c:mkdir_eexist_on_last:1152 - File exists - Failed to create directory "/sys/fs/cgroup/cpuset//lxc.monitor.nymea-plugin-ws281xspi-stretch-amd64-armhf"
lxc nymea-plugin-ws281xspi-stretch-amd64-armhf 20201007091910.983 WARN     cgfsng - cgroups/cgfsng.c:mkdir_eexist_on_last:1152 - File exists - Failed to create directory "/sys/fs/cgroup/cpuset//lxc.payload.nymea-plugin-ws281xspi-stretch-amd64-armhf"
lxc nymea-plugin-ws281xspi-stretch-amd64-armhf 20201007091910.984 ERROR    conf - conf.c:write_id_mapping:2647 - Invalid argument - Failed to write uid mapping to "/proc/256953/uid_map"
lxc nymea-plugin-ws281xspi-stretch-amd64-armhf 20201007091910.984 ERROR    conf - conf.c:lxc_map_ids:2822 - Failed to write mapping: 0 1000000 1000000000
150000 1000 1

lxc nymea-plugin-ws281xspi-stretch-amd64-armhf 20201007091910.984 ERROR    start - start.c:lxc_spawn:1732 - Failed to set up id mapping.
lxc nymea-plugin-ws281xspi-stretch-amd64-armhf 20201007091910.985 ERROR    lxccontainer - lxccontainer.c:wait_on_daemonized_start:850 - Received container state "ABORTING" instead of "RUNNING"
lxc nymea-plugin-ws281xspi-stretch-amd64-armhf 20201007091910.985 ERROR    start - start.c:__lxc_start:1999 - Failed to spawn container "nymea-plugin-ws281xspi-stretch-amd64-armhf"
lxc nymea-plugin-ws281xspi-stretch-amd64-armhf 20201007091910.985 WARN     start - start.c:lxc_abort:1019 - No such process - Failed to send SIGKILL via pidfd 30 for process 256953
lxc 20201007091911.115 WARN     commands - commands.c:lxc_cmd_rsp_recv:124 - Connection reset by peer - Failed to receive response for command "get_state"

It first sounded like an apparmor problem, but I already disabled that for lxc (at least I think so):
My /etc/lxc/default.conf contains:

lxc.net.0.type = veth
lxc.net.0.link = lxcbr0
lxc.net.0.flags = up
lxc.net.0.hwaddr = 00:16:3e:xx:xx:xx
lxc.apparmor.profile = unconfined

Any guess, what might be going wrong here?

I think this is the error message we need to tackle.

What distribution are you running this on? I remember having patched this recently in crossbuilder as the format of the id mapping changed in never versions of lxc. Looks like this is related to those two commits maybe:

Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal

lxc version: 4.0.3

Hmm… weird, I’m running focal too, works fine for me… Are you running the latest version of crossbuilder that includes the above commits?

Also, did you run “crossbuilder setup-lxd” once already?

I’m running lxc version is 4.6. In theory it shouldn’t matter if it’s 4.0.3 or 4.6.

Maybe try to move to latest/stable instead of 4.0/stable and see if that helps.

So far I used the version from the ppa 0.2~focal1. I can also pull the most recent one from Github. Not quite obvious, which commit goes with which version.

I did run crossbuilder setup-lxd.

Which PPA or other source did you get the 4.6 version from? Just so I try to reproduce your procedure.

I just checked the versions and noticed that I didn’t update our release job for focal so that is most likely your issue. I have just updated it and triggered another build. You should get an update now which also includes the build timestamp and git hash in the version field (Don’t be confused by the ~xenial. As this is just a simple script we only build it on xenial and publish it to all distros).

Since Ubuntu 18.04, lxd/lxc is always installed from snap packages even if you apt-get install it. You can check with “snap info lxd” which channel you are tracking. Anyhow, if upgrading crossbuilder fixes this now, you might as well stick to 4.0 I suppose.

Seems to work now, thanks!

1 Like

Good. Thanks for pointing this out.