Problems with build-snaps on build.snapcraft.io

Hey,

I’m trying to use build.snapcraft.io for a snap using build-snaps.
Unfortunately though it fails and I get these error messages I don’t get when building in a local lxc container:

e[Kerror: cannot perform the following tasks:
- Setup snap "core" (3247) security profiles (cannot setup apparmor for snap "core": cannot load apparmor profile "snap.core.hook.configure": cannot load apparmor profile: exit status 243
apparmor_parser output:
apparmor_parser: Unable to replace "snap.core.hook.configure".  Permission denied; attempted to load a profile while confined?
)
- Setup snap "core" (3247) security profiles (cannot load apparmor profile "snap.core.hook.configure": cannot load apparmor profile: exit status 243
apparmor_parser output:
apparmor_parser: Unable to replace "snap.core.hook.configure".  Permission denied; attempted to load a profile while confined?
)
...                                                    
Error while installing snap 'liri-platform-0-9' from channel 'latest/edge'
Build failed
Traceback (most recent call last):
  File "/usr/lib/launchpad-buildd/lpbuildd/target/build_snap.py", line 216, in run
    self.pull()
  File "/usr/lib/launchpad-buildd/lpbuildd/target/build_snap.py", line 178, in pull
    env=env)
  File "/usr/lib/launchpad-buildd/lpbuildd/target/build_snap.py", line 87, in run_build_command
    ["/bin/sh", "-c", command], get_output=get_output, echo=echo)
  File "/usr/lib/launchpad-buildd/lpbuildd/target/lxd.py", line 427, in run
    subprocess.check_call(cmd, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
    raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '['lxc', 'exec', 'lp-xenial-amd64', '--', 'linux64', '/bin/sh', '-c', 'cd /build/6dc282f722b395eb2c2d1cf958dd0d40-xenial && env LANG=C.UTF-8 SHELL=/bin/sh SNAPCRAFT_LOCAL_SOURCES=1 SNAPCRAFT_SETUP_CORE=1 http_proxy=http://snap-proxy.launchpad.net:3128 https_proxy=http://snap-proxy.launchpad.net:3128 GIT_PROXY_COMMAND=/usr/local/bin/snap-git-proxy snapcraft pull']' returned non-zero exit status 2
Revoking proxy token...
RUN: /usr/share/launchpad-buildd/slavebin/in-target scan-for-processes --backend=lxd --series=xenial --arch=amd64 SNAPBUILD-104071
Scanning for processes to kill in build SNAPBUILD-104071
RUN: /usr/share/launchpad-buildd/slavebin/in-target umount-chroot --backend=lxd --series=xenial --arch=amd64 SNAPBUILD-104071
Stopping target for build SNAPBUILD-104071
RUN: /usr/share/launchpad-buildd/slavebin/in-target remove-build --backend=lxd --series=xenial --arch=amd64 SNAPBUILD-104071

Complete log: https://build.snapcraft.io/user/lirios/text/104071

Am I missing something?

I think @ondra ran into this and it might be what @cjwatson is looking into fixing.

1 Like

It is indeed. I have a fix locally, but need to find time to test it across a few different series and build types to make sure it doesn’t regress anything else.

1 Like

Have you pin pointed the root cause for this?

More or less. Core snap now does more security setup on configure and
we now need the mac_admin and mac_override capabilities which we’d
previously been dropping. I think there’s also a missing dependency
from snapd on udev which I need to file once I confirm it, but that’s
workaroundable in launchpad-buildd.

@sergiusens @cjwatson ah okay, thanks a lot for the quick response! Is there an issue to track this?

1 Like

Belatedly, this is now fixed.

1 Like

Yep, I already noticed (and my snaps build now! :)) Thanks a lot!