Use of 'sudo' without dependency on 'sudo' package
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-image (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
Recently we have backported the ubuntu-image ubuntu-core build support in livecd-rootfs in xenial. Thanks to this we are now able to build ubuntu-core 16 images using SUITE=xenial.
Sadly, in comparison to other series, the xenial ubuntu-image has additional logic used when preparing ext4 partitions due to an old mkfs.ext4 which is missing all the needed functionality. This additional logic (or hack) requires running a `sudo cp` to copy the rootfs contents onto the partition. The launchpad builders do not have 'sudo' installed by default. When attempting to verify bug #1799736 it was found that the build would fail when 'sudo' could not be found. The python3-
[Test Case]
The best test case would be to see if ubuntu-core SUITE=xenial (core16) images still fail to build due to sudo not being available after the package lands in xenial-proposed.
[Regression Potential]
The change is only a dependency addition so it should not have any real consequences. All systems so far had sudo by default, so no users will see any side-effects (and those that do, they couldn't use ubuntu-image anyway).
Changed in ubuntu-image (Ubuntu): | |
status: | New → Invalid |
Changed in ubuntu-image (Ubuntu Xenial): | |
status: | New → Confirmed |
I was verifying bug #1799736 on amd64 with livecd-rootfs 2.408.41 from -proposed following the test case in that bugs description which performs a build of ubuntu-core16 snap. My testing diverged from the test plan in that I was driving livecd-rootfs with ubuntu- old-fashioned[ 1] which builds with launchpad-buildd tools in a lxd container to replicate the buildd environment. In that environment the build fails due to the lack of 'sudo':
[2018-12-10 18:06:08] lb_build python3/ dist-packages/ ubuntu_ image/_ _main__ .py", line 341, in main state_machine) python3/ dist-packages/ ubuntu_ image/state. py", line 82, in __next__ python3/ dist-packages/ ubuntu_ image/common_ builder. py", line 337, in populate_ filesystems _populate_ one_volume( name, volume) python3/ dist-packages/ ubuntu_ image/common_ builder. py", line 290, in _populate_ one_volume ownership= True) python3/ dist-packages/ ubuntu_ image/helpers. py", line 233, in mkfs_ext4 python3. 5/contextlib. py", line 59, in __enter__ python3/ dist-packages/ ubuntu_ image/helpers. py", line 207, in mount python3/ dist-packages/ ubuntu_ image/helpers. py", line 115, in run python3. 5/subprocess. py", line 693, in run python3. 5/subprocess. py", line 947, in __init__ signals, start_new_session) python3. 5/subprocess. py", line 1551, in _execute_child _type(errno_ num, err_msg) python2. 7/dist- packages/ lpbuildd/ target/ build_livefs. py", line 161, in run python2. 7/dist- packages/ lpbuildd/ target/ build_livefs. py", line 152, in build run_build_ command( ["lb", "build"], env=base_lb_env) python2. 7/dist- packages/ lpbuildd/ target/ build_livefs. py", line 79, in run_build_command run(args, cwd="/build", **kwargs) python2. 7/dist- packages/ lpbuildd/ target/ lxd.py" , line 490, in run check_call( cmd, **kwargs) python2. 7/subprocess. py", line 541, in check_call ror(retcode, cmd) ubuntu- core', '--env', 'ARCH=amd64', '--', '/bin/sh', '-c', 'cd /build && linux64 lb build']' returned non-zero exit status 1
P: Executing auto/build script.
Fetching core
Fetching pc-kernel
Fetching pc
Warning: for backwards compatibility, `ubuntu-image` falls back to `ubuntu-image snap` if no subcommand is given
-o/--output is deprecated; use -O/--output-dir instead
Crash in state machine
Traceback (most recent call last):
File "/usr/lib/
list(
File "/usr/lib/
step()
File "/usr/lib/
self.
File "/usr/lib/
preserve_
File "/usr/lib/
with mount(img_file) as mountpoint:
File "/usr/lib/
return next(self.gen)
File "/usr/lib/
run('sudo mount -oloop {} {}'.format(img, mountpoint))
File "/usr/lib/
**args)
File "/usr/lib/
with Popen(*popenargs, **kwargs) as process:
File "/usr/lib/
restore_
File "/usr/lib/
raise child_exception
FileNotFoundError: [Errno 2] No such file or directory: 'sudo'
Build failed
Traceback (most recent call last):
File "/usr/lib/
self.build()
File "/usr/lib/
self.
File "/usr/lib/
return self.backend.
File "/usr/lib/
subprocess.
File "/usr/lib/
raise CalledProcessEr
CalledProcessError: Command '['lxc', 'exec', 'lp-xenial-amd64', '--env', 'PROJECT=
The rootfs used by the builders does not have 'sudo' installed; python3- ubuntu- image should have a package dependency on 'sudo' based on this testing. However, I d...