Can't use pbuilder inside simple lxc container?

Bug #1791437 reported by Dan Kegel
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
pbuilder (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

On Ubuntu 18.04, I was trying to reproduce a problem, so I spun up an lxc container and ran my reproduce script in it, i.e.

#!/bin/sh
set -ex
sudo apt install dh-make-golang
DIST=bionic git-pbuilder create
dh-make-golang github.com/gomatic/renderizer
cd renderizer/
gbp buildpackage --git-dist=bionic --git-pbuilder

This failed with

+ DIST=bionic git-pbuilder create
I: Invoking pbuilder
I: forking: pbuilder create --buildplace /var/cache/pbuilder/base-bionic.cow --mirror http://archive.ubuntu.com/ubuntu --distribution bionic --no-targz --extrapackages cowdancer
W: /home/ubuntu/.pbuilderrc does not exist
I: Running in no-targz mode
I: Distribution is bionic.
I: Current time: Sat Sep 8 14:40:20 UTC 2018
I: pbuilder-time-stamp: 1536417620
I: Building the build environment
I: running debootstrap
/usr/sbin/debootstrap
mknod: /var/cache/pbuilder/base-bionic.cow/test-dev-null: Operation not permitted
E: Cannot install into target '/var/cache/pbuilder/base-bionic.cow' mounted with noexec or nodev

Sad face. Not sure who's at fault here, is it me, debootstrap, pbuilder, or gbp?

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: pbuilder 0.229.1
ProcVersionSignature: User Name 4.15.0-33.36-generic 4.15.18
Uname: Linux 4.15.0-33-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.2
Architecture: amd64
Date: Sat Sep 8 14:47:59 2018
PackageArchitecture: all
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=C.UTF-8
 SHELL=/bin/bash
SourcePackage: pbuilder
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Dan Kegel (dank) wrote :
Revision history for this message
Dan Kegel (dank) wrote :

Correction: the repro script was

#!/bin/sh
set -ex
sudo apt install dh-make-golang
DIST=bionic git-pbuilder create dh-make-golang github.com/gomatic/renderizer
dh-make-golang github.com/gomatic/renderizer
cd renderizer/
gbp buildpackage --git-dist=bionic --git-pbuilder

Revision history for this message
Mattia Rizzolo (mapreri) wrote :

That's your lxc configuration that doesn't allow mknode(2), so you can't run debootstrap within it. So it'd say your environment is too restrictive to do what you want to do.

Changed in pbuilder (Ubuntu):
status: New → Invalid
Revision history for this message
Dan Kegel (dank) wrote :

Oh? Then you think https://bugs.launchpad.net/ubuntu/+source/makedev/+bug/1675163 was decided incorrectly, and makedev should indeed create devices inside lxc containers?

Revision history for this message
Mattia Rizzolo (mapreri) wrote :

Yes and no. In the case of the makedev installation phase I think it can be somewhat senseful to not create the device nodes if it's not going to work.

But here we are talking about debootstrap, which only creates a very few device nodes for some important devs, like /dev/null… You are going to need it, if you disallow its creation you can't expect it to work.

For this case, I expect just running the deboostrap (= `pbuilder create`) phase out of lxc and the rest inside to just work, btw.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.